Некоторая реализация логики перенесена в main
This commit is contained in:
@@ -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
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user