diff --git a/project/ble_peripheral/ble_app_bladder_patch/command/handlers/cmd_device.c b/project/ble_peripheral/ble_app_bladder_patch/command/handlers/cmd_device.c index 7405ab0..a9caf33 100644 --- a/project/ble_peripheral/ble_app_bladder_patch/command/handlers/cmd_device.c +++ b/project/ble_peripheral/ble_app_bladder_patch/command/handlers/cmd_device.c @@ -12,6 +12,7 @@ #include "cmd_device.h" #include "fstorage.h" #include "led_control.h" +#include "app_raw.h" /*============================================================================== * msq? -> rsq: Device power OFF @@ -172,6 +173,14 @@ int Cmd_mls(const ParsedCmd *cmd) } led_set_state((led_state_t)state); + if ((led_state_t)state == LED_STATE_OFF) + { + if (imu_fifo_capture_is_active()) + { + imu_fifo_capture_disable(); + } + } + dr_ble_return_1("rls:", state); return 1; } diff --git a/project/ble_peripheral/ble_app_bladder_patch/measurement/imu/app_raw/app_raw.h b/project/ble_peripheral/ble_app_bladder_patch/measurement/imu/app_raw/app_raw.h index 240c9a8..e85fcef 100644 --- a/project/ble_peripheral/ble_app_bladder_patch/measurement/imu/app_raw/app_raw.h +++ b/project/ble_peripheral/ble_app_bladder_patch/measurement/imu/app_raw/app_raw.h @@ -122,6 +122,11 @@ int imu_fifo_capture_start(void); */ int imu_fifo_capture_stop_and_send_rim(void); +/** + * \brief Stop IMU FIFO capture without sending rim: packets. + */ +void imu_fifo_capture_disable(void); + /* * mtb? / rim: binary layout (every BLE fragment) * [ 'r' 'i' 'm' ':' ] [ total_sample_count u16 BE ] [ 12 * total_sample_count bytes ... ]