Moved aux serial defs to own header file
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "hal/serial_driver.h"
|
||||
|
||||
#if defined(AUX_SERIAL)
|
||||
extern uint8_t auxSerialMode;
|
||||
void auxSerialSetup(unsigned int baudrate, bool rx_enable,
|
||||
uint8_t word_length = ETX_WordLength_8,
|
||||
uint8_t parity = ETX_Parity_None,
|
||||
uint8_t stop_bits = ETX_StopBits_One);
|
||||
void auxSerialInit(unsigned int mode, unsigned int protocol);
|
||||
void auxSerialPutc(char c);
|
||||
void auxSerialSbusInit();
|
||||
void auxSerialStop();
|
||||
uint8_t auxSerialTracesEnabled();
|
||||
#endif
|
||||
|
||||
#if defined(AUX2_SERIAL)
|
||||
extern uint8_t aux2SerialMode;
|
||||
void aux2SerialSetup(unsigned int baudrate, bool rx_enable,
|
||||
uint8_t word_length = ETX_WordLength_8,
|
||||
uint8_t parity = ETX_Parity_None,
|
||||
uint8_t stop_bits = ETX_StopBits_One);
|
||||
void aux2SerialInit(unsigned int mode, unsigned int protocol);
|
||||
void aux2SerialPutc(char c);
|
||||
void aux2SerialSbusInit();
|
||||
void aux2SerialStop();
|
||||
uint8_t aux2SerialTracesEnabled();
|
||||
#endif
|
||||
|
||||
@@ -655,15 +655,7 @@ void sportUpdatePowerInit();
|
||||
#define LUA_DEFAULT_BAUDRATE 115200
|
||||
#endif
|
||||
#if defined(AUX_SERIAL)
|
||||
extern uint8_t auxSerialMode;
|
||||
#if defined __cplusplus
|
||||
void auxSerialSetup(unsigned int baudrate, bool dma, uint16_t length = USART_WordLength_8b, uint16_t parity = USART_Parity_No, uint16_t stop = USART_StopBits_1);
|
||||
#endif
|
||||
void auxSerialInit(unsigned int mode, unsigned int protocol);
|
||||
void auxSerialPutc(char c);
|
||||
#define auxSerialTelemetryInit(protocol) auxSerialInit(UART_MODE_TELEMETRY, protocol)
|
||||
void auxSerialSbusInit();
|
||||
void auxSerialStop();
|
||||
void auxSerialPowerOn();
|
||||
void auxSerialPowerOff();
|
||||
#if defined(AUX_SERIAL_PWR_GPIO)
|
||||
@@ -677,15 +669,7 @@ void auxSerialPowerOff();
|
||||
|
||||
// Aux2 serial port driver
|
||||
#if defined(AUX2_SERIAL)
|
||||
extern uint8_t aux2SerialMode;
|
||||
#if defined __cplusplus
|
||||
void aux2SerialSetup(unsigned int baudrate, bool dma, uint16_t length = USART_WordLength_8b, uint16_t parity = USART_Parity_No, uint16_t stop = USART_StopBits_1);
|
||||
#endif
|
||||
void aux2SerialInit(unsigned int mode, unsigned int protocol);
|
||||
void aux2SerialPutc(char c);
|
||||
#define aux2SerialTelemetryInit(protocol) aux2SerialInit(UART_MODE_TELEMETRY, protocol)
|
||||
void aux2SerialSbusInit();
|
||||
void aux2SerialStop();
|
||||
void aux2SerialPowerOn();
|
||||
void aux2SerialPowerOff();
|
||||
#if defined(AUX2_SERIAL_PWR_GPIO)
|
||||
|
||||
@@ -82,6 +82,9 @@ void gpsSendByte(uint8_t byte)
|
||||
USART_ITConfig(GPS_USART, USART_IT_TXE, ENABLE);
|
||||
}
|
||||
|
||||
#define USART_FLAG_ERRORS \
|
||||
(USART_FLAG_ORE | USART_FLAG_NE | USART_FLAG_FE | USART_FLAG_PE)
|
||||
|
||||
extern "C" void GPS_USART_IRQHandler(void)
|
||||
{
|
||||
// Send
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
#include "aux_serial_driver.h"
|
||||
|
||||
void trainerSendNextFrame();
|
||||
|
||||
|
||||
@@ -507,15 +507,8 @@ void hapticOn(uint32_t pwmPercent);
|
||||
//#define AUX_SERIAL
|
||||
#define DEBUG_BAUDRATE 115200
|
||||
#define LUA_DEFAULT_BAUDRATE 115200
|
||||
extern uint8_t auxSerialMode;
|
||||
#if defined __cplusplus
|
||||
void auxSerialSetup(unsigned int baudrate, bool dma, uint16_t length = USART_WordLength_8b, uint16_t parity = USART_Parity_No, uint16_t stop = USART_StopBits_1);
|
||||
#endif
|
||||
void auxSerialInit(unsigned int mode, unsigned int protocol);
|
||||
void auxSerialPutc(char c);
|
||||
#define auxSerialTelemetryInit(protocol) auxSerialInit(UART_MODE_TELEMETRY, protocol)
|
||||
void auxSerialSbusInit();
|
||||
void auxSerialStop();
|
||||
|
||||
#if defined(AUX_SERIAL_PWR_GPIO)
|
||||
#define AUX_SERIAL_POWER_ON() auxSerialPowerOn()
|
||||
#define AUX_SERIAL__POWER_OFF() auxSerialPowerOff()
|
||||
@@ -523,7 +516,6 @@ void auxSerialStop();
|
||||
#define AUX_SERIAL_POWER_ON()
|
||||
#define AUX_SERIAL__POWER_OFF()
|
||||
#endif
|
||||
#define USART_FLAG_ERRORS (USART_FLAG_ORE | USART_FLAG_NE | USART_FLAG_FE | USART_FLAG_PE)
|
||||
|
||||
extern uint8_t currentTrainerMode;
|
||||
void checkTrainerSettings();
|
||||
|
||||
@@ -865,15 +865,7 @@ void hapticOff();
|
||||
#define DEBUG_BAUDRATE 115200
|
||||
#define LUA_DEFAULT_BAUDRATE 115200
|
||||
#define AUX_SERIAL
|
||||
extern uint8_t auxSerialMode;
|
||||
#if defined __cplusplus
|
||||
void auxSerialSetup(unsigned int baudrate, bool dma, uint16_t length = USART_WordLength_8b, uint16_t parity = USART_Parity_No, uint16_t stop = USART_StopBits_1);
|
||||
#endif
|
||||
void auxSerialInit(unsigned int mode, unsigned int protocol);
|
||||
void auxSerialPutc(char c);
|
||||
#define auxSerialTelemetryInit(protocol) auxSerialInit(UART_MODE_TELEMETRY, protocol)
|
||||
void auxSerialSbusInit();
|
||||
void auxSerialStop();
|
||||
#define AUX_SERIAL_POWER_ON()
|
||||
#define AUX_SERIAL_POWER_OFF()
|
||||
#endif
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
#include "aux_serial_driver.h"
|
||||
|
||||
Fifo<uint8_t, TELEMETRY_FIFO_SIZE> telemetryFifo;
|
||||
uint32_t telemetryErrors = 0;
|
||||
|
||||
Reference in New Issue
Block a user