Skip to content

Commit

Permalink
update bootloader
Browse files Browse the repository at this point in the history
  • Loading branch information
bwisn committed Mar 6, 2022
1 parent 0cc83e4 commit 240745d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 24 deletions.
24 changes: 0 additions & 24 deletions keyboards/annepro2/annepro2.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
#include "ap2_led.h"
#include "protocol.h"

#define RAM_MAGIC_LOCATION 0x20001ffc
#define IAP_MAGIC_VALUE 0x0000fab2

static const SerialConfig ledUartInitConfig = {
.speed = 115200,
};
Expand All @@ -44,27 +41,6 @@ static uint8_t ledMcuWakeup[11] = {0x7b, 0x10, 0x43, 0x10, 0x03, 0x00, 0x00, 0x7

ble_capslock_t BLECapsLock = {._dummy = {0}, .caps_lock = false};

void bootloader_jump(void) {
// Send msg to shine to boot into IAP
annepro2SetIAP();

// wait for shine to boot into IAP
wait_ms(15);

// Load ble into IAP
annepro2_ble_bootload();
wait_ms(15);

// Magic key to set keyboard to IAP
// It’s from reversing original boot loader
// If value is that it stays in boot loader aka IAP
*((uint32_t *)RAM_MAGIC_LOCATION) = IAP_MAGIC_VALUE;

// Load the main MCU into IAP
__disable_irq();
NVIC_SystemReset();
}

void keyboard_pre_init_kb(void) {
// Start LED UART
sdStart(&SD0, &ledUartInitConfig);
Expand Down
2 changes: 2 additions & 0 deletions keyboards/annepro2/c15/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ MCU_STARTUP = ht32f523xx

BOARD = ANNEPRO2_C15

BOOTLOADER=annepro2

# Options

# Keys
Expand Down
2 changes: 2 additions & 0 deletions keyboards/annepro2/c18/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ MCU_STARTUP = ht32f523xx

BOARD = ANNEPRO2_C18

BOOTLOADER=annepro2

# Options

# Keys
Expand Down

0 comments on commit 240745d

Please sign in to comment.