update IAP comments, defines

This commit is contained in:
bwisn 2021-11-13 17:30:45 +01:00
parent c0a39bef7b
commit 78bd57f464

View File

@ -21,8 +21,8 @@
#include "ap2_led.h"
#include "protocol.h"
#define MSP_STACK_POINTER 0x20001ffc
#define IAP_MODE 0x0000fab2
#define RAM_MAGIC_LOCATION 0x20001ffc
#define IAP_MAGIC_VALUE 0x0000fab2
static const SerialConfig ledUartInitConfig = {
.speed = 115200,
@ -64,7 +64,9 @@ void bootloader_jump(void) {
wait_ms(15);
// Magic key to set keyboard to IAP
*((uint32_t *)MSP_STACK_POINTER) = IAP_MODE;
// Its 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();