mirror of
https://gitee.com/dlmu-cone/bf_original_balance_chassis
synced 2026-07-24 11:37:45 +08:00
添加了大量调试log,新增了dwt计时宏,增加了USB软件复位防止主控复位后上位机无法连接usb
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "BMI088reg.h"
|
||||
#include "BMI088Middleware.h"
|
||||
#include "bsp_dwt.h"
|
||||
#include "bsp_log.h"
|
||||
#include <math.h>
|
||||
|
||||
#warning this is a legacy support. test the new BMI088 module as soon as possible.
|
||||
@@ -129,7 +130,7 @@ void Calibrate_MPU_Offset(IMU_Data_t *bmi088)
|
||||
startTime = DWT_GetTimeline_s();
|
||||
do
|
||||
{
|
||||
if (DWT_GetTimeline_s() - startTime > 10)
|
||||
if (DWT_GetTimeline_s() - startTime > 12)
|
||||
{
|
||||
// <20><>????
|
||||
bmi088->GyroOffset[0] = GxOFFSET;
|
||||
@@ -137,6 +138,7 @@ void Calibrate_MPU_Offset(IMU_Data_t *bmi088)
|
||||
bmi088->GyroOffset[2] = GzOFFSET;
|
||||
bmi088->gNorm = gNORM;
|
||||
bmi088->TempWhenCali = 40;
|
||||
LOGERROR("[BMI088] Calibrate Failed! Use offline params");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -206,7 +208,11 @@ void Calibrate_MPU_Offset(IMU_Data_t *bmi088)
|
||||
gyroDiff[0] > 0.15f ||
|
||||
gyroDiff[1] > 0.15f ||
|
||||
gyroDiff[2] > 0.15f)
|
||||
{
|
||||
LOGWARNING("[bmi088] calibration was interrupted\n");
|
||||
break;
|
||||
}
|
||||
|
||||
DWT_Delay(0.0005);
|
||||
}
|
||||
|
||||
@@ -252,7 +258,10 @@ uint8_t bmi088_accel_init(void)
|
||||
|
||||
// check the "who am I"
|
||||
if (res != BMI088_ACC_CHIP_ID_VALUE)
|
||||
{
|
||||
LOGERROR("[bmi088] Can not read bmi088 acc chip id");
|
||||
return BMI088_NO_SENSOR;
|
||||
}
|
||||
|
||||
// set accel sonsor config and check
|
||||
for (write_reg_num = 0; write_reg_num < BMI088_WRITE_ACCEL_REG_NUM; write_reg_num++)
|
||||
@@ -294,7 +303,10 @@ uint8_t bmi088_gyro_init(void)
|
||||
|
||||
// check the "who am I"
|
||||
if (res != BMI088_GYRO_CHIP_ID_VALUE)
|
||||
{
|
||||
LOGERROR("[bmi088] Can not read bmi088 gyro chip id");
|
||||
return BMI088_NO_SENSOR;
|
||||
}
|
||||
|
||||
// set gyro sonsor config and check
|
||||
for (write_reg_num = 0; write_reg_num < BMI088_WRITE_GYRO_REG_NUM; write_reg_num++)
|
||||
|
||||
Reference in New Issue
Block a user