mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 01:35:41 +03:00
43 lines
833 B
C
43 lines
833 B
C
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#include "platform.h"
|
|
|
|
#include "drivers/system_common.h"
|
|
|
|
#include "drivers/serial_common.h"
|
|
#include "drivers/serial_uart_common.h"
|
|
#include "serial_common.h"
|
|
|
|
#include "rx_common.h"
|
|
#include "rx_msp.h"
|
|
|
|
static bool rxMspFrameDone = false;
|
|
|
|
static uint16_t rxMspReadRawRC(rxRuntimeConfig_t *rxRuntimeConfig, uint8_t chan)
|
|
{
|
|
return rcData[chan];
|
|
}
|
|
|
|
void rxMspFrameRecieve(void)
|
|
{
|
|
rxMspFrameDone = true;
|
|
}
|
|
|
|
bool rxMspFrameComplete(void)
|
|
{
|
|
if (rxMspFrameDone) {
|
|
rxMspFrameDone = false;
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
bool rxMspInit(rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig, rcReadRawDataPtr *callback)
|
|
{
|
|
rxRuntimeConfig->channelCount = 8; // See MSP_SET_RAW_RC
|
|
if (callback)
|
|
*callback = rxMspReadRawRC;
|
|
|
|
return true;
|
|
}
|