Global variables cleanups

Remove unused PID objects for cli
Move loopRate to time.ino
This commit is contained in:
Oleg Kalachev 2025-01-10 07:10:30 +03:00
parent 85172cdcc8
commit 698cc3d9b8
4 changed files with 3 additions and 4 deletions

View File

@ -6,9 +6,8 @@
#include "pid.h"
#include "vector.h"
extern PID rollRatePID, pitchRatePID, yawRatePID, rollPID, pitchPID;
extern LowPassFilter<Vector> ratesFilter;
extern const int MOTOR_REAR_LEFT, MOTOR_REAR_RIGHT, MOTOR_FRONT_RIGHT, MOTOR_FRONT_LEFT;
extern float loopRate;
const char* motd =
"\nWelcome to\n"

View File

@ -20,7 +20,6 @@
float t = NAN; // current step time, s
float dt; // time delta from previous step, s
float loopRate; // loop rate, Hz
int16_t channels[RC_CHANNELS]; // raw rc channels
float controls[RC_CHANNELS]; // normalized controls in range [-1..1] ([0..1] for throttle)
float controlsTime; // time of the last controls update

View File

@ -3,6 +3,8 @@
// Time related functions
float loopRate; // Hz
void step() {
float now = micros() / 1000000.0;
dt = now - t;

View File

@ -15,7 +15,6 @@
float t = NAN;
float dt;
float loopRate;
float motors[4];
int16_t channels[16]; // raw rc channels
float controls[RC_CHANNELS];