IMU FIFO 캡처 중 msp/mim 동시 접근 방지
- IMU FIFO 캡처 중인 경우 조용히 무시
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user