diff --git a/project/ble_peripheral/ble_app_bladder_patch/measurement/adc121s051/dr_adc121s051.c b/project/ble_peripheral/ble_app_bladder_patch/measurement/adc121s051/dr_adc121s051.c index 40a5d12..1fa1e53 100644 --- a/project/ble_peripheral/ble_app_bladder_patch/measurement/adc121s051/dr_adc121s051.c +++ b/project/ble_peripheral/ble_app_bladder_patch/measurement/adc121s051/dr_adc121s051.c @@ -698,12 +698,11 @@ dr_adc_err_t dr_adc_burst_capture_transmit(uint8_t freq_option, uint16_t delay_u for (uint16_t avg_iter = 0; avg_iter < averaging; avg_iter++) { - /* Wait for previous echo to decay before next measurement - * 1ms = ~77cm round-trip decay time (sound speed 1.54mm/us) - * Skip delay on first iteration */ + /* Wait for previous echo and ringing to decay before next measurement. + * Skip delay on first iteration. */ if (avg_iter > 0) { - nrf_delay_us(500); /* 500us between measurements */ + nrf_delay_us(DR_ADC_AVG_INTER_BURST_GAP_US); } /* Re-select piezo channel before each burst @@ -888,6 +887,12 @@ dr_adc_err_t dr_adc_capture_channel_only(uint8_t freq_option, uint16_t delay_us, /* repeat measurement 'averaging' times per channel */ for (uint16_t avg_iter = 0; avg_iter < averaging; avg_iter++) { + /* Let the previous burst decay before the next averaged shot. */ + if (avg_iter > 0) + { + nrf_delay_us(DR_ADC_AVG_INTER_BURST_GAP_US); + } + /* TX burst pulse */ switch (freq_option) {