summaryrefslogtreecommitdiff
path: root/keyboards/matrix/m20add
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/matrix/m20add')
-rw-r--r--keyboards/matrix/m20add/bootloader_defs.h5
-rw-r--r--keyboards/matrix/m20add/m20add.c24
-rw-r--r--keyboards/matrix/m20add/rules.mk3
3 files changed, 8 insertions, 24 deletions
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/m20add/m20add.c b/keyboards/matrix/m20add/m20add.c
index 21f4f9b1ba..cdcafb9779 100644
--- a/keyboards/matrix/m20add/m20add.c
+++ b/keyboards/matrix/m20add/m20add.c
@@ -53,28 +53,14 @@ 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)
{
// 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 <this_dir>/boards
BOARD = ST_NUCLEO64_F411RE
+# Bootloader selection
+BOOTLOADER = custom
+
# Build Options
# change yes to no to disable
#