Moved aux serial defs to own header file
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "opentx.h"
|
||||
#include "libopenui.h"
|
||||
#include "hal/adc_driver.h"
|
||||
#include "aux_serial_driver.h"
|
||||
|
||||
#define SET_DIRTY() storageDirty(EE_GENERAL)
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include <opentx.h>
|
||||
#include "hal/adc_driver.h"
|
||||
#include "aux_serial_driver.h"
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
enum {
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "api_filesystem.h"
|
||||
#include "telemetry/frsky.h"
|
||||
#include "telemetry/multi.h"
|
||||
#include "aux_serial_driver.h"
|
||||
|
||||
#if defined(LIBOPENUI)
|
||||
#include "libopenui.h"
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "opentx.h"
|
||||
#include "io/frsky_firmware_update.h"
|
||||
#include "hal/adc_driver.h"
|
||||
#include "aux_serial_driver.h"
|
||||
|
||||
#if defined(LIBOPENUI)
|
||||
#include "libopenui.h"
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "serial.h"
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include "aux_serial_driver.h"
|
||||
|
||||
#define PRINTF_BUFFER_SIZE 128
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
#include "aux_serial_driver.h"
|
||||
|
||||
const CrossfireSensor crossfireSensors[] = {
|
||||
{LINK_ID, 0, STR_SENSOR_RX_RSSI1, UNIT_DB, 0},
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
#include "aux_serial_driver.h"
|
||||
|
||||
void processFrskyTelemetryData(uint8_t data)
|
||||
{
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
#include "aux_serial_driver.h"
|
||||
|
||||
const char *ghstRfProfileValue[GHST_RF_PROFILE_COUNT] = { "Auto", "Norm", "Race", "Pure", "Long", "Unused", "Race2", "Pure2" };
|
||||
const char *ghstVtxBandName[GHST_VTX_BAND_COUNT] = { "- - -" , "IRC", "Race", "BandE", "BandB", "BandA" };
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "telemetry.h"
|
||||
#include "multi.h"
|
||||
#include "io/multi_protolist.h"
|
||||
#include "aux_serial_driver.h"
|
||||
|
||||
constexpr int32_t MULTI_DESIRED_VERSION = (1 << 24) | (3 << 16) | (3 << 8) | 0;
|
||||
#define MULTI_CHAN_BITS 11
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "pulses/flysky.h"
|
||||
#include "mixer_scheduler.h"
|
||||
#include "io/multi_protolist.h"
|
||||
#include "aux_serial_driver.h"
|
||||
|
||||
#if defined(LIBOPENUI)
|
||||
#include "libopenui.h"
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "opentx.h"
|
||||
#include "heartbeat_driver.h"
|
||||
#include "aux_serial_driver.h"
|
||||
|
||||
int16_t ppmInput[MAX_TRAINER_CHANNELS];
|
||||
uint8_t ppmInputValidityTimer;
|
||||
|
||||
Reference in New Issue
Block a user