IMU FIFO 동시 진입 방지 및 MCLK ready timeout 추가
- IMU FIFO capture가 이미 활성화되어 있는 상태에서 msp?/mim? 등이 들어오는 경우 요청 무시 - MCLK_RDY 대기에 timeout 추가해 IMU/I2C 상태가 꼬였을 때 메인 루프가 멈추지 않도록 함
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "cmd_common.h"
|
||||
#include "cmd_sensor.h"
|
||||
#include "app_raw.h"
|
||||
|
||||
/*==============================================================================
|
||||
* msn? -> rsn: Battery level ADC measurement
|
||||
@@ -58,6 +59,12 @@ int Cmd_mst(const ParsedCmd *cmd)
|
||||
int Cmd_msp(const ParsedCmd *cmd)
|
||||
{
|
||||
(void)cmd;
|
||||
|
||||
if (imu_fifo_capture_is_active())
|
||||
{
|
||||
return 1; // already owned by mtb?/mim?, ignore duplicate request
|
||||
}
|
||||
|
||||
hw_i2c_init_once();
|
||||
imu_read_direct();
|
||||
return 1;
|
||||
@@ -78,6 +85,11 @@ int Cmd_mim(const ParsedCmd *cmd)
|
||||
int rc;
|
||||
(void)cmd;
|
||||
|
||||
if (imu_fifo_capture_is_active())
|
||||
{
|
||||
return 1; // already owned by mtb?/mim?, ignore duplicate request
|
||||
}
|
||||
|
||||
rc = imu_fifo_capture_start();
|
||||
if (rc != 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user