diff --git a/src/bootloader/bootloader_sx1280_rx_ccg_nano_v05.bin b/src/bootloader/bootloader_sx1280_rx_ccg_nano_v05.bin deleted file mode 100644 index 7ea739198c..0000000000 Binary files a/src/bootloader/bootloader_sx1280_rx_ccg_nano_v05.bin and /dev/null differ diff --git a/src/bootloader/fm30_mini_bootloader.bin b/src/bootloader/fm30_mini_bootloader.bin index 4d02bbcf5d..356a3f47f7 100644 Binary files a/src/bootloader/fm30_mini_bootloader.bin and b/src/bootloader/fm30_mini_bootloader.bin differ diff --git a/src/bootloader/fm30_mini_rxtx_bootloader.bin b/src/bootloader/fm30_mini_rxtx_bootloader.bin index 83098d9836..4492505ab1 100644 Binary files a/src/bootloader/fm30_mini_rxtx_bootloader.bin and b/src/bootloader/fm30_mini_rxtx_bootloader.bin differ diff --git a/src/bootloader/ghost/ghost_atto_bootloader.bin b/src/bootloader/ghost/ghost_atto_bootloader.bin new file mode 100644 index 0000000000..22792b9905 Binary files /dev/null and b/src/bootloader/ghost/ghost_atto_bootloader.bin differ diff --git a/src/bootloader/ghost/ghost_atto_v1.2_bootloader.bin b/src/bootloader/ghost/ghost_atto_v1.2_bootloader.bin deleted file mode 100644 index 156a0fd070..0000000000 Binary files a/src/bootloader/ghost/ghost_atto_v1.2_bootloader.bin and /dev/null differ diff --git a/src/bootloader/ghost/ghost_tx_bootloader.bin b/src/bootloader/ghost/ghost_tx_bootloader.bin index e66e839f67..c7c4a1088d 100644 Binary files a/src/bootloader/ghost/ghost_tx_bootloader.bin and b/src/bootloader/ghost/ghost_tx_bootloader.bin differ diff --git a/src/bootloader/jumper_r900_bootloader.bin b/src/bootloader/jumper_r900_bootloader.bin index 09e4c1c1c2..7e0acbaeb8 100644 Binary files a/src/bootloader/jumper_r900_bootloader.bin and b/src/bootloader/jumper_r900_bootloader.bin differ diff --git a/src/bootloader/jumper_r900_bootloader_no_btn.bin b/src/bootloader/jumper_r900_bootloader_no_btn.bin deleted file mode 100644 index 46750a0bcc..0000000000 Binary files a/src/bootloader/jumper_r900_bootloader_no_btn.bin and /dev/null differ diff --git a/src/bootloader/jumper_r900_no_btn_bootloader.bin b/src/bootloader/jumper_r900_no_btn_bootloader.bin new file mode 100644 index 0000000000..c8a31c6700 Binary files /dev/null and b/src/bootloader/jumper_r900_no_btn_bootloader.bin differ diff --git a/src/bootloader/namimnorc/rx/flash_2400_bootloader.bin b/src/bootloader/namimnorc/rx/flash_2400_bootloader.bin index 29c9fd5181..4bfbe95584 100644 Binary files a/src/bootloader/namimnorc/rx/flash_2400_bootloader.bin and b/src/bootloader/namimnorc/rx/flash_2400_bootloader.bin differ diff --git a/src/bootloader/namimnorc/rx/voyager_900_bootloader.bin b/src/bootloader/namimnorc/rx/voyager_900_bootloader.bin index dbc3b59b31..681d66b444 100644 Binary files a/src/bootloader/namimnorc/rx/voyager_900_bootloader.bin and b/src/bootloader/namimnorc/rx/voyager_900_bootloader.bin differ diff --git a/src/bootloader/namimnorc/tx/firmware.bin b/src/bootloader/namimnorc/tx/firmware.bin deleted file mode 100644 index 3bed83b529..0000000000 Binary files a/src/bootloader/namimnorc/tx/firmware.bin and /dev/null differ diff --git a/src/bootloader/namimnorc/tx/namimnorc_tx_bootloader.bin b/src/bootloader/namimnorc/tx/namimnorc_tx_bootloader.bin new file mode 100644 index 0000000000..c214d13a4e Binary files /dev/null and b/src/bootloader/namimnorc/tx/namimnorc_tx_bootloader.bin differ diff --git a/src/bootloader/r9m_bootloader.bin b/src/bootloader/r9m_bootloader.bin index 20ef1a58ea..5510999a29 100644 Binary files a/src/bootloader/r9m_bootloader.bin and b/src/bootloader/r9m_bootloader.bin differ diff --git a/src/bootloader/r9m_elrs_bl.frk b/src/bootloader/r9m_elrs_bl.frk index aeb8b7a253..78e92dc400 100644 Binary files a/src/bootloader/r9m_elrs_bl.frk and b/src/bootloader/r9m_elrs_bl.frk differ diff --git a/src/bootloader/r9m_lite_pro_bootloader.bin b/src/bootloader/r9m_lite_pro_bootloader.bin index 5414d8fc5d..a7d559c4c4 100644 Binary files a/src/bootloader/r9m_lite_pro_bootloader.bin and b/src/bootloader/r9m_lite_pro_bootloader.bin differ diff --git a/src/bootloader/r9mm_bootloader.bin b/src/bootloader/r9mm_bootloader.bin index f23f6ea0a6..90c60031bf 100644 Binary files a/src/bootloader/r9mm_bootloader.bin and b/src/bootloader/r9mm_bootloader.bin differ diff --git a/src/bootloader/r9mm_elrs_bl.frk b/src/bootloader/r9mm_elrs_bl.frk index bdf3d81bf6..c483db6f48 100644 Binary files a/src/bootloader/r9mm_elrs_bl.frk and b/src/bootloader/r9mm_elrs_bl.frk differ diff --git a/src/bootloader/r9mm_no_btn_bootloader.bin b/src/bootloader/r9mm_no_btn_bootloader.bin index adecf4cf98..334a5c61b0 100644 Binary files a/src/bootloader/r9mm_no_btn_bootloader.bin and b/src/bootloader/r9mm_no_btn_bootloader.bin differ diff --git a/src/bootloader/r9mm_no_btn_elrs_bl.frk b/src/bootloader/r9mm_no_btn_elrs_bl.frk index d067efd2c2..eb797b6ed9 100644 Binary files a/src/bootloader/r9mm_no_btn_elrs_bl.frk and b/src/bootloader/r9mm_no_btn_elrs_bl.frk differ diff --git a/src/bootloader/r9mx_bootloader.bin b/src/bootloader/r9mx_bootloader.bin index dd6f0a405e..c071b184e9 100644 Binary files a/src/bootloader/r9mx_bootloader.bin and b/src/bootloader/r9mx_bootloader.bin differ diff --git a/src/bootloader/r9mx_elrs_bl.frk b/src/bootloader/r9mx_elrs_bl.frk index 017757f306..3d152e0524 100644 Binary files a/src/bootloader/r9mx_elrs_bl.frk and b/src/bootloader/r9mx_elrs_bl.frk differ diff --git a/src/bootloader/r9mx_no_btn_bootloader.bin b/src/bootloader/r9mx_no_btn_bootloader.bin index c6dcc767c2..09cfcae7f2 100644 Binary files a/src/bootloader/r9mx_no_btn_bootloader.bin and b/src/bootloader/r9mx_no_btn_bootloader.bin differ diff --git a/src/bootloader/r9mx_no_btn_elrs_bl.frk b/src/bootloader/r9mx_no_btn_elrs_bl.frk index d9897deccc..80e6993a4a 100644 Binary files a/src/bootloader/r9mx_no_btn_elrs_bl.frk and b/src/bootloader/r9mx_no_btn_elrs_bl.frk differ diff --git a/src/bootloader/r9slim_bootloader.bin b/src/bootloader/r9slim_bootloader.bin new file mode 100644 index 0000000000..805999b5e3 Binary files /dev/null and b/src/bootloader/r9slim_bootloader.bin differ diff --git a/src/bootloader/r9slim_elrs_bl.frk b/src/bootloader/r9slim_elrs_bl.frk new file mode 100644 index 0000000000..bfd6bcb606 Binary files /dev/null and b/src/bootloader/r9slim_elrs_bl.frk differ diff --git a/src/bootloader/r9slim_no_btn_bootloader.bin b/src/bootloader/r9slim_no_btn_bootloader.bin index 2eff11e26c..0b28a57fe2 100644 Binary files a/src/bootloader/r9slim_no_btn_bootloader.bin and b/src/bootloader/r9slim_no_btn_bootloader.bin differ diff --git a/src/bootloader/r9slim_no_btn_elrs_bl.frk b/src/bootloader/r9slim_no_btn_elrs_bl.frk new file mode 100644 index 0000000000..1a26afe46a Binary files /dev/null and b/src/bootloader/r9slim_no_btn_elrs_bl.frk differ diff --git a/src/bootloader/r9slim_plus_bootloader.bin b/src/bootloader/r9slim_plus_bootloader.bin index 74bcc3a3ee..7bcc573eb7 100644 Binary files a/src/bootloader/r9slim_plus_bootloader.bin and b/src/bootloader/r9slim_plus_bootloader.bin differ diff --git a/src/bootloader/r9slim_plus_elrs_bl.frk b/src/bootloader/r9slim_plus_elrs_bl.frk index de9aab37c8..c9481609b7 100644 Binary files a/src/bootloader/r9slim_plus_elrs_bl.frk and b/src/bootloader/r9slim_plus_elrs_bl.frk differ diff --git a/src/bootloader/r9slim_plus_no_btn_bootloader.bin b/src/bootloader/r9slim_plus_no_btn_bootloader.bin new file mode 100644 index 0000000000..b4826ed675 Binary files /dev/null and b/src/bootloader/r9slim_plus_no_btn_bootloader.bin differ diff --git a/src/bootloader/r9slim_plus_no_btn_elrs_bl.frk b/src/bootloader/r9slim_plus_no_btn_elrs_bl.frk new file mode 100644 index 0000000000..8df2e29cd9 Binary files /dev/null and b/src/bootloader/r9slim_plus_no_btn_elrs_bl.frk differ diff --git a/src/bootloader/r9slim_plus_ota_bootloader.bin b/src/bootloader/r9slim_plus_ota_bootloader.bin index 7a99d01925..4126e659c1 100644 Binary files a/src/bootloader/r9slim_plus_ota_bootloader.bin and b/src/bootloader/r9slim_plus_ota_bootloader.bin differ diff --git a/src/bootloader/r9slim_plus_ota_elrs_bl.frk b/src/bootloader/r9slim_plus_ota_elrs_bl.frk index 5b9a542e86..d2e61babea 100644 Binary files a/src/bootloader/r9slim_plus_ota_elrs_bl.frk and b/src/bootloader/r9slim_plus_ota_elrs_bl.frk differ diff --git a/src/bootloader/r9slim_plus_ota_no_btn_bootloader.bin b/src/bootloader/r9slim_plus_ota_no_btn_bootloader.bin new file mode 100644 index 0000000000..c5f6970309 Binary files /dev/null and b/src/bootloader/r9slim_plus_ota_no_btn_bootloader.bin differ diff --git a/src/bootloader/r9slim_plus_ota_no_btn_elrs_bl.frk b/src/bootloader/r9slim_plus_ota_no_btn_elrs_bl.frk new file mode 100644 index 0000000000..321de83a93 Binary files /dev/null and b/src/bootloader/r9slim_plus_ota_no_btn_elrs_bl.frk differ diff --git a/src/bootloader/src/Src/flash.c b/src/bootloader/src/Src/flash.c index 46f752387f..78573387f3 100644 --- a/src/bootloader/src/Src/flash.c +++ b/src/bootloader/src/Src/flash.c @@ -305,8 +305,8 @@ int8_t flash_check_app_loaded(void) uintptr_t app_reset = *(volatile uintptr_t *)(FLASH_APP_START_ADDRESS + 4u); uintptr_t app_nmi = *(volatile uintptr_t *)(FLASH_APP_START_ADDRESS + 8u); if (((uint16_t)(app_stack >> 20) == 0x200) && - ((uint16_t)(app_reset >> 16) == 0x0800) && - ((uint16_t)(app_nmi >> 16) == 0x0800)) { + ((uint16_t)((app_reset >> 16) & 0xFFFC) == 0x0800) && + ((uint16_t)((app_nmi >> 16) & 0xFFFC) == 0x0800)) { return 0; } return -1; diff --git a/src/bootloader/src/Src/uart.c b/src/bootloader/src/Src/uart.c index 340a552e5f..2a2129b1aa 100644 --- a/src/bootloader/src/Src/uart.c +++ b/src/bootloader/src/Src/uart.c @@ -179,7 +179,7 @@ void USARTx_IRQ_handler(USART_TypeDef * uart) uint8_t data = (uint8_t)LL_USART_ReceiveData8(uart); // If RX is in interrupt mode, the RX not-empty bit is set, and the received byte // has no framing errors (framing errors still generate RXNE), add to the RX fifo - if ((CR & USART_CR1_RXNEIE) && (SR & USART_SR_RXNE) && !(SR & USART_ISR_FE)) { + if ((CR & USART_CR1_RXNEIE) && (SR & USART_SR_RXNE) && !(SR & USART_SR_FE)) { uint8_t next = rx_head; if ((next + 1) != rx_tail) { rx_buffer[rx_head++] = data; diff --git a/src/bootloader/src/platformio.ini b/src/bootloader/src/platformio.ini index 642a66dbc8..081d18468a 100644 --- a/src/bootloader/src/platformio.ini +++ b/src/bootloader/src/platformio.ini @@ -3,8 +3,8 @@ src_dir = Src lib_dir = Drivers [env] -#platform = ststm32@7.2.0 -platform = ststm32 #@8.1.0 +#platform = ststm32 @8.1.0 +platform = ststm32 @9.0.0 framework = stm32cube build_unflags = -nostartfiles -nostdlib board_build.ldscript = linker/stm32.ld @@ -16,7 +16,7 @@ debug_tool = stlink monitor_speed = 420000 [generic] -VERSION = -D BOOTLOADER_VERSION=0.5.3 +VERSION = -D BOOTLOADER_VERSION=0.5.4 flags_hal = ${generic.VERSION} -Wl,-Map,firmware.map diff --git a/src/bootloader/sx1280_rx_2020_pcb_v0.2_bootloader.bin b/src/bootloader/sx1280_rx_2020_pcb_v0.2_bootloader.bin new file mode 100644 index 0000000000..5dab0a8366 Binary files /dev/null and b/src/bootloader/sx1280_rx_2020_pcb_v0.2_bootloader.bin differ diff --git a/src/bootloader/sx1280_rx_nano_pcb_v0.5_bootloader.bin b/src/bootloader/sx1280_rx_nano_pcb_v0.5_bootloader.bin new file mode 100644 index 0000000000..ea6dce6a32 Binary files /dev/null and b/src/bootloader/sx1280_rx_nano_pcb_v0.5_bootloader.bin differ diff --git a/src/lib/EEPROM/elrs_eeprom.cpp b/src/lib/EEPROM/elrs_eeprom.cpp index 19afec48cc..ae1cb512c2 100644 --- a/src/lib/EEPROM/elrs_eeprom.cpp +++ b/src/lib/EEPROM/elrs_eeprom.cpp @@ -16,7 +16,7 @@ extEEPROM EEPROM(kbits_2, 1, 1, TARGET_EEPROM_ADDR); #else #define STM32_USE_FLASH - #include + #include #endif #else #include diff --git a/src/targets/common.ini b/src/targets/common.ini index fb4ec65b6a..1ce3859307 100644 --- a/src/targets/common.ini +++ b/src/targets/common.ini @@ -77,7 +77,7 @@ bf_upload_command = # ------------------------- COMMON STM32 DEFINITIONS ----------------- [env_common_stm32] -platform = ststm32@8.0.0 +platform = ststm32@15.1.0 board = bluepill_f103c8 build_unflags = -Os build_flags = @@ -88,3 +88,4 @@ build_flags = src_filter = ${common_env_data.src_filter} - - - lib_deps = paolop74/extEEPROM @ ^3.4.1 +monitor_speed = 420000 \ No newline at end of file diff --git a/src/targets/diy_2400.ini b/src/targets/diy_2400.ini index 8a3a6552f4..32c107236f 100644 --- a/src/targets/diy_2400.ini +++ b/src/targets/diy_2400.ini @@ -24,7 +24,7 @@ build_flags = -D VTABLES_IN_FLASH=1 -O2 src_filter = ${env_common_esp32.src_filter} - -lib_deps = +lib_deps = ${env_common_esp32.lib_deps} olikraus/U8g2@^2.28.8 @@ -41,7 +41,7 @@ build_flags = -D VTABLES_IN_FLASH=1 -O2 src_filter = ${env_common_esp32.src_filter} - -lib_deps = +lib_deps = ${env_common_esp32.lib_deps} olikraus/U8g2@^2.28.8 @@ -92,7 +92,6 @@ extends = env:DIY_2400_RX_PWMP_via_UART [env:DIY_2400_RX_STM32_CCG_Nano_v0_5_via_STLINK] extends = env_common_stm32, radio_2400 -platform = ststm32@9.0.0 board = l432kb # max size = 131072 - 0x4000 = 114688 board_upload.maximum_size = 114688 @@ -113,7 +112,7 @@ build_flags = -Wl,--defsym=FLASH_APP_OFFSET=16K src_filter = ${env_common_stm32.src_filter} - upload_flags = - BOOTLOADER=bootloader/bootloader_sx1280_rx_ccg_nano_v05.bin + BOOTLOADER=bootloader/sx1280_rx_nano_pcb_v0.5_bootloader.bin VECT_OFFSET=0x4000 [env:DIY_2400_RX_STM32_CCG_Nano_v0_5_via_BetaflightPassthrough] diff --git a/src/targets/diy_900.ini b/src/targets/diy_900.ini index daba537caa..e399f17a92 100644 --- a/src/targets/diy_900.ini +++ b/src/targets/diy_900.ini @@ -84,7 +84,7 @@ upload_speed = 420000 upload_command = ${env_common_esp82xx.bf_upload_command} [env:DIY_900_RX_HUZZAH_RFM95W_via_WIFI] -extends = DIY_900_RX_HUZZAH_RFM95W_via_UART +extends = env:DIY_900_RX_HUZZAH_RFM95W_via_UART [env:DIY_900_RX_PWMP_via_UART] extends = env_common_esp82xx diff --git a/src/targets/frsky.ini b/src/targets/frsky.ini index 8e19d9c82e..65cce70206 100644 --- a/src/targets/frsky.ini +++ b/src/targets/frsky.ini @@ -6,7 +6,6 @@ ## TODO: R9M STLINK/stock and R9M Lite targets can be merged [env:Frsky_TX_R9M_via_STLINK] extends = env_common_stm32, radio_900 -platform = ststm32@15.1.0 build_flags = ${env_common_stm32.build_flags} ${common_env_data.build_flags_tx} @@ -35,6 +34,7 @@ extends = env:Frsky_TX_R9M_via_STLINK build_flags = ${env_common_stm32.build_flags} ${common_env_data.build_flags_tx} + ${radio_900.build_flags} -include target/Frsky_TX_R9M_LITE.h -flto -D HSE_VALUE=12000000U @@ -45,7 +45,6 @@ extends = env:Frsky_TX_R9M_LITE_via_STLINK [env:Frsky_TX_R9M_LITE_PRO_via_STLINK] extends = env_common_stm32, radio_900 -platform = ststm32@9.0.0 board = robotdyn_blackpill_f303cc build_flags = ${env_common_stm32.build_flags} @@ -53,7 +52,6 @@ build_flags = ${radio_900.build_flags} -include target/Frsky_TX_R9M_LITE_PRO.h -D HSE_VALUE=12000000U - -O2 -DVECT_TAB_OFFSET=0x8000U board_build.ldscript = variants/R9M_Lite_Pro_ldscript.ld board_build.flash_offset = 0x8000 diff --git a/src/targets/happymodel_900.ini b/src/targets/happymodel_900.ini index 2638645bdd..8dda2a0cf5 100644 --- a/src/targets/happymodel_900.ini +++ b/src/targets/happymodel_900.ini @@ -5,7 +5,6 @@ [env:HappyModel_TX_ES915TX_via_STLINK] extends = env_common_stm32, radio_900 -platform = ststm32@15.1.0 build_flags = ${env_common_stm32.build_flags} ${common_env_data.build_flags_tx} diff --git a/src/targets/imrc.ini b/src/targets/imrc.ini index 84dee7ed99..afd08d0216 100644 --- a/src/targets/imrc.ini +++ b/src/targets/imrc.ini @@ -5,7 +5,6 @@ [env:GHOST_2400_TX_via_STLINK] extends = env_common_stm32, radio_2400 -platform = ststm32@11.0.0 board = GHOST_TX build_flags = ${env_common_stm32.build_flags} @@ -36,7 +35,6 @@ build_flags = [env:GHOST_ATTO_2400_RX_via_STLINK] extends = env_common_stm32, radio_2400 -platform = ststm32@11.0.0 board = GHOST_ATTO build_flags = ${env_common_stm32.build_flags} @@ -50,7 +48,7 @@ src_filter = ${env_common_stm32.src_filter} - lib_deps = lib_ignore = Servo upload_flags = - BOOTLOADER=bootloader/ghost/ghost_atto_v1.2_bootloader.bin + BOOTLOADER=bootloader/ghost/ghost_atto_bootloader.bin VECT_OFFSET=0x4000 [env:GHOST_ATTO_2400_RX_via_BetaflightPassthrough] diff --git a/src/targets/namimnorc_2400.ini b/src/targets/namimnorc_2400.ini index 0a36ddc0ff..132edc5d9b 100644 --- a/src/targets/namimnorc_2400.ini +++ b/src/targets/namimnorc_2400.ini @@ -15,7 +15,7 @@ build_flags = board_build.ldscript = variants/NamimnoRC_Alpha.ld src_filter = ${env_common_stm32.src_filter} - upload_flags = - BOOTLOADER=bootloader/namimnorc/tx/firmware.bin + BOOTLOADER=bootloader/namimnorc/tx/namimnorc_tx_bootloader.bin VECT_OFFSET=0x4000 [env:NamimnoRC_FLASH_2400_TX_via_WIFI] diff --git a/src/targets/namimnorc_900.ini b/src/targets/namimnorc_900.ini index 25dd4991dc..a0954c16c9 100644 --- a/src/targets/namimnorc_900.ini +++ b/src/targets/namimnorc_900.ini @@ -9,9 +9,10 @@ build_flags = ${env_common_stm32.build_flags} ${common_env_data.build_flags_tx} ${radio_900.build_flags} + -include target/NamimnoRC_VOYAGER_900_TX.h + -flto -D HSE_VALUE=12000000U -D VECT_TAB_OFFSET=0x4000U - -include target/NamimnoRC_VOYAGER_900_TX.h board_build.ldscript = variants/NamimnoRC_Alpha.ld src_filter = ${env_common_stm32.src_filter} - upload_flags = @@ -24,14 +25,14 @@ extends = env:NamimnoRC_VOYAGER_900_TX_via_STLINK [env:NamimnoRC_VOYAGER_900_OLED_TX_via_UART] extends = env_common_esp32 -build_flags = +build_flags = ${env_common_esp32.build_flags} ${common_env_data.build_flags_tx} -include target/NamimnoRC_VOYAGER_900_OLED_TX.h -D VTABLES_IN_FLASH=1 -O2 src_filter = ${env_common_esp32.src_filter} - -lib_deps = +lib_deps = ${env_common_esp32.lib_deps} olikraus/U8g2@^2.28.8 diff --git a/src/targets/siyi.ini b/src/targets/siyi.ini index 7c74fc9609..7487c0c85e 100644 --- a/src/targets/siyi.ini +++ b/src/targets/siyi.ini @@ -30,7 +30,6 @@ extends = env:FM30_TX_via_STLINK [env:FM30_RX_MINI_via_STLINK] extends = env_common_stm32, radio_2400 -platform = ststm32@13.0.0 board = FM30_mini build_flags = ${env_common_stm32.build_flags} @@ -50,7 +49,6 @@ extends = env:FM30_RX_MINI_via_STLINK [env:FM30_RX_MINI_AS_TX_via_STLINK] extends = env_common_stm32, radio_2400 -platform = ststm32@13.0.0 board = FM30_mini build_flags = ${env_common_stm32.build_flags} diff --git a/src/variants/FM30/variant.cpp b/src/variants/FM30/variant_FM30.cpp similarity index 93% rename from src/variants/FM30/variant.cpp rename to src/variants/FM30/variant_FM30.cpp index 8924a39613..fb581e12c5 100644 --- a/src/variants/FM30/variant.cpp +++ b/src/variants/FM30/variant_FM30.cpp @@ -75,6 +75,22 @@ const PinName digitalPin[] = { PA_14, //D34 - SWCLK }; +// If analog pins are not contiguous in the digitalPin array: +// Add the analogInputPin array without defining NUM_ANALOG_FIRST +// Analog (Ax) pin number array +// where x is the index to retrieve the digital pin number +const uint32_t analogInputPin[] = { + PA0, + PA1, + PA2, + PA3, + PA4, + PA5, + PA6, + PA7, + PB0, + PB1 +}; #ifdef __cplusplus } #endif diff --git a/src/variants/FM30/variant.h b/src/variants/FM30/variant_FM30.h similarity index 100% rename from src/variants/FM30/variant.h rename to src/variants/FM30/variant_FM30.h diff --git a/src/variants/FM30_mini/PeripheralPins.c b/src/variants/FM30_mini/PeripheralPins.c index ede6e2cbd4..33a6a867dd 100644 --- a/src/variants/FM30_mini/PeripheralPins.c +++ b/src/variants/FM30_mini/PeripheralPins.c @@ -262,6 +262,6 @@ WEAK const PinMap PinMap_USB[] = { //*** No SD *** //*** PWM *** -WEAK const PinMap PinMap_PWM[] = { - {NC, NP, 0} -}; +// WEAK const PinMap PinMap_PWM[] = { +// {NC, NP, 0} +// }; \ No newline at end of file diff --git a/src/variants/FM30_mini/variant.cpp b/src/variants/FM30_mini/variant_FM30_MINI.cpp similarity index 100% rename from src/variants/FM30_mini/variant.cpp rename to src/variants/FM30_mini/variant_FM30_MINI.cpp diff --git a/src/variants/FM30_mini/variant.h b/src/variants/FM30_mini/variant_FM30_MINI.h similarity index 95% rename from src/variants/FM30_mini/variant.h rename to src/variants/FM30_mini/variant_FM30_MINI.h index 9369305575..4dbd0fbf59 100644 --- a/src/variants/FM30_mini/variant.h +++ b/src/variants/FM30_mini/variant_FM30_MINI.h @@ -87,10 +87,10 @@ extern "C" { // Extra HAL modules //#define HAL_DAC_MODULE_ENABLED -#define ALT1 (1 << (STM_PIN_AFNUM_SHIFT+0)) -#define ALT2 (1 << (STM_PIN_AFNUM_SHIFT+1)) -#define ALT3 (1 << (STM_PIN_AFNUM_SHIFT+2)) -#define ALT4 (1 << (STM_PIN_AFNUM_SHIFT+3)) +// #define ALT1 (1 << (STM_PIN_AFNUM_SHIFT+0)) +// #define ALT2 (1 << (STM_PIN_AFNUM_SHIFT+1)) +// #define ALT3 (1 << (STM_PIN_AFNUM_SHIFT+2)) +// #define ALT4 (1 << (STM_PIN_AFNUM_SHIFT+3)) // Adjust IRQ priority #define TIM_IRQ_PRIO 4 diff --git a/src/variants/GHOST_ATTO/variant.cpp b/src/variants/GHOST_ATTO/variant_GHOST_ATTO.cpp similarity index 100% rename from src/variants/GHOST_ATTO/variant.cpp rename to src/variants/GHOST_ATTO/variant_GHOST_ATTO.cpp diff --git a/src/variants/GHOST_ATTO/variant.h b/src/variants/GHOST_ATTO/variant_GHOST_ATTO.h similarity index 100% rename from src/variants/GHOST_ATTO/variant.h rename to src/variants/GHOST_ATTO/variant_GHOST_ATTO.h diff --git a/src/variants/GHOST_TX/variant.cpp b/src/variants/GHOST_TX/variant_GHOST_TX.cpp similarity index 91% rename from src/variants/GHOST_TX/variant.cpp rename to src/variants/GHOST_TX/variant_GHOST_TX.cpp index e95ccb8d06..e24d55383e 100644 --- a/src/variants/GHOST_TX/variant.cpp +++ b/src/variants/GHOST_TX/variant_GHOST_TX.cpp @@ -72,6 +72,23 @@ const PinName digitalPin[] = { PA_14, //D34 - SWCLK }; +// If analog pins are not contiguous in the digitalPin array: +// Add the analogInputPin array without defining NUM_ANALOG_FIRST +// Analog (Ax) pin number array +// where x is the index to retrieve the digital pin number +const uint32_t analogInputPin[] = { + 20, + 21, + 22, + 23, // Not sure about this one beecasue NUM is 9 in the header, and this is RCX + 24, + 25, + 26, + 27, + 28, + 29 +}; + #ifdef __cplusplus } #endif @@ -87,7 +104,7 @@ WEAK void SystemClock_Config(void) RCC_OscInitTypeDef RCC_OscInitStruct; RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_PeriphCLKInitTypeDef PeriphClkInit; + // RCC_PeriphCLKInitTypeDef PeriphClkInit; /**Initializes the CPU, AHB and APB busses clocks */ diff --git a/src/variants/GHOST_TX/variant.h b/src/variants/GHOST_TX/variant_GHOST_TX.h similarity index 100% rename from src/variants/GHOST_TX/variant.h rename to src/variants/GHOST_TX/variant_GHOST_TX.h diff --git a/src/variants/L432K/variant.cpp b/src/variants/L432K/variant_L432KB.cpp similarity index 95% rename from src/variants/L432K/variant.cpp rename to src/variants/L432K/variant_L432KB.cpp index 46e90e12f7..baefab04a9 100644 --- a/src/variants/L432K/variant.cpp +++ b/src/variants/L432K/variant_L432KB.cpp @@ -51,6 +51,20 @@ const PinName digitalPin[] = { PA_15 //D22 - STLink Rx }; +// If analog pins are not contiguous in the digitalPin array: +// Add the analogInputPin array without defining NUM_ANALOG_FIRST +// Analog (Ax) pin number array +// where x is the index to retrieve the digital pin number +const uint32_t analogInputPin[] = { + PA0, + PA1, + PA3, + PA4, + PA5, + PA6, + PA7 +}; + #ifdef __cplusplus } #endif diff --git a/src/variants/L432K/variant.h b/src/variants/L432K/variant_L432KB.h similarity index 100% rename from src/variants/L432K/variant.h rename to src/variants/L432K/variant_L432KB.h diff --git a/src/variants/R9MM/variant.cpp b/src/variants/R9MM/variant_R9MM.cpp similarity index 91% rename from src/variants/R9MM/variant.cpp rename to src/variants/R9MM/variant_R9MM.cpp index c038bd65d7..d7e9325138 100644 --- a/src/variants/R9MM/variant.cpp +++ b/src/variants/R9MM/variant_R9MM.cpp @@ -92,6 +92,27 @@ const PinName digitalPin[] = { PC_5 //D59/A13 = D35 }; +// If analog pins are not contiguous in the digitalPin array: +// Add the analogInputPin array without defining NUM_ANALOG_FIRST +// Analog (Ax) pin number array +// where x is the index to retrieve the digital pin number +const uint32_t analogInputPin[] = { + PA0, + PA1, + PA4, + PB0, + PC1, + PC0, + PA7, + PA6, + PA5, + PC2, + PC3, + PB1, + PC4, + PC5 +}; + #ifdef __cplusplus } #endif @@ -118,8 +139,8 @@ extern "C" { * @param None * @retval None */ - -//64MHZ Internal Clock + +//64MHZ Internal Clock // WEAK void SystemClock_Config(void) // { // RCC_OscInitTypeDef RCC_OscInitStruct; @@ -162,8 +183,8 @@ void SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; - - /** Initializes the CPU, AHB and APB busses clocks + + /** Initializes the CPU, AHB and APB busses clocks */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.HSEState = RCC_HSE_ON; @@ -176,7 +197,7 @@ void SystemClock_Config(void) { Error_Handler(); } - /** Initializes the CPU, AHB and APB busses clocks + /** Initializes the CPU, AHB and APB busses clocks */ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; diff --git a/src/variants/R9MM/variant.h b/src/variants/R9MM/variant_R9MM.h similarity index 100% rename from src/variants/R9MM/variant.h rename to src/variants/R9MM/variant_R9MM.h diff --git a/src/variants/r9mx/variant.cpp b/src/variants/r9mx/variant_R9MX.cpp similarity index 100% rename from src/variants/r9mx/variant.cpp rename to src/variants/r9mx/variant_R9MX.cpp diff --git a/src/variants/r9mx/variant.h b/src/variants/r9mx/variant_R9MX.h similarity index 100% rename from src/variants/r9mx/variant.h rename to src/variants/r9mx/variant_R9MX.h