Question on adc1_get_raw

johnyan
Posts: 1
Joined: Thu Oct 24, 2019 3:10 pm

Question on adc1_get_raw

Postby johnyan » Thu Oct 24, 2019 3:22 pm

Hello everyone,

I know adc1_get_raw is blocking cpu on polling meas1_done_sar.

Code: Select all

while (SENS.sar_meas_start1.meas1_done_sar == 0);
Can we add taskYIELD() to make it slightly efficient?

Code: Select all

while (SENS.sar_meas_start1.meas1_done_sar == 0) taskYIELD();
Thanks,
John

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Question on adc1_get_raw

Postby Ritesh » Sun Oct 27, 2019 11:57 am

johnyan wrote:
Thu Oct 24, 2019 3:22 pm
Hello everyone,

I know adc1_get_raw is blocking cpu on polling meas1_done_sar.

Code: Select all

while (SENS.sar_meas_start1.meas1_done_sar == 0);
Can we add taskYIELD() to make it slightly efficient?

Code: Select all

while (SENS.sar_meas_start1.meas1_done_sar == 0) taskYIELD();
Thanks,
John
What issue you are facing after adding that code? Or you can also add some delay for that.
Regards,
Ritesh Prajapati

Who is online

Users browsing this forum: No registered users and 112 guests