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:
parent
4baa995ebc
commit
ea6b459ead
7 changed files with 20 additions and 31 deletions
|
@ -898,8 +898,14 @@ void taskUpdateAttitude(uint32_t currentTime)
|
||||||
void taskHandleSerial(uint32_t currentTime)
|
void taskHandleSerial(uint32_t currentTime)
|
||||||
{
|
{
|
||||||
UNUSED(currentTime);
|
UNUSED(currentTime);
|
||||||
|
#ifdef USE_CLI
|
||||||
handleSerial();
|
// 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)
|
void taskUpdateBeeper(uint32_t currentTime)
|
||||||
|
|
|
@ -42,7 +42,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "io/serial.h"
|
#include "io/serial.h"
|
||||||
#include "serial_cli.h"
|
|
||||||
#include "serial_msp.h"
|
#include "serial_msp.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -423,19 +422,6 @@ bool serialIsPortAvailable(serialPortIdentifier_e identifier)
|
||||||
return false;
|
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)
|
void waitForSerialPortToFinishTransmitting(serialPort_t *serialPort)
|
||||||
{
|
{
|
||||||
while (!isSerialTransmitBufferEmpty(serialPort)) {
|
while (!isSerialTransmitBufferEmpty(serialPort)) {
|
||||||
|
|
|
@ -140,8 +140,4 @@ baudRate_e lookupBaudRateIndex(uint32_t baudRate);
|
||||||
// msp/cli/bootloader
|
// msp/cli/bootloader
|
||||||
//
|
//
|
||||||
void evaluateOtherData(serialPort_t *serialPort, uint8_t receivedChar);
|
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);
|
void serialPassthrough(serialPort_t *left, serialPort_t *right, serialConsumer *leftC, serialConsumer *rightC);
|
||||||
|
|
|
@ -19,8 +19,6 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
|
@ -38,7 +36,6 @@
|
||||||
#include "flight/mixer.h"
|
#include "flight/mixer.h"
|
||||||
|
|
||||||
#include "io/beeper.h"
|
#include "io/beeper.h"
|
||||||
#include "io/serial_msp.h"
|
|
||||||
#include "io/serial_4way.h"
|
#include "io/serial_4way.h"
|
||||||
|
|
||||||
#ifdef USE_SERIAL_4WAY_BLHELI_BOOTLOADER
|
#ifdef USE_SERIAL_4WAY_BLHELI_BOOTLOADER
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
#ifdef USE_SERIAL_4WAY_BLHELI_INTERFACE
|
#ifdef USE_SERIAL_4WAY_BLHELI_INTERFACE
|
||||||
|
@ -31,13 +31,13 @@
|
||||||
#include "drivers/serial.h"
|
#include "drivers/serial.h"
|
||||||
#include "drivers/timer.h"
|
#include "drivers/timer.h"
|
||||||
#include "drivers/pwm_mapping.h"
|
#include "drivers/pwm_mapping.h"
|
||||||
|
|
||||||
#include "io/serial.h"
|
#include "io/serial.h"
|
||||||
#include "io/serial_msp.h"
|
|
||||||
#include "io/serial_4way.h"
|
#include "io/serial_4way.h"
|
||||||
#include "io/serial_4way_impl.h"
|
#include "io/serial_4way_impl.h"
|
||||||
#include "io/serial_4way_avrootloader.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
|
// Bootloader commands
|
||||||
// RunCmd
|
// RunCmd
|
||||||
|
|
|
@ -17,10 +17,9 @@
|
||||||
* have a look at https://github.com/sim-/tgy/blob/master/boot.inc
|
* have a look at https://github.com/sim-/tgy/blob/master/boot.inc
|
||||||
* for info about the stk500v2 implementation
|
* for info about the stk500v2 implementation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
|
@ -28,13 +27,13 @@
|
||||||
|
|
||||||
#include "drivers/io.h"
|
#include "drivers/io.h"
|
||||||
#include "drivers/serial.h"
|
#include "drivers/serial.h"
|
||||||
#include "config/config.h"
|
#include "drivers/system.h"
|
||||||
|
|
||||||
#include "io/serial.h"
|
#include "io/serial.h"
|
||||||
#include "io/serial_msp.h"
|
|
||||||
#include "io/serial_4way.h"
|
#include "io/serial_4way.h"
|
||||||
#include "io/serial_4way_impl.h"
|
#include "io/serial_4way_impl.h"
|
||||||
#include "io/serial_4way_stk500v2.h"
|
#include "io/serial_4way_stk500v2.h"
|
||||||
#include "drivers/system.h"
|
|
||||||
#ifdef USE_SERIAL_4WAY_SK_BOOTLOADER
|
#ifdef USE_SERIAL_4WAY_SK_BOOTLOADER
|
||||||
|
|
||||||
#define BIT_LO_US (32) //32uS
|
#define BIT_LO_US (32) //32uS
|
||||||
|
|
|
@ -100,6 +100,11 @@ static void setCurrentPort(mspPort_t *port)
|
||||||
mspSerialPort = currentPort->port;
|
mspSerialPort = currentPort->port;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Process MSP commands from serial ports configured as MSP ports.
|
||||||
|
*
|
||||||
|
* Called periodically by the scheduler.
|
||||||
|
*/
|
||||||
void mspSerialProcess(void)
|
void mspSerialProcess(void)
|
||||||
{
|
{
|
||||||
uint8_t portIndex;
|
uint8_t portIndex;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue