Merge branch 'master' into kilrah/ar9x
This commit is contained in:
@@ -0,0 +1,297 @@
|
||||
/*
|
||||
* Authors - Gerard Valade <gerard.valade@gmail.com>
|
||||
*
|
||||
* Adapted from frsky
|
||||
*
|
||||
* 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 "serial_driver.h"
|
||||
#include "opentx.h"
|
||||
|
||||
/*
|
||||
Receive serial (RS-232) characters, detecting and storing each Fr-Sky
|
||||
0x7e-framed packet as it arrives. When a complete packet has been
|
||||
received, process its data into storage variables. NOTE: This is an
|
||||
interrupt routine and should not get too lengthy. I originally had
|
||||
the buffer being checked in the perMain function (because per10ms
|
||||
isn't quite often enough for data streaming at 9600baud) but alas
|
||||
that scheme lost packets also. So each packet is parsed as it arrives,
|
||||
directly at the ISR function (through a call to frskyProcessPacket).
|
||||
|
||||
If this proves a problem in the future, then I'll just have to implement
|
||||
a second buffer to receive data while one buffer is being processed (slowly).
|
||||
*/
|
||||
|
||||
#ifndef SIMU
|
||||
ISR (USART0_RX_vect)
|
||||
{
|
||||
uint8_t iostat; //USART control and Status Register 0 A
|
||||
// uint8_t rh; //USART control and Status Register 0 B
|
||||
UCSR0B &= ~(1 << RXCIE0); // disable Interrupt
|
||||
sei();
|
||||
iostat = UCSR0A; //USART control and Status Register 0 A
|
||||
uint8_t byte = UDR0;
|
||||
|
||||
/*
|
||||
bit 7 6 5 4 3 2 1 0
|
||||
RxC0 TxC0 UDRE0 FE0 DOR0 UPE0 U2X0 MPCM0
|
||||
|
||||
RxC0: Receive complete
|
||||
TXC0: Transmit Complete
|
||||
UDRE0: USART Data Register Empty
|
||||
FE0: Frame Error
|
||||
DOR0: Data OverRun
|
||||
UPE0: USART Parity Error
|
||||
U2X0: Double Tx Speed
|
||||
MPCM0: MultiProcessor Comms Mode
|
||||
*/
|
||||
if (iostat & ((1 << FE0) | (1 << DOR0) | (1 << UPE0))) {
|
||||
byte = 0;
|
||||
}
|
||||
//rh = UCSR0B; //USART control and Status Register 0 B
|
||||
#ifdef MAVLINK
|
||||
(RXHandler)(byte);
|
||||
#endif
|
||||
|
||||
cli();
|
||||
UCSR0B |= (1 << RXCIE0); // enable Interrupt
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
inline void SERIAL_EnableRXD(void) {
|
||||
UCSR0B |= (1 << RXEN0); // enable RX
|
||||
UCSR0B |= (1 << RXCIE0); // enable Interrupt
|
||||
}
|
||||
|
||||
#if 0
|
||||
void SERIAL_DisableRXD(void) {
|
||||
UCSR0B &= ~(1 << RXEN0); // disable RX
|
||||
UCSR0B &= ~(1 << RXCIE0); // disable Interrupt
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
USART0 (transmit) Data Register Emtpy ISR
|
||||
Usef to transmit FrSky data packets, which are buffered in frskyTXBuffer.
|
||||
*/
|
||||
uint8_t serialTxBuffer[MAX_TX_BUFFER]; // 32 characters
|
||||
uint8_t serialTxBufferCount = 0;
|
||||
uint8_t * ptrTxISR = 0;
|
||||
serial_tx_state_t serialTxState = TX_STATE_EMPTY;
|
||||
|
||||
#ifndef SIMU
|
||||
ISR(USART0_UDRE_vect)
|
||||
{
|
||||
if (serialTxBufferCount > 0) {
|
||||
UDR0 = *ptrTxISR++;
|
||||
serialTxBufferCount--;
|
||||
} else {
|
||||
UCSR0B &= ~(1 << UDRIE0); // disable UDRE0 interrupt
|
||||
serialTxState = TX_STATE_EMPTY;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void SERIAL_start_uart_send() {
|
||||
ptrTxISR = serialTxBuffer;
|
||||
serialTxBufferCount = 0;
|
||||
}
|
||||
|
||||
void SERIAL_end_uart_send() {
|
||||
ptrTxISR = serialTxBuffer;
|
||||
//UCSR0B |= (1 << UDRIE0); // enable UDRE0 interrupt
|
||||
serialTxState = TX_STATE_READY;
|
||||
}
|
||||
|
||||
void SERIAL_send_uart_bytes(const uint8_t * buf, uint16_t len) {
|
||||
while (len--) {
|
||||
*ptrTxISR++ = *buf++;
|
||||
serialTxBufferCount++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if 0
|
||||
void SERIAL_transmitBuffer(uint8_t len) {
|
||||
serialTxBufferCount = len;
|
||||
ptrTxISR = serialTxBuffer;
|
||||
//UCSR0B |= (1 << UDRIE0); // enable UDRE0 interrupt
|
||||
serialTxState = TX_STATE_READY;
|
||||
}
|
||||
#endif
|
||||
|
||||
void SERIAL_startTX(void) {
|
||||
if (serialTxState == TX_STATE_READY) {
|
||||
serialTxState = TX_STATE_BUSY;
|
||||
UCSR0B |= (1 << UDRIE0); // enable UDRE0 interrupt
|
||||
}
|
||||
}
|
||||
|
||||
static void uart_4800(void) {
|
||||
#ifndef SIMU
|
||||
#undef BAUD // avoid compiler warning
|
||||
#define BAUD 4800
|
||||
#include <util/setbaud.h>
|
||||
UBRR0H = UBRRH_VALUE;
|
||||
UBRR0L = UBRRL_VALUE;
|
||||
#if USE_2X
|
||||
UCSR0A |= (1 << U2X0);
|
||||
#else
|
||||
UCSR0A &= ~(1 << U2X0);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static void uart_9600(void) {
|
||||
#ifndef SIMU
|
||||
#undef BAUD // avoid compiler warning
|
||||
#define BAUD 9600
|
||||
#include <util/setbaud.h>
|
||||
UBRR0H = UBRRH_VALUE;
|
||||
UBRR0L = UBRRL_VALUE;
|
||||
#if USE_2X
|
||||
UCSR0A |= (1 << U2X0);
|
||||
#else
|
||||
UCSR0A &= ~(1 << U2X0);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static void uart_14400(void) {
|
||||
#ifndef SIMU
|
||||
#undef BAUD // avoid compiler warning
|
||||
#define BAUD 14400
|
||||
#include <util/setbaud.h>
|
||||
UBRR0H = UBRRH_VALUE;
|
||||
UBRR0L = UBRRL_VALUE;
|
||||
#if USE_2X
|
||||
UCSR0A |= (1 << U2X0);
|
||||
#else
|
||||
UCSR0A &= ~(1 << U2X0);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static void uart_19200(void) {
|
||||
#ifndef SIMU
|
||||
#undef BAUD // avoid compiler warning
|
||||
#define BAUD 19200
|
||||
#include <util/setbaud.h>
|
||||
UBRR0H = UBRRH_VALUE;
|
||||
UBRR0L = UBRRL_VALUE;
|
||||
#if USE_2X
|
||||
UCSR0A |= (1 << U2X0);
|
||||
#else
|
||||
UCSR0A &= ~(1 << U2X0);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static void uart_38400(void) {
|
||||
#ifndef SIMU
|
||||
#undef BAUD // avoid compiler warning
|
||||
#define BAUD 38400
|
||||
#include <util/setbaud.h>
|
||||
UBRR0H = UBRRH_VALUE;
|
||||
UBRR0L = UBRRL_VALUE;
|
||||
#if USE_2X
|
||||
UCSR0A |= (1 << U2X0);
|
||||
#else
|
||||
UCSR0A &= ~(1 << U2X0);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static void uart_57600(void) {
|
||||
#ifndef SIMU
|
||||
#undef BAUD // avoid compiler warning
|
||||
#define BAUD 57600
|
||||
#include <util/setbaud.h>
|
||||
UBRR0H = UBRRH_VALUE;
|
||||
UBRR0L = UBRRL_VALUE;
|
||||
#if USE_2X
|
||||
UCSR0A |= (1 << U2X0);
|
||||
#else
|
||||
UCSR0A &= ~(1 << U2X0);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static void uart_76800(void) {
|
||||
#ifndef SIMU
|
||||
#undef BAUD // avoid compiler warning
|
||||
#define BAUD 76800
|
||||
#include <util/setbaud.h>
|
||||
UBRR0H = UBRRH_VALUE;
|
||||
UBRR0L = UBRRL_VALUE;
|
||||
#if USE_2X
|
||||
UCSR0A |= (1 << U2X0);
|
||||
#else
|
||||
UCSR0A &= ~(1 << U2X0);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void SERIAL_EnableTXD(void) {
|
||||
//UCSR0B |= (1 << TXEN0); // enable TX
|
||||
UCSR0B |= (1 << TXEN0) | (1 << UDRIE0); // enable TX and TX interrupt
|
||||
}
|
||||
|
||||
#if 0
|
||||
void SERIAL_DisableTXD(void) {
|
||||
UCSR0B &= ~(1 << TXEN0); // disable TX
|
||||
UCSR0B &= ~(1 << UDRIE0); // disable Interrupt
|
||||
}
|
||||
#endif
|
||||
|
||||
void SERIAL_Init(void) {
|
||||
DDRE &= ~(1 << DDE0); // set RXD0 pin as input
|
||||
PORTE &= ~(1 << PORTE0); // disable pullup on RXD0 pin
|
||||
|
||||
switch (g_eeGeneral.mavbaud) {
|
||||
case BAUD_4800:
|
||||
uart_4800();
|
||||
break;
|
||||
case BAUD_9600:
|
||||
uart_9600();
|
||||
break;
|
||||
case BAUD_14400:
|
||||
uart_14400();
|
||||
break;
|
||||
case BAUD_19200:
|
||||
uart_19200();
|
||||
break;
|
||||
case BAUD_38400:
|
||||
uart_38400();
|
||||
break;
|
||||
case BAUD_57600:
|
||||
uart_57600();
|
||||
break;
|
||||
case BAUD_76800:
|
||||
uart_76800();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// UCSR0A &= ~(1 << U2X0); // disable double speed operation
|
||||
// set 8N1
|
||||
UCSR0B = 0 | (0 << RXCIE0) | (0 << TXCIE0) | (0 << UDRIE0) | (0 << RXEN0) | (0 << TXEN0) | (0 << UCSZ02);
|
||||
UCSR0C = 0 | (1 << UCSZ01) | (1 << UCSZ00);
|
||||
while (UCSR0A & (1 << RXC0))
|
||||
UDR0; // flush receive buffer
|
||||
|
||||
SERIAL_EnableTXD();
|
||||
SERIAL_EnableRXD();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Authors - Gerard Valade <gerard.valade@gmail.com>
|
||||
*
|
||||
* Adapted from frsky
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _SERIAL_H_
|
||||
#define _SERIAL_H_
|
||||
|
||||
typedef enum serial_tx_state_ {
|
||||
TX_STATE_EMPTY = 0, //
|
||||
TX_STATE_READY, //
|
||||
TX_STATE_BUSY
|
||||
} serial_tx_state_t;
|
||||
extern serial_tx_state_t serialTxState;
|
||||
|
||||
//! \brief Baudrate selection.
|
||||
enum SERIAL_BAUDS {
|
||||
BAUD_4800 = 0,
|
||||
BAUD_9600,
|
||||
BAUD_14400,
|
||||
BAUD_19200,
|
||||
BAUD_38400,
|
||||
BAUD_57600,
|
||||
BAUD_76800
|
||||
};
|
||||
|
||||
//! \brief Definition of baudrate settings item choices.
|
||||
typedef void (*SerialFuncP)(uint8_t event);
|
||||
|
||||
extern SerialFuncP RXHandler;
|
||||
|
||||
#define MAX_TX_BUFFER 32
|
||||
//#if 0
|
||||
extern uint8_t serialTxBuffer[MAX_TX_BUFFER]; // 32 characters
|
||||
extern uint8_t serialTxBufferCount;
|
||||
extern uint8_t * ptrTxISR;
|
||||
//#endif
|
||||
|
||||
void SERIAL_Init(void);
|
||||
//void SERIAL_transmitBuffer(uint8_t len);
|
||||
extern void SERIAL_start_uart_send();
|
||||
extern void SERIAL_end_uart_send();
|
||||
extern void SERIAL_send_uart_bytes(uint8_t * buf, uint16_t len);
|
||||
|
||||
void SERIAL_startTX(void);
|
||||
#define IS_TX_BUSY (serialTxState!=TX_STATE_EMPTY)
|
||||
|
||||
#endif
|
||||
@@ -62,11 +62,10 @@ inline void boardInit()
|
||||
OCR2A = 156;
|
||||
TIMSK2 |= (1<<OCIE2A) | (1<<TOIE2); // Enable Output-Compare and Overflow interrrupts
|
||||
|
||||
// Set up Phase correct Waveform Gen. mode, at clk/64 = 250,000 counts/second
|
||||
// (Higher speed allows for finer control of frequencies in the audio range.)
|
||||
// TIMER4 set into CTC mode, prescaler 16MHz/64=250 kHz
|
||||
// Used for audio tone generation
|
||||
TCCR4B = (1<<WGM42) | (0b011 << CS00);
|
||||
TCCR4A = (0b01<<WGM40);
|
||||
TCCR4A = 0x00;
|
||||
|
||||
#if defined (VOICE) // OLD FROM GRUVIN9X, TO REWRITE
|
||||
// SOMO set-up
|
||||
|
||||
@@ -330,7 +330,7 @@ void *main_thread(void *)
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
stack_paint();
|
||||
stackPaint();
|
||||
#endif
|
||||
|
||||
s_current_protocol[0] = 255;
|
||||
@@ -657,12 +657,10 @@ void eepromWriteBlock(uint8_t * pointer_ram, uint32_t pointer_eeprom, uint32_t s
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(CPUARM)
|
||||
uint16_t stack_free()
|
||||
uint16_t stackAvailable()
|
||||
{
|
||||
return 500;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
static void EeFsDump(){
|
||||
@@ -1228,7 +1226,6 @@ uint32_t pwrPressed() { return false; }
|
||||
#else
|
||||
uint32_t pwrCheck() { return true; }
|
||||
#endif
|
||||
void usbStart() { }
|
||||
int usbPlugged() { return false; }
|
||||
void USART_DeInit(USART_TypeDef* ) { }
|
||||
ErrorStatus RTC_SetTime(uint32_t RTC_Format, RTC_TimeTypeDef* RTC_TimeStruct) { return SUCCESS; }
|
||||
|
||||
@@ -377,6 +377,7 @@ void eepromReadBlock (uint8_t * pointer_ram, uint32_t address, uint32_t size);
|
||||
#define wdt_enable(...) sleep(1/*ms*/)
|
||||
#define wdt_reset() sleep(1/*ms*/)
|
||||
#define boardInit()
|
||||
#define boardOff()
|
||||
|
||||
#define OS_MutexID pthread_mutex_t
|
||||
extern OS_MutexID audioMutex;
|
||||
|
||||
@@ -603,7 +603,7 @@ uint16_t getCurrent()
|
||||
Current_count = 0 ;
|
||||
}
|
||||
|
||||
uint32_t current_scale = 488 + g_eeGeneral.currentCalib ;
|
||||
uint32_t current_scale = 488 + g_eeGeneral.txCurrentCalibration ;
|
||||
return (current_scale * Current) / 8192;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -290,7 +290,7 @@ uint32_t telemetryTransmitPending();
|
||||
void telemetryTransmitBuffer(uint8_t * buffer, uint32_t size);
|
||||
|
||||
// Second UART driver
|
||||
void telemetrySecondPortInit(unsigned int protocol);
|
||||
void serial2TelemetryInit(unsigned int protocol);
|
||||
bool telemetrySecondPortReceive(uint8_t & data);
|
||||
|
||||
#endif
|
||||
|
||||
+7
-2
@@ -53,7 +53,7 @@ Fifo<512> serial2RxFifo;
|
||||
* This function is synchronous (i.e. uses polling).
|
||||
* c Character to send.
|
||||
*/
|
||||
void debugPutc(const char c)
|
||||
void serial2Putc(const char c)
|
||||
{
|
||||
Uart *pUart = SECOND_SERIAL_UART;
|
||||
|
||||
@@ -64,6 +64,11 @@ void debugPutc(const char c)
|
||||
pUart->UART_THR = c;
|
||||
}
|
||||
|
||||
uint8_t serial2TracesEnabled()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configures a UART peripheral with the specified parameters.
|
||||
*
|
||||
@@ -117,7 +122,7 @@ extern "C" void UART0_IRQHandler()
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY)
|
||||
void telemetrySecondPortInit(unsigned int /*protocol*/)
|
||||
void serial2TelemetryInit(unsigned int /*protocol*/)
|
||||
{
|
||||
SECOND_UART_Configure(FRSKY_D_BAUDRATE, Master_frequency);
|
||||
// startPdcUsartReceive();
|
||||
@@ -133,7 +133,7 @@ void bluetoothWriteString(const char * str)
|
||||
void bluetoothWriteWakeup(void)
|
||||
{
|
||||
if (bluetoothWriteState == BLUETOOTH_WRITE_IDLE) {
|
||||
if (!btTxFifo.empty()) {
|
||||
if (!btTxFifo.isEmpty()) {
|
||||
bluetoothWriteState = BLUETOOTH_WRITE_INIT;
|
||||
GPIO_ResetBits(BT_GPIO_BRTS, BT_GPIO_PIN_BRTS);
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ void boardInit()
|
||||
#endif
|
||||
|
||||
#if defined(REV9E)
|
||||
if (!(RCC->CSR & (RCC_CSR_SFTRSTF | RCC_CSR_WDGRSTF))) {
|
||||
if (!WAS_RESET_BY_WATCHDOG_OR_SOFTWARE()) {
|
||||
lcd_clear();
|
||||
lcd_bmp(76, 2, bmp_lock, 0, 60);
|
||||
lcdRefresh();
|
||||
@@ -187,7 +187,7 @@ void boardInit()
|
||||
lcdRefreshWait();
|
||||
}
|
||||
if (duration < PWR_PRESS_DURATION_MIN || duration >= PWR_PRESS_DURATION_MAX) {
|
||||
pwrOff();
|
||||
boardOff();
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -198,8 +198,27 @@ void boardInit()
|
||||
backlightInit();
|
||||
#endif
|
||||
}
|
||||
|
||||
void boardOff()
|
||||
{
|
||||
BACKLIGHT_OFF();
|
||||
#if defined(REV9E)
|
||||
topLcdOff();
|
||||
#endif
|
||||
|
||||
#if defined(REV9E)
|
||||
while (pwrPressed()) {
|
||||
wdt_reset();
|
||||
}
|
||||
#endif
|
||||
|
||||
lcdOff();
|
||||
SysTick->CTRL = 0; // turn off systick
|
||||
pwrOff();
|
||||
}
|
||||
|
||||
#endif // #if !defined(SIMU)
|
||||
|
||||
|
||||
#if defined(USB_JOYSTICK) && !defined(SIMU)
|
||||
extern USB_OTG_CORE_HANDLE USB_OTG_dev;
|
||||
@@ -258,7 +277,7 @@ void checkTrainerSettings()
|
||||
stop_sbus_on_heartbeat_capture() ;
|
||||
break;
|
||||
case TRAINER_MODE_MASTER_BATTERY_COMPARTMENT:
|
||||
uart3Stop();
|
||||
serial2Stop();
|
||||
}
|
||||
|
||||
currentTrainerMode = requiredTrainerMode;
|
||||
@@ -273,8 +292,8 @@ void checkTrainerSettings()
|
||||
init_sbus_on_heartbeat_capture() ;
|
||||
break;
|
||||
case TRAINER_MODE_MASTER_BATTERY_COMPARTMENT:
|
||||
if (g_eeGeneral.uart3Mode == UART_MODE_SBUS_TRAINER) {
|
||||
uart3SbusInit();
|
||||
if (g_eeGeneral.serial2Mode == UART_MODE_SBUS_TRAINER) {
|
||||
serial2SbusInit();
|
||||
break;
|
||||
}
|
||||
// no break
|
||||
|
||||
@@ -74,9 +74,10 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(SIMU)
|
||||
#include "STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_core.h"
|
||||
#include "STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/hid/inc/usbd_hid_core.h"
|
||||
#include "STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_usr.h"
|
||||
#include "usbd_cdc_core.h"
|
||||
#include "usbd_msc_core.h"
|
||||
#include "usbd_hid_core.h"
|
||||
#include "usbd_usr.h"
|
||||
#include "usbd_desc.h"
|
||||
#include "usb_conf.h"
|
||||
#include "usbd_conf.h"
|
||||
@@ -236,8 +237,9 @@ void checkRotaryEncoder(void);
|
||||
void watchdogInit(unsigned int duration);
|
||||
#define wdt_enable(x) watchdogInit(1500)
|
||||
#define wdt_reset() IWDG->KR = 0xAAAA
|
||||
#define WAS_RESET_BY_WATCHDOG() (RCC->CSR & (RCC_CSR_WDGRSTF | RCC_CSR_WWDGRSTF))
|
||||
#define WAS_RESET_BY_SOFTWARE() (RCC->CSR & RCC_CSR_SFTRSTF)
|
||||
#define WAS_RESET_BY_SOFTWARE() (RCC->CSR & RCC_CSR_SFTRSTF)
|
||||
#define WAS_RESET_BY_WATCHDOG() (RCC->CSR & (RCC_CSR_WDGRSTF | RCC_CSR_WWDGRSTF))
|
||||
#define WAS_RESET_BY_WATCHDOG_OR_SOFTWARE() (RCC->CSR & (RCC_CSR_WDGRSTF | RCC_CSR_WWDGRSTF | RCC_CSR_SFTRSTF))
|
||||
#endif
|
||||
|
||||
// ADC driver
|
||||
@@ -281,10 +283,8 @@ void backlightInit(void);
|
||||
// USB driver
|
||||
int usbPlugged(void);
|
||||
void usbInit(void);
|
||||
void usbStart(void);
|
||||
#if defined(USB_JOYSTICK)
|
||||
void usbStop(void);
|
||||
#endif
|
||||
void usbDeInit(void);
|
||||
void usbSerialPutc(uint8_t c);
|
||||
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
}
|
||||
@@ -322,13 +322,13 @@ void hapticOff(void);
|
||||
void hapticOn(void);
|
||||
#endif
|
||||
|
||||
// SERIAL_USART driver
|
||||
// Second serial port driver
|
||||
#define DEBUG_BAUDRATE 115200
|
||||
void uart3Init(unsigned int mode, unsigned int protocol);
|
||||
void uart3Putc(const char c);
|
||||
#define telemetrySecondPortInit(protocol) uart3Init(UART_MODE_TELEMETRY, protocol)
|
||||
void uart3SbusInit(void);
|
||||
void uart3Stop(void);
|
||||
void serial2Init(unsigned int mode, unsigned int protocol);
|
||||
void serial2Putc(char c);
|
||||
#define serial2TelemetryInit(protocol) serial2Init(UART_MODE_TELEMETRY, protocol)
|
||||
void serial2SbusInit(void);
|
||||
void serial2Stop(void);
|
||||
|
||||
// BT driver
|
||||
#define BLUETOOTH_DEFAULT_BAUDRATE 115200
|
||||
|
||||
@@ -109,6 +109,8 @@ ifeq ($(PCB), TARANIS)
|
||||
EXTRAINCDIRS += $(STM32USBPATH)/STM32_USB_OTG_Driver/inc
|
||||
EXTRAINCDIRS += $(STM32USBPATH)/STM32_USB_Device_Library/Core/inc
|
||||
EXTRAINCDIRS += $(STM32USBPATH)/STM32_USB_Device_Library/Class/msc/inc
|
||||
EXTRAINCDIRS += $(STM32USBPATH)/STM32_USB_Device_Library/Class/hid/inc
|
||||
EXTRAINCDIRS += $(STM32USBPATH)/STM32_USB_Device_Library/Class/cdc/inc
|
||||
EXTRAINCDIRS += .. ../../.. ../../../fonts/std
|
||||
ifeq ($(PCBREV), REV4a)
|
||||
CPPDEFS += -DREV4a
|
||||
|
||||
@@ -418,7 +418,6 @@ int main()
|
||||
// SD card detect pin
|
||||
sdInit();
|
||||
usbInit();
|
||||
usbStart();
|
||||
#endif
|
||||
|
||||
for (;;) {
|
||||
|
||||
@@ -363,7 +363,7 @@ void lcdInit()
|
||||
{
|
||||
LCD_Hardware_Init();
|
||||
|
||||
if (WAS_RESET_BY_WATCHDOG()|WAS_RESET_BY_SOFTWARE()) return; //no need to reset LCD module
|
||||
if (WAS_RESET_BY_WATCHDOG_OR_SOFTWARE()) return; //no need to reset LCD module
|
||||
|
||||
//reset LCD module
|
||||
LCD_RST_LOW();
|
||||
@@ -400,7 +400,7 @@ void lcdInitFinish()
|
||||
initialization (without reset) is also recommended by the data sheet.
|
||||
*/
|
||||
|
||||
if (!WAS_RESET_BY_WATCHDOG() && !WAS_RESET_BY_SOFTWARE()) {
|
||||
if (!WAS_RESET_BY_WATCHDOG_OR_SOFTWARE()) {
|
||||
#if !defined(BOOT)
|
||||
while(g_tmr10ms < (RESET_WAIT_DELAY_MS/10)) {}; //wait measured from the power-on
|
||||
#else
|
||||
|
||||
@@ -37,11 +37,11 @@
|
||||
#include "board_taranis.h"
|
||||
#include "../../pwr.h"
|
||||
|
||||
extern volatile uint32_t g_tmr10ms;
|
||||
#define get_tmr10ms() g_tmr10ms
|
||||
|
||||
void pwrInit()
|
||||
{
|
||||
// if any changes are done to the PWR PIN or pwrOn() function
|
||||
// then the same changes must be done in _bootStart()
|
||||
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Pin = PWR_GPIO_PIN_ON;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
||||
@@ -84,23 +84,29 @@ void pwrOff()
|
||||
{
|
||||
GPIO_ResetBits(PWR_GPIO, PWR_GPIO_PIN_ON);
|
||||
|
||||
#if defined(REV9E)
|
||||
// 9E needs watchdog reset because CPU is still running while the power
|
||||
// key is held pressed by the user
|
||||
while (1) {
|
||||
// disable interrupts
|
||||
__disable_irq();
|
||||
|
||||
while(1) {
|
||||
wdt_reset();
|
||||
#if 0
|
||||
// It doesn't work correctly, if we press long on the pwr button, the radio restarts when the button is released
|
||||
PWR->CR |= PWR_CR_CWUF;
|
||||
/* Select STANDBY mode */
|
||||
PWR->CR |= PWR_CR_PDDS;
|
||||
/* Set SLEEPDEEP bit of Cortex System Control Register */
|
||||
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
|
||||
/* Request Wait For Event */
|
||||
__WFE();
|
||||
#if defined(REV9E)
|
||||
// 9E needs watchdog reset because CPU is still running while
|
||||
// the power key is held pressed by the user.
|
||||
// The power key should be released by now, but we must make sure
|
||||
if (!pwrPressed()) {
|
||||
// Put the CPU into sleep to reduce the consumption,
|
||||
// it might help with the RTC reset issue
|
||||
PWR->CR |= PWR_CR_CWUF;
|
||||
/* Select STANDBY mode */
|
||||
PWR->CR |= PWR_CR_PDDS;
|
||||
/* Set SLEEPDEEP bit of Cortex System Control Register */
|
||||
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
|
||||
/* Request Wait For Event */
|
||||
__WFE();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
//this function must not return!
|
||||
}
|
||||
|
||||
#if defined(REV9E)
|
||||
|
||||
+22
-22
@@ -36,8 +36,8 @@
|
||||
|
||||
#include "../../opentx.h"
|
||||
|
||||
uint8_t uart3Mode = UART_MODE_NONE;
|
||||
Fifo<512> uart3TxFifo;
|
||||
uint8_t serial2Mode = 0;
|
||||
Fifo<512> serial2TxFifo;
|
||||
extern Fifo<512> telemetryFifo;
|
||||
extern Fifo<32> sbusFifo;
|
||||
|
||||
@@ -73,17 +73,17 @@ void uart3Setup(unsigned int baudrate)
|
||||
NVIC_EnableIRQ(SERIAL_USART_IRQn);
|
||||
}
|
||||
|
||||
void uart3Init(unsigned int mode, unsigned int protocol)
|
||||
void serial2Init(unsigned int mode, unsigned int protocol)
|
||||
{
|
||||
USART_DeInit(SERIAL_USART);
|
||||
|
||||
uart3Mode = false;
|
||||
serial2Mode = mode;
|
||||
|
||||
switch (mode) {
|
||||
case UART_MODE_TELEMETRY_MIRROR:
|
||||
uart3Setup(FRSKY_SPORT_BAUDRATE);
|
||||
break;
|
||||
#if defined(DEBUG)
|
||||
#if !defined(USB_SERIAL) && (defined(DEBUG) || defined(CLI))
|
||||
case UART_MODE_DEBUG:
|
||||
uart3Setup(DEBUG_BAUDRATE);
|
||||
break;
|
||||
@@ -94,43 +94,38 @@ void uart3Init(unsigned int mode, unsigned int protocol)
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
uart3Mode = mode;
|
||||
}
|
||||
|
||||
void uart3Putc(const char c)
|
||||
void serial2Putc(char c)
|
||||
{
|
||||
uart3TxFifo.push(c);
|
||||
while (serial2TxFifo.isFull());
|
||||
serial2TxFifo.push(c);
|
||||
USART_ITConfig(SERIAL_USART, USART_IT_TXE, ENABLE);
|
||||
}
|
||||
|
||||
#if defined(DEBUG)
|
||||
void debugPutc(const char c)
|
||||
{
|
||||
if (uart3Mode == UART_MODE_DEBUG) {
|
||||
uart3Putc(c);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void uart3SbusInit()
|
||||
void serial2SbusInit()
|
||||
{
|
||||
uart3Setup(100000);
|
||||
SERIAL_USART->CR1 |= USART_CR1_M | USART_CR1_PCE ;
|
||||
}
|
||||
|
||||
void uart3Stop()
|
||||
void serial2Stop()
|
||||
{
|
||||
USART_DeInit(SERIAL_USART);
|
||||
}
|
||||
|
||||
uint8_t serial2TracesEnabled()
|
||||
{
|
||||
return (serial2Mode == 0);
|
||||
}
|
||||
|
||||
#if !defined(SIMU)
|
||||
extern "C" void SERIAL_USART_IRQHandler(void)
|
||||
{
|
||||
// Send
|
||||
if (USART_GetITStatus(SERIAL_USART, USART_IT_TXE) != RESET) {
|
||||
uint8_t txchar;
|
||||
if (uart3TxFifo.pop(txchar)) {
|
||||
if (serial2TxFifo.pop(txchar)) {
|
||||
/* Write one byte to the transmit data register */
|
||||
USART_SendData(SERIAL_USART, txchar);
|
||||
}
|
||||
@@ -145,13 +140,18 @@ extern "C" void SERIAL_USART_IRQHandler(void)
|
||||
uint8_t data = SERIAL_USART->DR;
|
||||
|
||||
if (!(status & USART_FLAG_ERRORS)) {
|
||||
switch (uart3Mode) {
|
||||
switch (serial2Mode) {
|
||||
case UART_MODE_TELEMETRY:
|
||||
telemetryFifo.push(data);
|
||||
break;
|
||||
case UART_MODE_SBUS_TRAINER:
|
||||
sbusFifo.push(data);
|
||||
break;
|
||||
#if !defined(USB_SERIAL) && defined(CLI)
|
||||
case UART_MODE_DEBUG:
|
||||
cliRxFifo.push(data);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
* when FS core is used.
|
||||
*******************************************************************************/
|
||||
#ifndef USE_USB_OTG_FS
|
||||
#define USE_USB_OTG_FS
|
||||
#define USE_USB_OTG_FS // USB2.0 Full Speed == 12 Mbit
|
||||
#endif /* USE_USB_OTG_FS */
|
||||
|
||||
#ifdef USE_USB_OTG_FS
|
||||
|
||||
@@ -35,8 +35,6 @@
|
||||
*/
|
||||
|
||||
#include "board_taranis.h"
|
||||
#include "STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_dcd_int.h"
|
||||
#include "STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_bsp.h"
|
||||
|
||||
int usbPlugged(void)
|
||||
{
|
||||
@@ -63,28 +61,24 @@ USB_OTG_CORE_HANDLE USB_OTG_dev;
|
||||
|
||||
void OTG_FS_IRQHandler(void)
|
||||
{
|
||||
USBD_OTG_ISR_Handler (&USB_OTG_dev);
|
||||
USBD_OTG_ISR_Handler(&USB_OTG_dev);
|
||||
}
|
||||
|
||||
void usbInit(void)
|
||||
{
|
||||
USB_OTG_BSP_Init(&USB_OTG_dev);
|
||||
}
|
||||
|
||||
void usbStart(void)
|
||||
{
|
||||
#if defined(USB_JOYSTICK)
|
||||
// initialize USB as HID device
|
||||
USBD_Init(&USB_OTG_dev, USB_OTG_FS_CORE_ID, &USR_desc, &USBD_HID_cb, &USR_cb);
|
||||
#elif defined(USB_SERIAL)
|
||||
// initialize USB as CDC device (virtual serial port)
|
||||
USBD_Init(&USB_OTG_dev, USB_OTG_FS_CORE_ID, &USR_desc, &USBD_CDC_cb, &USR_cb);
|
||||
#elif defined(USB_MASS_STORAGE)
|
||||
// initialize USB as MSC device
|
||||
USBD_Init(&USB_OTG_dev, USB_OTG_FS_CORE_ID, &USR_desc, &USBD_MSC_cb, &USR_cb);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(USB_JOYSTICK)
|
||||
void usbStop(void)
|
||||
void usbDeInit(void)
|
||||
{
|
||||
USBD_DeInit(&USB_OTG_dev);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,222 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file usbd_cdc_vcp.c
|
||||
* @author MCD Application Team
|
||||
* @version V1.1.0
|
||||
* @date 19-March-2012
|
||||
* @brief Generic media access Layer.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at:
|
||||
*
|
||||
* http://www.st.com/software_license_agreement_liberty_v2
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED
|
||||
#pragma data_alignment = 4
|
||||
#endif /* USB_OTG_HS_INTERNAL_DMA_ENABLED */
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "usb_conf.h"
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
|
||||
|
||||
/* These are external variables imported from CDC core to be used for IN
|
||||
transfer management. */
|
||||
extern uint8_t APP_Rx_Buffer []; /* Write CDC received data in this buffer.
|
||||
These data will be sent over USB IN endpoint
|
||||
in the CDC core functions. */
|
||||
extern volatile uint32_t APP_Rx_ptr_in; /* Increment this pointer or roll it back to
|
||||
start address when writing received data
|
||||
in the buffer APP_Rx_Buffer. */
|
||||
extern volatile uint32_t APP_Rx_ptr_out;
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
static uint16_t VCP_Init (void);
|
||||
static uint16_t VCP_DeInit (void);
|
||||
static uint16_t VCP_Ctrl (uint32_t Cmd, uint8_t* Buf, uint32_t Len);
|
||||
static uint16_t VCP_DataRx (uint8_t* Buf, uint32_t Len);
|
||||
|
||||
// static uint16_t VCP_COMConfig(uint8_t Conf);
|
||||
|
||||
CDC_IF_Prop_TypeDef VCP_fops =
|
||||
{
|
||||
VCP_Init,
|
||||
VCP_DeInit,
|
||||
VCP_Ctrl,
|
||||
0,
|
||||
VCP_DataRx
|
||||
};
|
||||
|
||||
} // extern "C"
|
||||
|
||||
bool cdcConnected = false;
|
||||
|
||||
/* Private functions ---------------------------------------------------------*/
|
||||
/**
|
||||
* @brief VCP_Init
|
||||
* Initializes the Media on the STM32
|
||||
* @param None
|
||||
* @retval Result of the opeartion (USBD_OK in all cases)
|
||||
*/
|
||||
static uint16_t VCP_Init(void)
|
||||
{
|
||||
cdcConnected = true;
|
||||
return USBD_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief VCP_DeInit
|
||||
* DeInitializes the Media on the STM32
|
||||
* @param None
|
||||
* @retval Result of the opeartion (USBD_OK in all cases)
|
||||
*/
|
||||
static uint16_t VCP_DeInit(void)
|
||||
{
|
||||
cdcConnected = false;
|
||||
return USBD_OK;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief VCP_Ctrl
|
||||
* Manage the CDC class requests
|
||||
* @param Cmd: Command code
|
||||
* @param Buf: Buffer containing command data (request parameters)
|
||||
* @param Len: Number of data to be sent (in bytes)
|
||||
* @retval Result of the opeartion (USBD_OK in all cases)
|
||||
*/
|
||||
static uint16_t VCP_Ctrl (uint32_t Cmd, uint8_t* Buf, uint32_t Len)
|
||||
{
|
||||
switch (Cmd)
|
||||
{
|
||||
case SEND_ENCAPSULATED_COMMAND:
|
||||
/* Not needed for this driver */
|
||||
break;
|
||||
|
||||
case GET_ENCAPSULATED_RESPONSE:
|
||||
/* Not needed for this driver */
|
||||
break;
|
||||
|
||||
case SET_COMM_FEATURE:
|
||||
/* Not needed for this driver */
|
||||
break;
|
||||
|
||||
case GET_COMM_FEATURE:
|
||||
/* Not needed for this driver */
|
||||
break;
|
||||
|
||||
case CLEAR_COMM_FEATURE:
|
||||
/* Not needed for this driver */
|
||||
break;
|
||||
|
||||
case SET_LINE_CODING:
|
||||
/* Not needed for this driver */
|
||||
break;
|
||||
|
||||
case GET_LINE_CODING:
|
||||
/* Not needed for this driver */
|
||||
break;
|
||||
|
||||
case SET_CONTROL_LINE_STATE:
|
||||
/* Not needed for this driver */
|
||||
break;
|
||||
|
||||
case SEND_BREAK:
|
||||
/* Not needed for this driver */
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return USBD_OK;
|
||||
}
|
||||
|
||||
// some debug vars
|
||||
uint16_t usbWraps = 0;
|
||||
uint16_t charsWritten = 0;
|
||||
|
||||
void usbSerialPutc(uint8_t c)
|
||||
{
|
||||
if (!cdcConnected) return;
|
||||
|
||||
uint32_t txDataLen;
|
||||
do {
|
||||
txDataLen = APP_RX_DATA_SIZE + APP_Rx_ptr_in - APP_Rx_ptr_out;
|
||||
if (txDataLen >= APP_RX_DATA_SIZE) {
|
||||
txDataLen -= APP_RX_DATA_SIZE;
|
||||
}
|
||||
} while (txDataLen >= (APP_RX_DATA_SIZE - CDC_DATA_MAX_PACKET_SIZE));
|
||||
|
||||
APP_Rx_Buffer[APP_Rx_ptr_in] = c;
|
||||
++charsWritten;
|
||||
/* To avoid buffer overflow */
|
||||
if (APP_Rx_ptr_in >= APP_RX_DATA_SIZE-1) {
|
||||
APP_Rx_ptr_in = 0;
|
||||
++usbWraps;
|
||||
}
|
||||
else {
|
||||
APP_Rx_ptr_in++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief VCP_DataRx
|
||||
* Data received over USB OUT endpoint is available here
|
||||
*
|
||||
* @note
|
||||
* This function will block any OUT packet reception on USB endpoint
|
||||
* until exiting this function. If you exit this function before transfer
|
||||
* is complete on CDC interface (ie. using DMA controller) it will result
|
||||
* in receiving more data while previous ones are still not sent.
|
||||
*
|
||||
* @note
|
||||
* This function is executed inside the USBD_OTG_ISR_Handler() interrupt handler!
|
||||
|
||||
* @param Buf: Buffer of data to be received
|
||||
* @param Len: Number of data received (in bytes)
|
||||
* @retval Result of the opeartion: USBD_OK if all operations are OK else VCP_FAIL
|
||||
*/
|
||||
static uint16_t VCP_DataRx (uint8_t* Buf, uint32_t Len)
|
||||
{
|
||||
// TODO: try implementing inbound flow control:
|
||||
// if the cliRxFifo does not have enough free space to receive all
|
||||
// available characters, return VCP_FAIL. Maybe that will throttle down
|
||||
// the sender and we will receive the same packet at a later time.
|
||||
|
||||
#if defined(CLI)
|
||||
//copy data to the application FIFO
|
||||
for (uint32_t i = 0; i < Len; i++)
|
||||
{
|
||||
cliRxFifo.push(Buf[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
return USBD_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -36,13 +36,13 @@
|
||||
#define USBD_ITF_MAX_NUM 1
|
||||
#define USB_MAX_STR_DESC_SIZ 64
|
||||
|
||||
#define USBD_SELF_POWERED
|
||||
#define USBD_SELF_POWERED
|
||||
|
||||
/* Class Layer Parameter */
|
||||
|
||||
#define MSC_IN_EP 0x81
|
||||
#define MSC_OUT_EP 0x01
|
||||
#define MSC_MAX_PACKET 64
|
||||
#define MSC_MAX_PACKET 64
|
||||
|
||||
#define MSC_MEDIA_PACKET 4096
|
||||
|
||||
@@ -52,6 +52,17 @@
|
||||
#define HID_IN_PACKET 9
|
||||
#define HID_OUT_PACKET 9
|
||||
|
||||
#define CDC_IN_EP 0x81 /* EP1 for data IN */
|
||||
#define CDC_OUT_EP 0x01 /* EP1 for data OUT */
|
||||
#define CDC_CMD_EP 0x82 /* EP2 for CDC commands */
|
||||
|
||||
/* CDC Endpoints parameters: you can fine tune these values depending on the needed baudrates and performance. */
|
||||
#define CDC_DATA_MAX_PACKET_SIZE 64 /* Endpoint IN & OUT Packet size */
|
||||
#define CDC_CMD_PACKET_SZE 8 /* Control Endpoint Packet size */
|
||||
|
||||
#define CDC_IN_FRAME_INTERVAL 5 /* Number of frames between IN transfers */
|
||||
#define APP_RX_DATA_SIZE 512 // USB serial port output buffer. TODO: tune this buffer size /* Total size of IN buffer: APP_RX_DATA_SIZE*8/MAX_BAUDARATE*1000 should be > CDC_IN_FRAME_INTERVAL */
|
||||
#define APP_FOPS VCP_fops
|
||||
|
||||
#endif //__USBD_CONF__H__
|
||||
|
||||
|
||||
@@ -73,6 +73,11 @@
|
||||
#define USBD_PRODUCT_FS_STRING "FrSky Taranis Joystick"
|
||||
#define USBD_CONFIGURATION_FS_STRING "HID Config"
|
||||
#define USBD_INTERFACE_FS_STRING "HID Interface"
|
||||
#elif defined(USB_SERIAL)
|
||||
#define USBD_PID 0x5740 // do not change, this ID is used by the ST USB driver for Windows
|
||||
#define USBD_PRODUCT_FS_STRING "FrSky Taranis Serial Port"
|
||||
#define USBD_CONFIGURATION_FS_STRING "VSP Config"
|
||||
#define USBD_INTERFACE_FS_STRING "VSP Interface"
|
||||
#elif defined(USB_MASS_STORAGE)
|
||||
#define USBD_PID 0x5720
|
||||
#define USBD_PRODUCT_FS_STRING "FrSky Taranis Mass Storage"
|
||||
|
||||
Reference in New Issue
Block a user