1
0
Fork 0
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:
treymarc 2014-05-01 05:06:36 +02:00
parent 8a5f424421
commit ed46b4e4ac
7 changed files with 44 additions and 1 deletions

31
src/rxmsp.c Normal file
View 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;
}