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:
parent
5142ff032a
commit
2c79b9777e
8 changed files with 140 additions and 89 deletions
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue