mirror of
https://github.com/opentx/opentx.git
synced 2025-07-26 01:35:21 +03:00
* Crossfire baudrate selection for X7 support ( fixes #4922 ) * Moved baurate selection to general settings * renamed mavbaud to telemetryBaudrate for ARM targets translation added * typo fixed
This commit is contained in:
parent
653273f82e
commit
390342af78
20 changed files with 55 additions and 5 deletions
|
@ -1008,7 +1008,8 @@ PACK(struct RadioData {
|
||||||
NOBACKUP(int8_t timezone:5);
|
NOBACKUP(int8_t timezone:5);
|
||||||
NOBACKUP(uint8_t adjustRTC:1);
|
NOBACKUP(uint8_t adjustRTC:1);
|
||||||
NOBACKUP(uint8_t inactivityTimer);
|
NOBACKUP(uint8_t inactivityTimer);
|
||||||
NOBACKUP(uint8_t mavbaud:3);
|
AVR_FIELD(uint8_t mavbaud:3)
|
||||||
|
ARM_FIELD(uint8_t telemetryBaudrate:3)
|
||||||
SPLASH_MODE; /* 3bits */
|
SPLASH_MODE; /* 3bits */
|
||||||
NOBACKUP(int8_t hapticMode:2); // -2=quiet, -1=only alarms, 0=no keys, 1=all
|
NOBACKUP(int8_t hapticMode:2); // -2=quiet, -1=only alarms, 0=no keys, 1=all
|
||||||
AVR_FIELD(uint8_t blOffBright:4)
|
AVR_FIELD(uint8_t blOffBright:4)
|
||||||
|
|
|
@ -111,6 +111,7 @@ enum MenuRadioHardwareItems {
|
||||||
ITEM_RADIO_HARDWARE_SD,
|
ITEM_RADIO_HARDWARE_SD,
|
||||||
ITEM_RADIO_HARDWARE_SF,
|
ITEM_RADIO_HARDWARE_SF,
|
||||||
ITEM_RADIO_HARDWARE_SH,
|
ITEM_RADIO_HARDWARE_SH,
|
||||||
|
ITEM_RADIO_HARDWARE_SERIAL_BAUDRATE,
|
||||||
#if defined(BLUETOOTH)
|
#if defined(BLUETOOTH)
|
||||||
ITEM_RADIO_HARDWARE_BLUETOOTH_MODE,
|
ITEM_RADIO_HARDWARE_BLUETOOTH_MODE,
|
||||||
ITEM_RADIO_HARDWARE_BLUETOOTH_LOCAL_ADDR,
|
ITEM_RADIO_HARDWARE_BLUETOOTH_LOCAL_ADDR,
|
||||||
|
@ -134,7 +135,7 @@ enum MenuRadioHardwareItems {
|
||||||
|
|
||||||
void menuRadioHardware(event_t event)
|
void menuRadioHardware(event_t event)
|
||||||
{
|
{
|
||||||
MENU(STR_HARDWARE, menuTabGeneral, MENU_RADIO_HARDWARE, ITEM_RADIO_HARDWARE_MAX, { LABEL(Sticks), 0, 0, 0, 0, LABEL(Pots), POTS_ROWS, LABEL(Switches), SWITCHES_ROWS, BLUETOOTH_ROWS 0 });
|
MENU(STR_HARDWARE, menuTabGeneral, MENU_RADIO_HARDWARE, ITEM_RADIO_HARDWARE_MAX, { LABEL(Sticks), 0, 0, 0, 0, LABEL(Pots), POTS_ROWS, LABEL(Switches), SWITCHES_ROWS, 0, BLUETOOTH_ROWS 0 });
|
||||||
|
|
||||||
uint8_t sub = menuVerticalPosition;
|
uint8_t sub = menuVerticalPosition;
|
||||||
|
|
||||||
|
@ -207,6 +208,24 @@ void menuRadioHardware(event_t event)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case ITEM_RADIO_HARDWARE_SERIAL_BAUDRATE:
|
||||||
|
lcdDrawTextAlignedLeft(y, STR_MAXBAUDRATE);
|
||||||
|
lcdDrawNumber(HW_SETTINGS_COLUMN2, y, CROSSFIRE_BAUDRATES[g_eeGeneral.telemetryBaudrate], attr|LEFT);
|
||||||
|
if (attr) {
|
||||||
|
g_eeGeneral.telemetryBaudrate = DIM(CROSSFIRE_BAUDRATES) - 1 - checkIncDecModel(event, DIM(CROSSFIRE_BAUDRATES) - 1 - g_eeGeneral.telemetryBaudrate, 0, DIM(CROSSFIRE_BAUDRATES) - 1);
|
||||||
|
if (checkIncDec_Ret) {
|
||||||
|
pauseMixerCalculations();
|
||||||
|
pausePulses();
|
||||||
|
EXTERNAL_MODULE_OFF();
|
||||||
|
CoTickDelay(10); // 20ms so that the pulses interrupt will reinit the frame rate
|
||||||
|
telemetryProtocol = 255; // force telemetry port + module reinitialization
|
||||||
|
EXTERNAL_MODULE_ON();
|
||||||
|
resumePulses();
|
||||||
|
resumeMixerCalculations();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
#if defined(BLUETOOTH)
|
#if defined(BLUETOOTH)
|
||||||
case ITEM_RADIO_HARDWARE_BLUETOOTH_MODE:
|
case ITEM_RADIO_HARDWARE_BLUETOOTH_MODE:
|
||||||
lcdDrawTextAlignedLeft(y, STR_BLUETOOTH);
|
lcdDrawTextAlignedLeft(y, STR_BLUETOOTH);
|
||||||
|
|
|
@ -101,8 +101,6 @@ PACK(struct Dsm2TimerPulsesData {
|
||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CROSSFIRE_BAUDRATE 400000
|
|
||||||
#define CROSSFIRE_FRAME_PERIOD 4 // 4ms
|
|
||||||
#define CROSSFIRE_FRAME_MAXLEN 64
|
#define CROSSFIRE_FRAME_MAXLEN 64
|
||||||
#define CROSSFIRE_CHANNELS_COUNT 16
|
#define CROSSFIRE_CHANNELS_COUNT 16
|
||||||
PACK(struct CrossfirePulsesData {
|
PACK(struct CrossfirePulsesData {
|
||||||
|
|
|
@ -726,7 +726,7 @@ PACK(typedef struct {
|
||||||
int8_t timezone:5;
|
int8_t timezone:5;
|
||||||
uint8_t adjustRTC:1;
|
uint8_t adjustRTC:1;
|
||||||
uint8_t inactivityTimer;
|
uint8_t inactivityTimer;
|
||||||
uint8_t mavbaud:3;
|
uint8_t telemetryBaudrate:3;
|
||||||
int8_t splashMode:3;
|
int8_t splashMode:3;
|
||||||
int8_t hapticMode:2; // -2=quiet, -1=only alarms, 0=no keys, 1=all
|
int8_t hapticMode:2; // -2=quiet, -1=only alarms, 0=no keys, 1=all
|
||||||
int8_t switchesDelay;
|
int8_t switchesDelay;
|
||||||
|
|
|
@ -681,6 +681,7 @@ FlagStatus USART_GetFlagStatus(USART_TypeDef* USARTx, uint16_t USART_FLAG) { ret
|
||||||
void GPIO_PinAFConfig(GPIO_TypeDef* GPIOx, uint16_t GPIO_PinSource, uint8_t GPIO_AF) { }
|
void GPIO_PinAFConfig(GPIO_TypeDef* GPIOx, uint16_t GPIO_PinSource, uint8_t GPIO_AF) { }
|
||||||
void USART_Init(USART_TypeDef* USARTx, USART_InitTypeDef* USART_InitStruct) { }
|
void USART_Init(USART_TypeDef* USARTx, USART_InitTypeDef* USART_InitStruct) { }
|
||||||
void USART_Cmd(USART_TypeDef* USARTx, FunctionalState NewState) { }
|
void USART_Cmd(USART_TypeDef* USARTx, FunctionalState NewState) { }
|
||||||
|
void USART_ClearITPendingBit(USART_TypeDef*, unsigned short) { }
|
||||||
void USART_DMACmd(USART_TypeDef* USARTx, uint16_t USART_DMAReq, FunctionalState NewState) { }
|
void USART_DMACmd(USART_TypeDef* USARTx, uint16_t USART_DMAReq, FunctionalState NewState) { }
|
||||||
void USART_ITConfig(USART_TypeDef* USARTx, uint16_t USART_IT, FunctionalState NewState) { }
|
void USART_ITConfig(USART_TypeDef* USARTx, uint16_t USART_IT, FunctionalState NewState) { }
|
||||||
// void TIM_TimeBaseInit(TIM_TypeDef* TIMx, TIM_TimeBaseInitTypeDef* TIM_TimeBaseInitStruct) { }
|
// void TIM_TimeBaseInit(TIM_TypeDef* TIMx, TIM_TimeBaseInitTypeDef* TIM_TimeBaseInitStruct) { }
|
||||||
|
|
|
@ -114,6 +114,7 @@ void sportSendBuffer(uint8_t * buffer, uint32_t count)
|
||||||
DMA_Cmd(TELEMETRY_DMA_Stream_TX, ENABLE);
|
DMA_Cmd(TELEMETRY_DMA_Stream_TX, ENABLE);
|
||||||
USART_DMACmd(TELEMETRY_USART, USART_DMAReq_Tx, ENABLE);
|
USART_DMACmd(TELEMETRY_USART, USART_DMAReq_Tx, ENABLE);
|
||||||
DMA_ITConfig(TELEMETRY_DMA_Stream_TX, DMA_IT_TC, ENABLE);
|
DMA_ITConfig(TELEMETRY_DMA_Stream_TX, DMA_IT_TC, ENABLE);
|
||||||
|
USART_ClearITPendingBit(TELEMETRY_USART, USART_IT_TC);
|
||||||
|
|
||||||
// enable interrupt and set it's priority
|
// enable interrupt and set it's priority
|
||||||
NVIC_EnableIRQ(TELEMETRY_DMA_TX_Stream_IRQ) ;
|
NVIC_EnableIRQ(TELEMETRY_DMA_TX_Stream_IRQ) ;
|
||||||
|
|
|
@ -41,4 +41,21 @@ void processCrossfireTelemetryData(uint8_t data);
|
||||||
void crossfireSetDefault(int index, uint8_t id, uint8_t subId);
|
void crossfireSetDefault(int index, uint8_t id, uint8_t subId);
|
||||||
bool isCrossfireOutputBufferAvailable();
|
bool isCrossfireOutputBufferAvailable();
|
||||||
|
|
||||||
|
#if defined(PCBX7)
|
||||||
|
const uint32_t CROSSFIRE_BAUDRATES[] = {
|
||||||
|
400000,
|
||||||
|
115200,
|
||||||
|
};
|
||||||
|
const uint8_t CROSSFIRE_FRAME_PERIODS[] = {
|
||||||
|
4,
|
||||||
|
16,
|
||||||
|
};
|
||||||
|
#define CROSSFIRE_BAUDRATE CROSSFIRE_BAUDRATES[g_eeGeneral.telemetryBaudrate]
|
||||||
|
#define CROSSFIRE_FRAME_PERIOD CROSSFIRE_FRAME_PERIODS[g_eeGeneral.telemetryBaudrate]
|
||||||
|
#else
|
||||||
|
#define CROSSFIRE_BAUDRATE 400000
|
||||||
|
#define CROSSFIRE_FRAME_PERIOD 4 // 4ms
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif // _CROSSFIRE_H_
|
#endif // _CROSSFIRE_H_
|
||||||
|
|
|
@ -551,6 +551,7 @@ const pm_char STR_HARDWARE[] PROGMEM = TR_HARDWARE;
|
||||||
const pm_char STR_FORMATTING[] PROGMEM = TR_FORMATTING;
|
const pm_char STR_FORMATTING[] PROGMEM = TR_FORMATTING;
|
||||||
const pm_char STR_TEMP_CALIB[] PROGMEM = TR_TEMP_CALIB;
|
const pm_char STR_TEMP_CALIB[] PROGMEM = TR_TEMP_CALIB;
|
||||||
const pm_char STR_TIME[] PROGMEM = TR_TIME;
|
const pm_char STR_TIME[] PROGMEM = TR_TIME;
|
||||||
|
const pm_char STR_MAXBAUDRATE[] PROGMEM = TR_MAXBAUDRATE;
|
||||||
const pm_char STR_BAUDRATE[] PROGMEM = TR_BAUDRATE;
|
const pm_char STR_BAUDRATE[] PROGMEM = TR_BAUDRATE;
|
||||||
const pm_char STR_SD_INFO_TITLE[] PROGMEM = TR_SD_INFO_TITLE;
|
const pm_char STR_SD_INFO_TITLE[] PROGMEM = TR_SD_INFO_TITLE;
|
||||||
const pm_char STR_SD_TYPE[] PROGMEM = TR_SD_TYPE;
|
const pm_char STR_SD_TYPE[] PROGMEM = TR_SD_TYPE;
|
||||||
|
|
|
@ -778,6 +778,7 @@ extern const pm_char STR_HARDWARE[];
|
||||||
extern const pm_char STR_FORMATTING[];
|
extern const pm_char STR_FORMATTING[];
|
||||||
extern const pm_char STR_TEMP_CALIB[];
|
extern const pm_char STR_TEMP_CALIB[];
|
||||||
extern const pm_char STR_TIME[];
|
extern const pm_char STR_TIME[];
|
||||||
|
extern const pm_char STR_MAXBAUDRATE[];
|
||||||
extern const pm_char STR_BAUDRATE[];
|
extern const pm_char STR_BAUDRATE[];
|
||||||
extern const pm_char STR_SD_INFO_TITLE[];
|
extern const pm_char STR_SD_INFO_TITLE[];
|
||||||
extern const pm_char STR_SD_TYPE[];
|
extern const pm_char STR_SD_TYPE[];
|
||||||
|
|
|
@ -956,6 +956,7 @@
|
||||||
#define TR_FORMATTING "Formátovaní.."
|
#define TR_FORMATTING "Formátovaní.."
|
||||||
#define TR_TEMP_CALIB " +=\006Teplota"
|
#define TR_TEMP_CALIB " +=\006Teplota"
|
||||||
#define TR_TIME "Čas"
|
#define TR_TIME "Čas"
|
||||||
|
#define TR_MAXBAUDRATE "Max bauds"
|
||||||
|
|
||||||
#define TR_BLUETOOTH "Bluetooth"
|
#define TR_BLUETOOTH "Bluetooth"
|
||||||
#define TR_BAUDRATE "BT Baudrate"
|
#define TR_BAUDRATE "BT Baudrate"
|
||||||
|
|
|
@ -977,6 +977,7 @@
|
||||||
#define TR_FORMATTING "Formatierung..."
|
#define TR_FORMATTING "Formatierung..."
|
||||||
#define TR_TEMP_CALIB "Temp. abgl."
|
#define TR_TEMP_CALIB "Temp. abgl."
|
||||||
#define TR_TIME "Uhrzeit:"
|
#define TR_TIME "Uhrzeit:"
|
||||||
|
#define TR_MAXBAUDRATE "Max bauds"
|
||||||
|
|
||||||
#define TR_BLUETOOTH "Bluetooth"
|
#define TR_BLUETOOTH "Bluetooth"
|
||||||
#define TR_BAUDRATE "BT Baudrate"
|
#define TR_BAUDRATE "BT Baudrate"
|
||||||
|
|
|
@ -960,6 +960,7 @@
|
||||||
#define TR_FORMATTING "Formatting..."
|
#define TR_FORMATTING "Formatting..."
|
||||||
#define TR_TEMP_CALIB "Temp. Calib"
|
#define TR_TEMP_CALIB "Temp. Calib"
|
||||||
#define TR_TIME "Time"
|
#define TR_TIME "Time"
|
||||||
|
#define TR_MAXBAUDRATE "Max bauds"
|
||||||
|
|
||||||
#define TR_BLUETOOTH "Bluetooth"
|
#define TR_BLUETOOTH "Bluetooth"
|
||||||
#define TR_BAUDRATE "BT Baudrate"
|
#define TR_BAUDRATE "BT Baudrate"
|
||||||
|
|
|
@ -936,6 +936,7 @@
|
||||||
#define TR_FORMATTING "Formateando.."
|
#define TR_FORMATTING "Formateando.."
|
||||||
#define TR_TEMP_CALIB "Temp. Calib"
|
#define TR_TEMP_CALIB "Temp. Calib"
|
||||||
#define TR_TIME "Hora"
|
#define TR_TIME "Hora"
|
||||||
|
#define TR_MAXBAUDRATE "Max bauds"
|
||||||
|
|
||||||
#define TR_BLUETOOTH "Bluetooth"
|
#define TR_BLUETOOTH "Bluetooth"
|
||||||
#define TR_BAUDRATE "BT Baudrate"
|
#define TR_BAUDRATE "BT Baudrate"
|
||||||
|
|
|
@ -932,6 +932,7 @@
|
||||||
#define TR_FORMATTING "Formatting..."
|
#define TR_FORMATTING "Formatting..."
|
||||||
#define TR_TEMP_CALIB "Temp. Calib"
|
#define TR_TEMP_CALIB "Temp. Calib"
|
||||||
#define TR_TIME "Time"
|
#define TR_TIME "Time"
|
||||||
|
#define TR_MAXBAUDRATE "Max bauds"
|
||||||
|
|
||||||
#define TR_BLUETOOTH "Bluetooth"
|
#define TR_BLUETOOTH "Bluetooth"
|
||||||
#define TR_BAUDRATE "BT Baudrate"
|
#define TR_BAUDRATE "BT Baudrate"
|
||||||
|
|
|
@ -959,6 +959,7 @@
|
||||||
#define TR_FORMATTING "Formatage..."
|
#define TR_FORMATTING "Formatage..."
|
||||||
#define TR_TEMP_CALIB "Calib. temp"
|
#define TR_TEMP_CALIB "Calib. temp"
|
||||||
#define TR_TIME "Heure"
|
#define TR_TIME "Heure"
|
||||||
|
#define TR_MAXBAUDRATE "Max bauds"
|
||||||
#define TR_BLUETOOTH "Bluetooth"
|
#define TR_BLUETOOTH "Bluetooth"
|
||||||
#define TR_BAUDRATE "Baudrate BT"
|
#define TR_BAUDRATE "Baudrate BT"
|
||||||
#define LEN_BLUETOOTH_MODES "\012"
|
#define LEN_BLUETOOTH_MODES "\012"
|
||||||
|
|
|
@ -961,6 +961,7 @@
|
||||||
#define TR_FORMATTING "Formattazione."
|
#define TR_FORMATTING "Formattazione."
|
||||||
#define TR_TEMP_CALIB "Temp. Calib"
|
#define TR_TEMP_CALIB "Temp. Calib"
|
||||||
#define TR_TIME "Ora"
|
#define TR_TIME "Ora"
|
||||||
|
#define TR_MAXBAUDRATE "Max bauds"
|
||||||
|
|
||||||
#define TR_BLUETOOTH "Bluetooth"
|
#define TR_BLUETOOTH "Bluetooth"
|
||||||
#define TR_BAUDRATE "BT Baudrate"
|
#define TR_BAUDRATE "BT Baudrate"
|
||||||
|
|
|
@ -956,6 +956,7 @@
|
||||||
#define TR_FORMATTING "Formatteren..."
|
#define TR_FORMATTING "Formatteren..."
|
||||||
#define TR_TEMP_CALIB "Temp. Calib."
|
#define TR_TEMP_CALIB "Temp. Calib."
|
||||||
#define TR_TIME "Tijd:"
|
#define TR_TIME "Tijd:"
|
||||||
|
#define TR_MAXBAUDRATE "Max bauds"
|
||||||
|
|
||||||
#define TR_BLUETOOTH "Bluetooth"
|
#define TR_BLUETOOTH "Bluetooth"
|
||||||
#define TR_BAUDRATE "BT Baudrate"
|
#define TR_BAUDRATE "BT Baudrate"
|
||||||
|
|
|
@ -963,6 +963,7 @@
|
||||||
#define TR_FORMATTING "Formatowanie.."
|
#define TR_FORMATTING "Formatowanie.."
|
||||||
#define TR_TEMP_CALIB "Temp. kalibracji"
|
#define TR_TEMP_CALIB "Temp. kalibracji"
|
||||||
#define TR_TIME "Czas"
|
#define TR_TIME "Czas"
|
||||||
|
#define TR_MAXBAUDRATE "Max bauds"
|
||||||
|
|
||||||
#define TR_BLUETOOTH "Bluetooth"
|
#define TR_BLUETOOTH "Bluetooth"
|
||||||
#define TR_BAUDRATE "Prędkość BT"
|
#define TR_BAUDRATE "Prędkość BT"
|
||||||
|
|
|
@ -937,6 +937,7 @@
|
||||||
#define TR_FORMATTING "Formatando..."
|
#define TR_FORMATTING "Formatando..."
|
||||||
#define TR_TEMP_CALIB "Temp. Calib"
|
#define TR_TEMP_CALIB "Temp. Calib"
|
||||||
#define TR_TIME "Time"
|
#define TR_TIME "Time"
|
||||||
|
#define TR_MAXBAUDRATE "Max bauds"
|
||||||
|
|
||||||
#define TR_BLUETOOTH "Bluetooth"
|
#define TR_BLUETOOTH "Bluetooth"
|
||||||
#define TR_BAUDRATE "BT Baudrate"
|
#define TR_BAUDRATE "BT Baudrate"
|
||||||
|
|
|
@ -975,6 +975,7 @@
|
||||||
#define TR_FORMATTING "Formaterar..."
|
#define TR_FORMATTING "Formaterar..."
|
||||||
#define TR_TEMP_CALIB "Temp. kalib."
|
#define TR_TEMP_CALIB "Temp. kalib."
|
||||||
#define TR_TIME "Tid "
|
#define TR_TIME "Tid "
|
||||||
|
#define TR_MAXBAUDRATE "Max bauds"
|
||||||
|
|
||||||
#define TR_BLUETOOTH "Bluetooth"
|
#define TR_BLUETOOTH "Bluetooth"
|
||||||
#define TR_BAUDRATE "BT Baudrate"
|
#define TR_BAUDRATE "BT Baudrate"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue