mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-18 22:05:17 +03:00
Remove main.c's dependency on mw.h/board.h.
Moved pidControllers out of mw.c into flight_common.c/h. Moved appropriate code into rc_controls.c/h.
This commit is contained in:
parent
2c80094b0e
commit
fe89d40fa0
28 changed files with 333 additions and 232 deletions
15
src/rc_controls.c
Normal file
15
src/rc_controls.c
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "common/maths.h"
|
||||
|
||||
#include "rc_controls.h"
|
||||
|
||||
int16_t rcCommand[4]; // interval [1000;2000] for THROTTLE and [-500;+500] for ROLL/PITCH/YAW
|
||||
|
||||
bool areSticksInApModePosition(uint16_t ap_mode)
|
||||
{
|
||||
return abs(rcCommand[ROLL]) < ap_mode && abs(rcCommand[PITCH]) < ap_mode;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue