1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 00:05:33 +03:00

Large code re-organization which separates some key tasks in the rx

code.

Tested with X8R in SBus and PWM, and Spek Sat, GR-24 PPM, PWM and SUMD,
Spek PPM
This commit is contained in:
Dominic Clifton 2015-08-18 06:25:30 +01:00
parent 5142ff032a
commit 2c79b9777e
8 changed files with 140 additions and 89 deletions

View file

@ -227,6 +227,17 @@ static void ppmEdgeCallback(timerCCHandlerRec_t* cbRec, captureCompare_t capture
#define MAX_MISSED_PWM_EVENTS 10
bool isPWMDataBeingReceived(void)
{
int channel;
for (channel = 0; channel < PWM_PORTS_OR_PPM_CAPTURE_COUNT; channel++) {
if (captures[channel] != PPM_RCVR_TIMEOUT) {
return true;
}
}
return false;
}
static void pwmOverflowCallback(timerOvrHandlerRec_t* cbRec, captureCompare_t capture)
{
UNUSED(capture);
@ -346,8 +357,6 @@ uint16_t ppmRead(uint8_t channel)
uint16_t pwmRead(uint8_t channel)
{
uint16_t capture = captures[channel];
captures[channel] = PPM_RCVR_TIMEOUT;
return capture;
return captures[channel];
}