diff --git a/project/ble_peripheral/ble_app_bladder_patch/command/handlers/cmd_piezo.c b/project/ble_peripheral/ble_app_bladder_patch/command/handlers/cmd_piezo.c index 588cd17..b479e63 100644 --- a/project/ble_peripheral/ble_app_bladder_patch/command/handlers/cmd_piezo.c +++ b/project/ble_peripheral/ble_app_bladder_patch/command/handlers/cmd_piezo.c @@ -283,11 +283,6 @@ int Cmd_maa(const ParsedCmd *cmd) return 1; } - if (!dr_piezo_is_power_on()) - { - dr_piezo_power_on(); - } - err = maa_async_start( m_config.piezo_freq_option, m_config.piezo_delay_us, @@ -340,11 +335,6 @@ int Cmd_mbb(const ParsedCmd *cmd) maa_async_set_pre_capture_all(true); - if (!dr_piezo_is_power_on()) - { - dr_piezo_power_on(); - } - err = maa_async_start( m_config.piezo_freq_option, m_config.piezo_delay_us, @@ -396,11 +386,6 @@ int Cmd_mtb(const ParsedCmd *cmd) maa_async_set_pre_capture_all(true); - if (!dr_piezo_is_power_on()) - { - dr_piezo_power_on(); - } - err = maa_async_start( m_config.piezo_freq_option, m_config.piezo_delay_us, 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 1656774..e45d8b0 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 @@ -53,7 +53,9 @@ extern void dr_piezo_burst_sw_20mhz(uint8_t cycles); extern void dr_piezo_burst_sw_17mhz(uint8_t cycles); extern void dr_piezo_burst_sw_22mhz(uint8_t cycles); extern void dr_piezo_burst_sw_19mhz(uint8_t cycles); +extern void dr_piezo_power_on(void); extern void dr_piezo_power_off(void); +extern bool dr_piezo_is_power_on(void); #include "parser.h" @@ -1380,6 +1382,11 @@ 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; + if (!dr_piezo_is_power_on()) + { + dr_piezo_power_on(); + } + /* Warm up CH0 before real capture (MAA_ASYNC_WARMUP_COUNT). */ for (uint8_t warmup = 0; warmup < MAA_ASYNC_WARMUP_COUNT; warmup++) {