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

Tidy up msp related #includes

This commit is contained in:
Martin Budden 2016-10-05 08:33:35 +01:00
parent 4baa995ebc
commit ea6b459ead
7 changed files with 20 additions and 31 deletions

View file

@ -898,8 +898,14 @@ void taskUpdateAttitude(uint32_t currentTime)
void taskHandleSerial(uint32_t currentTime)
{
UNUSED(currentTime);
handleSerial();
#ifdef USE_CLI
// in cli mode, all serial stuff goes to here. enter cli mode by sending #
if (cliMode) {
cliProcess();
return;
}
#endif
mspSerialProcess();
}
void taskUpdateBeeper(uint32_t currentTime)

View file

@ -42,7 +42,6 @@
#endif
#include "io/serial.h"
#include "serial_cli.h"
#include "serial_msp.h"
@ -423,19 +422,6 @@ bool serialIsPortAvailable(serialPortIdentifier_e identifier)
return false;
}
void handleSerial(void)
{
#ifdef USE_CLI
// in cli mode, all serial stuff goes to here. enter cli mode by sending #
if (cliMode) {
cliProcess();
return;
}
#endif
mspSerialProcess();
}
void waitForSerialPortToFinishTransmitting(serialPort_t *serialPort)
{
while (!isSerialTransmitBufferEmpty(serialPort)) {

View file

@ -140,8 +140,4 @@ baudRate_e lookupBaudRateIndex(uint32_t baudRate);
// msp/cli/bootloader
//
void evaluateOtherData(serialPort_t *serialPort, uint8_t receivedChar);
void handleSerial(void);
void evaluateOtherData(serialPort_t *serialPort, uint8_t receivedChar);
void handleSerial(void);
void serialPassthrough(serialPort_t *left, serialPort_t *right, serialConsumer *leftC, serialConsumer *rightC);

View file

@ -19,8 +19,6 @@
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include "platform.h"
@ -38,7 +36,6 @@
#include "flight/mixer.h"
#include "io/beeper.h"
#include "io/serial_msp.h"
#include "io/serial_4way.h"
#ifdef USE_SERIAL_4WAY_BLHELI_BOOTLOADER

View file

@ -21,7 +21,7 @@
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "platform.h"
#ifdef USE_SERIAL_4WAY_BLHELI_INTERFACE
@ -31,13 +31,13 @@
#include "drivers/serial.h"
#include "drivers/timer.h"
#include "drivers/pwm_mapping.h"
#include "io/serial.h"
#include "io/serial_msp.h"
#include "io/serial_4way.h"
#include "io/serial_4way_impl.h"
#include "io/serial_4way_avrootloader.h"
#if defined(USE_SERIAL_4WAY_BLHELI_BOOTLOADER) && !defined(USE_FAKE_ESC)
#if defined(USE_SERIAL_4WAY_BLHELI_BOOTLOADER) && !defined(USE_FAKE_ESC)
// Bootloader commands
// RunCmd

View file

@ -17,10 +17,9 @@
* have a look at https://github.com/sim-/tgy/blob/master/boot.inc
* for info about the stk500v2 implementation
*/
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "platform.h"
@ -28,13 +27,13 @@
#include "drivers/io.h"
#include "drivers/serial.h"
#include "config/config.h"
#include "drivers/system.h"
#include "io/serial.h"
#include "io/serial_msp.h"
#include "io/serial_4way.h"
#include "io/serial_4way_impl.h"
#include "io/serial_4way_stk500v2.h"
#include "drivers/system.h"
#ifdef USE_SERIAL_4WAY_SK_BOOTLOADER
#define BIT_LO_US (32) //32uS

View file

@ -100,6 +100,11 @@ static void setCurrentPort(mspPort_t *port)
mspSerialPort = currentPort->port;
}
/*
* Process MSP commands from serial ports configured as MSP ports.
*
* Called periodically by the scheduler.
*/
void mspSerialProcess(void)
{
uint8_t portIndex;