From 3bf2403244b035e982dec17680b836afbe5df603 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Thu, 2 Dec 2021 14:32:31 +0000 Subject: Tidy up existing i2c_master implementations (#15376) * Move chibios defines out of header * Make some avr defines internal --- keyboards/matrix/m20add/m20add.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'keyboards/matrix') diff --git a/keyboards/matrix/m20add/m20add.c b/keyboards/matrix/m20add/m20add.c index 21f4f9b1ba..4d328d6c54 100644 --- a/keyboards/matrix/m20add/m20add.c +++ b/keyboards/matrix/m20add/m20add.c @@ -53,25 +53,6 @@ bool led_update_kb(led_t led_state) { return res; } -// override the default implementation to avoid re-initialization -void i2c_init(void) -{ - static bool initialized = false; - if (initialized) { - return; - } else { - initialized = true; - } - - // Try releasing special pins for a short time - palSetLineMode(I2C1_SCL_PIN, PAL_MODE_INPUT); - palSetLineMode(I2C1_SDA_PIN, PAL_MODE_INPUT); - - chThdSleepMilliseconds(10); - palSetLineMode(I2C1_SCL_PIN, PAL_MODE_ALTERNATE(I2C1_SCL_PAL_MODE) | PAL_STM32_OTYPE_OPENDRAIN); - palSetLineMode(I2C1_SDA_PIN, PAL_MODE_ALTERNATE(I2C1_SDA_PAL_MODE) | PAL_STM32_OTYPE_OPENDRAIN); -} - #define REBOOT_MAGIC 0x41544B42 void shutdown_user(void) { -- cgit v1.2.1 From 5fb93934d0f3319547cc6313845fe5a96f8b7798 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 6 Jan 2022 06:55:46 +1100 Subject: Fixes for bootloader refactor build failures (#15638) --- keyboards/matrix/abelx/boards/abelx_bd/board.c | 3 --- keyboards/matrix/abelx/bootloader_defs.h | 7 ------- keyboards/matrix/abelx/rules.mk | 8 -------- keyboards/matrix/m20add/bootloader_defs.h | 5 ----- keyboards/matrix/noah/bootloader_defs.h | 5 ----- 5 files changed, 28 deletions(-) delete mode 100644 keyboards/matrix/abelx/bootloader_defs.h delete mode 100644 keyboards/matrix/m20add/bootloader_defs.h delete mode 100644 keyboards/matrix/noah/bootloader_defs.h (limited to 'keyboards/matrix') diff --git a/keyboards/matrix/abelx/boards/abelx_bd/board.c b/keyboards/matrix/abelx/boards/abelx_bd/board.c index 68cf23cddc..db40a8e37b 100644 --- a/keyboards/matrix/abelx/boards/abelx_bd/board.c +++ b/keyboards/matrix/abelx/boards/abelx_bd/board.c @@ -208,9 +208,6 @@ static void stm32_gpio_init(void) { * else. */ void __early_init(void) { - extern void enter_bootloader_mode_if_requested(void); - enter_bootloader_mode_if_requested(); - stm32_gpio_init(); stm32_clock_init(); } diff --git a/keyboards/matrix/abelx/bootloader_defs.h b/keyboards/matrix/abelx/bootloader_defs.h deleted file mode 100644 index 20b8f73e6f..0000000000 --- a/keyboards/matrix/abelx/bootloader_defs.h +++ /dev/null @@ -1,7 +0,0 @@ -/* Address for jumping to bootloader on STM32 chips. */ -/* It is chip dependent, the correct number can be looked up here: - * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf - * This also requires a patch to chibios: - * /tmk_core/tool/chibios/ch-bootloader-jump.patch - */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000 diff --git a/keyboards/matrix/abelx/rules.mk b/keyboards/matrix/abelx/rules.mk index 98b6cfa65e..ac00984eae 100644 --- a/keyboards/matrix/abelx/rules.mk +++ b/keyboards/matrix/abelx/rules.mk @@ -25,14 +25,6 @@ ARMV = 7 USE_FPU = yes -# Vector table for application -# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ -OPT_DEFS = - -# Options to pass to dfu-util when flashing -#DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave -#DFU_SUFFIX_ARGS = -p DF11 -v 0483 - # Build Options # change yes to no to disable # diff --git a/keyboards/matrix/m20add/bootloader_defs.h b/keyboards/matrix/m20add/bootloader_defs.h deleted file mode 100644 index 4da3d39a32..0000000000 --- a/keyboards/matrix/m20add/bootloader_defs.h +++ /dev/null @@ -1,5 +0,0 @@ -/* Address for jumping to bootloader on STM32 chips. */ -/* It is chip dependent, the correct number can be looked up here: - * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf - */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000 diff --git a/keyboards/matrix/noah/bootloader_defs.h b/keyboards/matrix/noah/bootloader_defs.h deleted file mode 100644 index 4da3d39a32..0000000000 --- a/keyboards/matrix/noah/bootloader_defs.h +++ /dev/null @@ -1,5 +0,0 @@ -/* Address for jumping to bootloader on STM32 chips. */ -/* It is chip dependent, the correct number can be looked up here: - * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf - */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000 -- cgit v1.2.1 From 4f6c0d0ea5eb922d98413f30c1710b7800aa2bd3 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 26 Jan 2022 07:21:08 +1100 Subject: More keyboard rules.mk cleanups (#16044) * More keyboard rules.mk cleanups * Found a couple more --- keyboards/matrix/abelx/rules.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'keyboards/matrix') diff --git a/keyboards/matrix/abelx/rules.mk b/keyboards/matrix/abelx/rules.mk index ac00984eae..d4a065662b 100644 --- a/keyboards/matrix/abelx/rules.mk +++ b/keyboards/matrix/abelx/rules.mk @@ -28,7 +28,7 @@ USE_FPU = yes # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug @@ -36,7 +36,6 @@ COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow -BLUETOOTH_ENABLE = no # Enable Bluetooth AUDIO_ENABLE = no # Audio output NO_USB_STARTUP_CHECK = yes # Disable initialization only when usb is plugged in -- cgit v1.2.1 From a86d6fffc950242f412e05a6a0aed8beede01ba4 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Mon, 7 Feb 2022 14:09:21 +1100 Subject: Fixup bootloaders. (#16256) --- keyboards/matrix/abelx/abelx.c | 5 +++++ keyboards/matrix/abelx/rules.mk | 3 +++ keyboards/matrix/m12og/rev1/rev1.c | 5 +++++ keyboards/matrix/m12og/rev1/rules.mk | 3 +++ keyboards/matrix/m20add/m20add.c | 5 +++++ keyboards/matrix/m20add/rules.mk | 3 +++ keyboards/matrix/noah/noah.c | 5 +++++ keyboards/matrix/noah/rules.mk | 3 +++ 8 files changed, 32 insertions(+) (limited to 'keyboards/matrix') diff --git a/keyboards/matrix/abelx/abelx.c b/keyboards/matrix/abelx/abelx.c index 77e749ee40..9585948e0c 100644 --- a/keyboards/matrix/abelx/abelx.c +++ b/keyboards/matrix/abelx/abelx.c @@ -97,3 +97,8 @@ void shutdown_user(void) // set the magic number for resetting to the bootloader *(uint32_t *)(&(RTCD1.rtc->BKP0R)) = REBOOT_MAGIC; } + +void bootloader_jump(void) { + shutdown_user(); + NVIC_SystemReset(); +} diff --git a/keyboards/matrix/abelx/rules.mk b/keyboards/matrix/abelx/rules.mk index d4a065662b..7a5d01e5cb 100644 --- a/keyboards/matrix/abelx/rules.mk +++ b/keyboards/matrix/abelx/rules.mk @@ -25,6 +25,9 @@ ARMV = 7 USE_FPU = yes +# Bootloader selection +BOOTLOADER = custom + # Build Options # change yes to no to disable # diff --git a/keyboards/matrix/m12og/rev1/rev1.c b/keyboards/matrix/m12og/rev1/rev1.c index e3277bee27..53183c7d2d 100644 --- a/keyboards/matrix/m12og/rev1/rev1.c +++ b/keyboards/matrix/m12og/rev1/rev1.c @@ -20,6 +20,11 @@ void board_init(void) { writePinLow(A8); } +void bootloader_jump(void) { + // This board doesn't use the standard DFU bootloader, and no information is available regarding how to enter bootloader mode. All we can do here is reset. + NVIC_SystemReset(); +} + void keyboard_post_init_kb(void) { rgblight_enable_noeeprom(); rgblight_sethsv_noeeprom(5, 255, 255); diff --git a/keyboards/matrix/m12og/rev1/rules.mk b/keyboards/matrix/m12og/rev1/rules.mk index 0e0584b8c9..d9733e8c5e 100644 --- a/keyboards/matrix/m12og/rev1/rules.mk +++ b/keyboards/matrix/m12og/rev1/rules.mk @@ -5,6 +5,9 @@ MCU_LDSCRIPT = m12og_v1 BOARD = m12og_v1 +# Bootloader selection +BOOTLOADER = custom + # Build Options # change yes to no to disable # diff --git a/keyboards/matrix/m20add/m20add.c b/keyboards/matrix/m20add/m20add.c index 4d328d6c54..cdcafb9779 100644 --- a/keyboards/matrix/m20add/m20add.c +++ b/keyboards/matrix/m20add/m20add.c @@ -59,3 +59,8 @@ void shutdown_user(void) // set the magic number for resetting to the bootloader *(uint32_t *)(&(RTCD1.rtc->BKP0R)) = REBOOT_MAGIC; } + +void bootloader_jump(void) { + shutdown_user(); + NVIC_SystemReset(); +} diff --git a/keyboards/matrix/m20add/rules.mk b/keyboards/matrix/m20add/rules.mk index 1ecbd9d308..86bd6b9371 100644 --- a/keyboards/matrix/m20add/rules.mk +++ b/keyboards/matrix/m20add/rules.mk @@ -10,6 +10,9 @@ MCU_LDSCRIPT = m20add_boot # or /boards BOARD = ST_NUCLEO64_F411RE +# Bootloader selection +BOOTLOADER = custom + # Build Options # change yes to no to disable # diff --git a/keyboards/matrix/noah/noah.c b/keyboards/matrix/noah/noah.c index 2143dee3be..89c25707af 100644 --- a/keyboards/matrix/noah/noah.c +++ b/keyboards/matrix/noah/noah.c @@ -4,6 +4,11 @@ #include "noah.h" +void bootloader_jump(void) { + // This board doesn't use the standard DFU bootloader, and no information is available regarding how to enter bootloader mode. All we can do here is reset. + NVIC_SystemReset(); +} + #ifdef RGBLIGHT_ENABLE #include #include "rgblight.h" diff --git a/keyboards/matrix/noah/rules.mk b/keyboards/matrix/noah/rules.mk index b9f642e8cd..7971d628d6 100644 --- a/keyboards/matrix/noah/rules.mk +++ b/keyboards/matrix/noah/rules.mk @@ -10,6 +10,9 @@ MCU_LDSCRIPT = noah_boot # or /boards BOARD = ST_NUCLEO64_F411RE +# Bootloader selection +BOOTLOADER = custom + # Build Options # change yes to no to disable # -- cgit v1.2.1