IMU FIFO 캡처 중 msp/mim 동시 접근 방지

- IMU FIFO 캡처 중인 경우 조용히 무시
This commit is contained in:
2026-07-15 09:41:03 +09:00
parent 36c8958e03
commit 39e7895057
2 changed files with 18 additions and 1 deletions
+13 -1
View File
@@ -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;
}
}
+5
View File
@@ -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);