Некоторая реализация логики перенесена в main

This commit is contained in:
2026-03-26 12:31:03 +03:00
parent 49f45bd4fe
commit b95a716415
7 changed files with 164 additions and 116 deletions

View File

@@ -5,15 +5,14 @@
#include "vector.h"
#include "pid.h"
#include "radio_receiver.h"
#include "imu_processing.h"
#include "IRS.h"
typedef struct
{
Vector3 gyro;
} attitude_t;
static uint8_t imu_update_flag = 0;
static uint8_t pid_update_flag = 0;
void attitude_init(attitude_t* att);
void attitude_controller_update(control_channels_t* control,
@@ -23,6 +22,5 @@ void attitude_controller_update(control_channels_t* control,
Quaternion rx_to_quaternion(const rc_channels* rx);
float constrain(float x, float min, float max);
void TIM6_DAC_IRQHandler();
#endif

View File

@@ -66,14 +66,4 @@ float constrain(float x, float min, float max)
{
if (x < min) x = min; else if (x > max) x = max;
return x;
}
void TIM6_DAC_IRQHandler()
{
if (TIM6->SR & TIM_SR_UIF)
{
TIM6->SR &= ~TIM_SR_UIF;
imu_update_flag = 1;
pid_update_flag = 1;
}
}