From 39e78950575d52f0a69d0f5f76c142090ac7ff78 Mon Sep 17 00:00:00 2001 From: jhchun Date: Wed, 15 Jul 2026 09:41:03 +0900 Subject: [PATCH] =?UTF-8?q?IMU=20FIFO=20=EC=BA=A1=EC=B2=98=20=EC=A4=91=20m?= =?UTF-8?q?sp/mim=20=EB=8F=99=EC=8B=9C=20=EC=A0=91=EA=B7=BC=20=EB=B0=A9?= =?UTF-8?q?=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - IMU FIFO 캡처 중인 경우 조용히 무시 --- src/command/handlers/cmd_piezo.c | 14 +++++++++++++- src/command/handlers/cmd_sensor.c | 5 +++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/command/handlers/cmd_piezo.c b/src/command/handlers/cmd_piezo.c index a90ce48..3e7d3d7 100644 --- a/src/command/handlers/cmd_piezo.c +++ b/src/command/handlers/cmd_piezo.c @@ -221,12 +221,22 @@ int cmd_mim(const uint8_t *data, uint8_t data_len) ARG_UNUSED(data); ARG_UNUSED(data_len); + if (processing) + { + return 1; + } + + processing = true; + power_button_suspend(true); + uint16_t rim_count = 0U; int imu_ret = imu_fifo_start(); if (imu_ret != 0) { DBG_PRINTF("[MTB] fifo start fail ret=%d\r\n", imu_ret); cmd_send_response_rim(tx_rim_samples, 0U); + power_button_suspend(false); + processing = false; return 1; } @@ -241,6 +251,8 @@ int cmd_mim(const uint8_t *data, uint8_t data_len) cmd_send_response_rim(tx_rim_samples, rim_count); // IMU FIFO 15 samples rim: 전송 imu_fifo_stop(); + power_button_suspend(false); + processing = false; return 1; } @@ -492,4 +504,4 @@ int cmd_mad(const uint8_t *data, uint8_t data_len) processing = false; return 1; -} \ No newline at end of file +} diff --git a/src/command/handlers/cmd_sensor.c b/src/command/handlers/cmd_sensor.c index cf49635..7f98820 100644 --- a/src/command/handlers/cmd_sensor.c +++ b/src/command/handlers/cmd_sensor.c @@ -39,6 +39,11 @@ int cmd_msp(const uint8_t *data, uint8_t data_len) ARG_UNUSED(data); ARG_UNUSED(data_len); + if (processing) + { + return 1; + } + int16_t accel[3], gyro[3]; int ret = imu_read(accel, gyro);