I'm using the ble_app_hrs_adc_battery_measurement example ADC code in my project
However, I don't understand what these lines do
As far as I can tell, the while loop seems to call nrf_drv_adc_sample() for the number of samples that are required in the buffer
However, nrf_drv_adc_sample() is no blocking, but there is while() loop
while((NRF_ADC->BUSY & ADC_BUSY_BUSY_Msk) == ADC_BUSY_BUSY_Busy) {} //Wait until the ADC is finished sampling
Which appears to make the code be blocking.
Looking at the adc complete callback, it only gets called once per call to adc_sample()
Not for all 6 calls.
Can someone explain why this is ?
Edit. I initially had a problems because I was not using the App Scheduler to call the adc_sample()
I now understand that the ADC code will only run in the main context and the App Scheduler is required to effective mode the call to adc_sample to the main loop
I would still be interested in understanding about why the code appears to use blocking.