Merge branch '2.3.0' into 2.3

# Conflicts:
#	CREDITS.txt
#	radio/src/telemetry/multi.cpp
#	tools/release23/tts.py
#	tools/release23/tts_common.py
This commit is contained in:
Kilrah
2019-09-28 14:16:27 +02:00
30 changed files with 524 additions and 520 deletions
@@ -20,6 +20,7 @@
#include "opentx.h"
#if !defined(BOOT)
Fifo<uint8_t, BT_TX_FIFO_SIZE> btTxFifo;
Fifo<uint8_t, BT_RX_FIFO_SIZE> btRxFifo;
@@ -42,6 +43,7 @@ enum BluetoothWriteState
};
volatile uint8_t bluetoothWriteState = BLUETOOTH_WRITE_IDLE;
#endif
void bluetoothInit(uint32_t baudrate, bool enable)
{
@@ -65,6 +67,7 @@ void bluetoothInit(uint32_t baudrate, bool enable)
GPIO_Init(BT_BCTS_GPIO, &GPIO_InitStructure);
#endif
#if !defined(BOOT)
GPIO_PinAFConfig(BT_USART_GPIO, BT_TX_GPIO_PinSource, BT_GPIO_AF);
GPIO_PinAFConfig(BT_USART_GPIO, BT_RX_GPIO_PinSource, BT_GPIO_AF);
@@ -90,17 +93,17 @@ void bluetoothInit(uint32_t baudrate, bool enable)
bluetoothWriteState = BLUETOOTH_WRITE_IDLE;
if (enable) {
GPIO_ResetBits(BT_EN_GPIO, BT_EN_GPIO_PIN);
}
else {
GPIO_SetBits(BT_EN_GPIO, BT_EN_GPIO_PIN);
}
btRxFifo.clear();
btTxFifo.clear();
#endif
if (enable)
GPIO_ResetBits(BT_EN_GPIO, BT_EN_GPIO_PIN);
else
GPIO_SetBits(BT_EN_GPIO, BT_EN_GPIO_PIN);
}
#if !defined(BOOT)
void bluetoothDisable()
{
GPIO_SetBits(BT_EN_GPIO, BT_EN_GPIO_PIN); // close bluetooth (recent modules will go to bootloader mode)
@@ -165,3 +168,4 @@ uint8_t bluetoothIsWriting(void)
{
return bluetoothWriteState != BLUETOOTH_WRITE_IDLE;
}
#endif // !BOOT
@@ -92,6 +92,13 @@ if(PCB STREQUAL X12S OR PCB STREQUAL X10 OR PCB STREQUAL X9E OR (PCB STREQUAL X9
)
endif()
if(PCB STREQUAL X7 OR PCB STREQUAL XLITE OR PCB STREQUAL XLITES)
set(BOOTLOADER_SRC
${BOOTLOADER_SRC}
../../../../../targets/common/arm/stm32/bluetooth_driver.cpp
)
endif()
if(NOT (PCB STREQUAL X10 OR PCB STREQUAL X12S))
set(BOOTLOADER_SRC
${BOOTLOADER_SRC}
@@ -245,6 +245,11 @@ int main()
backlightInit();
backlightEnable();
#if defined(PCBX7) || defined(PCBXLITE)
// we shutdown the bluetooth module now to be sure it will be detected on firmware start
bluetoothInit(BLUETOOTH_DEFAULT_BAUDRATE, false);
#endif
#if defined(PCBTARANIS)
i2cInit();
#endif
@@ -106,6 +106,7 @@ void rotaryEncoderCheck()
if (g_eeGeneral.backlightMode & e_backlight_mode_keys) {
backlightOn();
}
inactivity.counter = 0;
#endif
}
}