1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-20 14:55:21 +03:00

de-duplicate failsafe code. extract failsafe code to seperate files.

remove dependency on board.h and mw.h on a few files.

Moved rx configuration paramaters into rxConfig in order to remove the
dependency on config_t from the sbus rx code  - sumd/spektrum to follow.

Avoided use of YAW/PITCH/ROLL in some files since those constants are
from an unrelated enum type.

Replaced some magic numbers with constants to remove comments and
improve code readability.

Note, due to the tight coupling and global variable usage it was
difficult to create a smaller commit.
This commit is contained in:
Dominic Clifton 2014-04-17 23:02:22 +01:00
parent d7eb416aa9
commit 0f02e12f40
26 changed files with 606 additions and 437 deletions

View file

@ -9,7 +9,7 @@
static bool sumdFrameDone = false;
static void sumdDataReceive(uint16_t c);
static uint16_t sumdReadRawRC(uint8_t chan);
static uint16_t sumdReadRawRC(rxConfig_t *rxConfig, uint8_t chan);
static uint32_t sumdChannelData[SUMD_MAX_CHANNEL];
@ -70,7 +70,7 @@ bool sumdFrameComplete(void)
return false;
}
static uint16_t sumdReadRawRC(uint8_t chan)
static uint16_t sumdReadRawRC(rxConfig_t *rxConfig, uint8_t chan)
{
return sumdChannelData[mcfg.rcmap[chan]] / 8;
return sumdChannelData[rxConfig->rcmap[chan]] / 8;
}