Обработка данных IMU переделана наподобие рабочей прошивки

This commit is contained in:
2026-04-01 16:07:32 +03:00
parent e11c94c357
commit 699577d82b
4 changed files with 94 additions and 7 deletions

View File

@@ -12,6 +12,7 @@ void TIM6_DAC_IRQHandler();
static uint8_t irs_update_flag = 0;
static uint8_t control_update_flag = 0;
static uint8_t allowed_calib = 0;
imu_scaled_t imu;
IRS irs;
@@ -60,7 +61,7 @@ int main(void)
{
irs_update_flag = 0;
imu_read_scaled(&imu);
imu_read_scaled(&imu, &allowed_calib);
irs.gyro.x = imu.gx;
irs.gyro.y = imu.gy;
@@ -89,6 +90,8 @@ int main(void)
if (rx_chs_normalized.rc_armed)
{
allowed_calib = 1;
motors_set_throttle_mix(
rx_chs_normalized.rc_throttle,
&ctrl_chs,
@@ -98,6 +101,7 @@ int main(void)
else
{
motors_turn_off();
allowed_calib = 0;
}
}
}