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 9c32c54..11ced3c 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 @@ -1348,8 +1348,8 @@ dr_adc_err_t maa_async_start(uint8_t freq_option, uint16_t delay_us, uint16_t nu /* capture all channels without BLE TX, then start transmission */ g_maa_ctx.state = MAA_ASYNC_CAPTURING; - /* Warm up CH0 6 times and discard the results before the real capture starts. */ - for (uint8_t warmup = 0; warmup < 6; warmup++) + /* Warm up CH0 before real capture (MAA_ASYNC_WARMUP_COUNT). */ + for (uint8_t warmup = 0; warmup < MAA_ASYNC_WARMUP_COUNT; warmup++) { err = dr_adc_capture_channel_only( g_maa_ctx.freq_option, diff --git a/project/ble_peripheral/ble_app_bladder_patch/measurement/adc121s051/dr_adc121s051.h b/project/ble_peripheral/ble_app_bladder_patch/measurement/adc121s051/dr_adc121s051.h index fd09eea..ef31687 100644 --- a/project/ble_peripheral/ble_app_bladder_patch/measurement/adc121s051/dr_adc121s051.h +++ b/project/ble_peripheral/ble_app_bladder_patch/measurement/adc121s051/dr_adc121s051.h @@ -326,6 +326,11 @@ void dr_piezo_select_channel(uint8_t channel); #define MAA_NUM_CHANNELS 6 /* 4 -> 8 -> 6 jhChun 26.03.17*/ #define MAA_SAMPLES_MAX 200 +/* CH0 warm-up captures before maa/mbb/mtb (each costs ~1 MUX settle + burst + ADC). */ +#ifndef MAA_ASYNC_WARMUP_COUNT +#define MAA_ASYNC_WARMUP_COUNT 5U +#endif + /** * @brief Echo data for one channel */