mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 06:15:16 +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
38
src/rc_controls.h
Normal file
38
src/rc_controls.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
#pragma once
|
||||
|
||||
typedef enum rc_alias {
|
||||
ROLL = 0,
|
||||
PITCH,
|
||||
YAW,
|
||||
THROTTLE,
|
||||
AUX1,
|
||||
AUX2,
|
||||
AUX3,
|
||||
AUX4
|
||||
} rc_alias_e;
|
||||
|
||||
#define ROL_LO (1 << (2 * ROLL))
|
||||
#define ROL_CE (3 << (2 * ROLL))
|
||||
#define ROL_HI (2 << (2 * ROLL))
|
||||
#define PIT_LO (1 << (2 * PITCH))
|
||||
#define PIT_CE (3 << (2 * PITCH))
|
||||
#define PIT_HI (2 << (2 * PITCH))
|
||||
#define YAW_LO (1 << (2 * YAW))
|
||||
#define YAW_CE (3 << (2 * YAW))
|
||||
#define YAW_HI (2 << (2 * YAW))
|
||||
#define THR_LO (1 << (2 * THROTTLE))
|
||||
#define THR_CE (3 << (2 * THROTTLE))
|
||||
#define THR_HI (2 << (2 * THROTTLE))
|
||||
|
||||
typedef struct controlRateConfig_s {
|
||||
uint8_t rcRate8;
|
||||
uint8_t rcExpo8;
|
||||
uint8_t thrMid8;
|
||||
uint8_t thrExpo8;
|
||||
uint8_t rollPitchRate;
|
||||
uint8_t yawRate;
|
||||
} controlRateConfig_t;
|
||||
|
||||
extern int16_t rcCommand[4];
|
||||
|
||||
bool areSticksInApModePosition(uint16_t ap_mode);
|
Loading…
Add table
Add a link
Reference in a new issue