diff --git a/radio/src/gui/128x64/lcd.cpp b/radio/src/gui/128x64/lcd.cpp index 86bdf4a32..4d9a12a98 100644 --- a/radio/src/gui/128x64/lcd.cpp +++ b/radio/src/gui/128x64/lcd.cpp @@ -20,7 +20,10 @@ */ #include -#include "opentx.h" +#include +#include +#include "lcd.h" +#include "thirdparty/libopenui/src/bitfield.h" #include "gui/common/stdlcd/fonts.h" #include "gui/common/stdlcd/utf8.h" diff --git a/radio/src/gui/212x64/lcd.cpp b/radio/src/gui/212x64/lcd.cpp index db2aa75ca..0c48b540c 100644 --- a/radio/src/gui/212x64/lcd.cpp +++ b/radio/src/gui/212x64/lcd.cpp @@ -20,7 +20,9 @@ */ #include -#include "opentx.h" +#include +#include +#include "lcd.h" #include "common/stdlcd/fonts.h" #include "common/stdlcd/utf8.h" diff --git a/radio/src/targets/common/arm/stm32/bluetooth_driver.cpp b/radio/src/targets/common/arm/stm32/bluetooth_driver.cpp index 00c1e40b6..7fa525bda 100644 --- a/radio/src/targets/common/arm/stm32/bluetooth_driver.cpp +++ b/radio/src/targets/common/arm/stm32/bluetooth_driver.cpp @@ -19,7 +19,7 @@ * GNU General Public License for more details. */ -#include "opentx.h" +#include "board.h" #if !defined(BOOT) Fifo btTxFifo; diff --git a/radio/src/targets/common/arm/stm32/bootloader/CMakeLists.txt b/radio/src/targets/common/arm/stm32/bootloader/CMakeLists.txt index f7e2ab65b..b80cccffb 100644 --- a/radio/src/targets/common/arm/stm32/bootloader/CMakeLists.txt +++ b/radio/src/targets/common/arm/stm32/bootloader/CMakeLists.txt @@ -156,6 +156,7 @@ else() set(BOOTLOADER_SRC ${BOOTLOADER_SRC} ../../../../../gui/common/stdlcd/fonts.cpp + ../../../../../gui/common/stdlcd/utf8.cpp ../../../../../targets/${TARGET_DIR}/i2c_driver.cpp ) remove_definitions(-DDEBUG) diff --git a/radio/src/targets/common/arm/stm32/bootloader/bin_files.cpp b/radio/src/targets/common/arm/stm32/bootloader/bin_files.cpp index 7933331bb..298111548 100644 --- a/radio/src/targets/common/arm/stm32/bootloader/bin_files.cpp +++ b/radio/src/targets/common/arm/stm32/bootloader/bin_files.cpp @@ -19,7 +19,11 @@ * GNU General Public License for more details. */ +#include +#include + #include "boot.h" +#include "board.h" #include "sdcard.h" #include "bin_files.h" #include "fw_version.h" diff --git a/radio/src/targets/common/arm/stm32/bootloader/bin_files.h b/radio/src/targets/common/arm/stm32/bootloader/bin_files.h index 9ae2909ad..9681059be 100644 --- a/radio/src/targets/common/arm/stm32/bootloader/bin_files.h +++ b/radio/src/targets/common/arm/stm32/bootloader/bin_files.h @@ -23,7 +23,10 @@ #define _bin_files_h_ #include +#include "sdcard.h" +#if defined(COLORLCD) #include "bitmapbuffer.h" +#endif enum MemoryType { MEM_FLASH, diff --git a/radio/src/targets/common/arm/stm32/bootloader/boot.cpp b/radio/src/targets/common/arm/stm32/bootloader/boot.cpp index c49c96fb9..825916d77 100644 --- a/radio/src/targets/common/arm/stm32/bootloader/boot.cpp +++ b/radio/src/targets/common/arm/stm32/bootloader/boot.cpp @@ -24,6 +24,8 @@ #include "bin_files.h" #include "dataconstants.h" #include "lcd.h" +#include "keys.h" +#include "debug.h" #if defined(PCBXLITE) #define BOOTLOADER_KEYS 0x0F diff --git a/radio/src/targets/common/arm/stm32/rotary_encoder_driver.cpp b/radio/src/targets/common/arm/stm32/rotary_encoder_driver.cpp index 06af16fe7..6dbb0021f 100644 --- a/radio/src/targets/common/arm/stm32/rotary_encoder_driver.cpp +++ b/radio/src/targets/common/arm/stm32/rotary_encoder_driver.cpp @@ -20,6 +20,8 @@ */ #include "board.h" +#include "hal.h" +#include "board_common.h" static uint8_t rotencPosition; volatile rotenc_t rotencValue; diff --git a/radio/src/targets/taranis/backlight_driver.cpp b/radio/src/targets/taranis/backlight_driver.cpp index 8ca049079..84b217087 100644 --- a/radio/src/targets/taranis/backlight_driver.cpp +++ b/radio/src/targets/taranis/backlight_driver.cpp @@ -19,7 +19,7 @@ * GNU General Public License for more details. */ -#include "opentx.h" +#include "board.h" #if !defined(BACKLIGHT_GPIO) // no backlight diff --git a/radio/src/targets/taranis/bind_button_driver.cpp b/radio/src/targets/taranis/bind_button_driver.cpp index 6e8207dcf..966c15d45 100644 --- a/radio/src/targets/taranis/bind_button_driver.cpp +++ b/radio/src/targets/taranis/bind_button_driver.cpp @@ -19,7 +19,7 @@ * GNU General Public License for more details. */ -#include "opentx.h" +#include "board.h" bool setBindProtocolSelection() diff --git a/radio/src/targets/taranis/board.cpp b/radio/src/targets/taranis/board.cpp index c086a3ec8..bfeb42866 100644 --- a/radio/src/targets/taranis/board.cpp +++ b/radio/src/targets/taranis/board.cpp @@ -19,7 +19,9 @@ * GNU General Public License for more details. */ -#include "opentx.h" +#include "board.h" +#include "debug.h" +#include "rtc.h" #include "hal/adc_driver.h" #include "stm32_hal_adc.h" @@ -51,7 +53,7 @@ void watchdogInit(unsigned int duration) IWDG->KR = 0xCCCC; // start } -#if defined(SPORT_UPDATE_PWR_GPIO) +#if defined(SPORT_UPDATE_PWR_GPIO) && !defined(BOOT) void sportUpdateInit() { GPIO_InitTypeDef GPIO_InitStructure; @@ -349,6 +351,7 @@ void boardOff() #define VOLTAGE_DROP 20 #endif +#if !defined(BOOT) uint16_t getBatteryVoltage() { int32_t instant_vbat = anaIn(TX_VOLTAGE); // using filtered ADC value on purpose @@ -356,7 +359,7 @@ uint16_t getBatteryVoltage() instant_vbat += VOLTAGE_DROP; // add voltage drop because of the diode TODO check if this is needed, but removal will break existing calibrations! return (uint16_t)instant_vbat; } - +#endif #if defined(AUDIO_SPEAKER_ENABLE_GPIO) void initSpeakerEnable() { diff --git a/radio/src/targets/taranis/board.h b/radio/src/targets/taranis/board.h index d2c77e8bf..c699aa18c 100644 --- a/radio/src/targets/taranis/board.h +++ b/radio/src/targets/taranis/board.h @@ -23,13 +23,13 @@ #define _BOARD_H_ #include +#include "hal.h" +#include "hal/serial_port.h" +#include "watchdog_driver.h" + #include "definitions.h" #include "opentx_constants.h" #include "board_common.h" -#include "hal.h" -#include "hal/serial_port.h" - -#include "watchdog_driver.h" #if defined(RADIO_TX12) || defined(RADIO_ZORRO) #define NAVIGATION_X7_TX12 diff --git a/radio/src/targets/taranis/bootloader/boot_menu.cpp b/radio/src/targets/taranis/bootloader/boot_menu.cpp index a16d6e714..93a3b9407 100644 --- a/radio/src/targets/taranis/bootloader/boot_menu.cpp +++ b/radio/src/targets/taranis/bootloader/boot_menu.cpp @@ -19,7 +19,12 @@ * GNU General Public License for more details. */ -#include "opentx.h" +#include + +#include "board.h" +#include "lcd.h" +#include "fw_version.h" +#include "translations.h" #include "../../common/arm/stm32/bootloader/boot.h" #include "../../common/arm/stm32/bootloader/bin_files.h" diff --git a/radio/src/targets/taranis/diskio.cpp b/radio/src/targets/taranis/diskio.cpp index c8fcbe7fc..dc12e24c1 100644 --- a/radio/src/targets/taranis/diskio.cpp +++ b/radio/src/targets/taranis/diskio.cpp @@ -19,7 +19,8 @@ * GNU General Public License for more details. */ -#include "opentx.h" +#include "board.h" +#include "debug.h" #include "FatFs/diskio.h" #include "FatFs/ff.h" diff --git a/radio/src/targets/taranis/haptic_driver.cpp b/radio/src/targets/taranis/haptic_driver.cpp index 2cc07e49d..edcda28f9 100644 --- a/radio/src/targets/taranis/haptic_driver.cpp +++ b/radio/src/targets/taranis/haptic_driver.cpp @@ -19,7 +19,7 @@ * GNU General Public License for more details. */ -#include "opentx.h" +#include "board.h" #if defined(HAPTIC_PWM) // TODO test Haptic on X7 (I added PWM support) diff --git a/radio/src/targets/taranis/keys_driver.cpp b/radio/src/targets/taranis/keys_driver.cpp index a86baf9ea..2cd1053d5 100644 --- a/radio/src/targets/taranis/keys_driver.cpp +++ b/radio/src/targets/taranis/keys_driver.cpp @@ -19,7 +19,7 @@ * GNU General Public License for more details. */ -#include "opentx.h" +#include "board.h" uint32_t readKeys() { diff --git a/radio/src/targets/taranis/lcd_driver_aspi.cpp b/radio/src/targets/taranis/lcd_driver_aspi.cpp index 989da7a63..55385504f 100644 --- a/radio/src/targets/taranis/lcd_driver_aspi.cpp +++ b/radio/src/targets/taranis/lcd_driver_aspi.cpp @@ -19,7 +19,8 @@ * GNU General Public License for more details. */ -#include "opentx.h" +#include "board.h" +#include "lcd.h" #define CONTRAST_OFS 5 #define RESET_WAIT_DELAY_MS 1300 // Wait time after LCD reset before first command diff --git a/radio/src/targets/taranis/lcd_driver_spi.cpp b/radio/src/targets/taranis/lcd_driver_spi.cpp index 38f13f7cd..ac6044a92 100644 --- a/radio/src/targets/taranis/lcd_driver_spi.cpp +++ b/radio/src/targets/taranis/lcd_driver_spi.cpp @@ -19,7 +19,9 @@ * GNU General Public License for more details. */ -#include "opentx.h" +#include "board.h" +#include "debug.h" +#include "lcd.h" #if defined(RADIO_FAMILY_JUMPER_T12) || defined(RADIO_TX12) || defined(RADIO_ZORRO) || defined(RADIO_T8) || defined(RADIO_TPRO) #define LCD_CONTRAST_OFFSET -10 diff --git a/radio/src/targets/taranis/led_driver.cpp b/radio/src/targets/taranis/led_driver.cpp index 0b6824cf0..224c36953 100644 --- a/radio/src/targets/taranis/led_driver.cpp +++ b/radio/src/targets/taranis/led_driver.cpp @@ -19,7 +19,7 @@ * GNU General Public License for more details. */ -#include "opentx.h" +#include "board.h" void ledInit() { diff --git a/radio/src/targets/taranis/telemetry_driver.cpp b/radio/src/targets/taranis/telemetry_driver.cpp index 07fbfbac2..9dbcbc2a1 100644 --- a/radio/src/targets/taranis/telemetry_driver.cpp +++ b/radio/src/targets/taranis/telemetry_driver.cpp @@ -19,8 +19,7 @@ * GNU General Public License for more details. */ -#include "opentx.h" -#include "aux_serial_driver.h" +#include "board.h" Fifo telemetryFifo; uint32_t telemetryErrors = 0; diff --git a/radio/src/targets/taranis/top_lcd_driver.cpp b/radio/src/targets/taranis/top_lcd_driver.cpp index 977c41572..d15cad1de 100644 --- a/radio/src/targets/taranis/top_lcd_driver.cpp +++ b/radio/src/targets/taranis/top_lcd_driver.cpp @@ -19,7 +19,7 @@ * GNU General Public License for more details. */ -#include "opentx.h" +#include "board.h" #define CS1_HIGH() TOPLCD_GPIO->BSRRL = TOPLCD_GPIO_PIN_CS1 #define CS1_LOW() TOPLCD_GPIO->BSRRH = TOPLCD_GPIO_PIN_CS1 diff --git a/radio/src/targets/taranis/usb_charger_driver.cpp b/radio/src/targets/taranis/usb_charger_driver.cpp index 63d04f283..3f217b175 100644 --- a/radio/src/targets/taranis/usb_charger_driver.cpp +++ b/radio/src/targets/taranis/usb_charger_driver.cpp @@ -19,7 +19,7 @@ * GNU General Public License for more details. */ -#include "opentx.h" +#include "board.h" void usbChargerInit() {