mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 15:25:36 +03:00
add serial_rx msp
This commit is contained in:
parent
8a5f424421
commit
ed46b4e4ac
7 changed files with 44 additions and 1 deletions
31
src/rxmsp.c
Normal file
31
src/rxmsp.c
Normal file
|
@ -0,0 +1,31 @@
|
|||
#include "board.h"
|
||||
#include "mw.h"
|
||||
|
||||
static bool rxMspFrameDone = false;
|
||||
|
||||
static uint16_t mspReadRawRC(uint8_t chan);
|
||||
static uint16_t mspReadRawRC(uint8_t chan)
|
||||
{
|
||||
return rcData[chan];
|
||||
}
|
||||
|
||||
void mspFrameRecieve(void)
|
||||
{
|
||||
rxMspFrameDone = true;
|
||||
}
|
||||
|
||||
bool mspFrameComplete(void)
|
||||
{
|
||||
if (rxMspFrameDone) {
|
||||
failsafeCnt = 0; // clear FailSafe counter
|
||||
rxMspFrameDone = false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void mspInit(rcReadRawDataPtr *callback)
|
||||
{
|
||||
if (callback)
|
||||
*callback = mspReadRawRC;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue