From 1a7491c4f6f74f7a996a7234cf26496e3521ce3c Mon Sep 17 00:00:00 2001 From: Radzhab Bisultanov Date: Fri, 17 Apr 2026 16:21:55 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B0=20=D1=82=D0=B0=D0=B9=D0=BC=D0=B5?= =?UTF-8?q?=D1=80=207=20=D0=BF=D0=BE=D1=81=D1=82=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20PID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/main.cpp | 13 ++++- drone.ewp | 146 ++++++++++++++++++++++-------------------------- drone.ewt | 139 +++++++++++++++++++++------------------------ 3 files changed, 143 insertions(+), 155 deletions(-) diff --git a/Source/main.cpp b/Source/main.cpp index ada59c8..331571a 100644 --- a/Source/main.cpp +++ b/Source/main.cpp @@ -118,7 +118,12 @@ void TimerUpdateMain() if(MainDrone.ExternMagInit) MagObj->GetAsync(DoneProcMag);*/ } -static bool control_update_flag = 0; +static bool control_update_flag = false; + +void TimerUpdateControl() +{ + control_update_flag = true; +} int main() { @@ -128,15 +133,17 @@ int main() TICK_Init(); TIM6_Init(TIM_PRIORITY, 500, TimerUpdateSensor, TimerUpdateMain); + TIM7_Init(TIM_PRIORITY, 200, TimerUpdateControl); IMUObj = TryFindIMU(MainDrone.IMUInit); TIM6_Enable(); + TIM7_Enable(); attitude_t attitude; rc_channels rx_chs_raw; rc_channels rx_chs_normalized; - control_channels_t ctrl_chs; + static control_channels_t ctrl_chs; attitude_init(&attitude); receiver_init(); @@ -149,7 +156,7 @@ int main() if (control_update_flag) { - control_update_flag = 0; + control_update_flag = false; Vector3 Gyro = Vector3(DataIMU.Gyr.X, DataIMU.Gyr.Y, DataIMU.Gyr.Z); diff --git a/drone.ewp b/drone.ewp index c8b1597..8aa4b53 100644 --- a/drone.ewp +++ b/drone.ewp @@ -356,12 +356,11 @@