blob: fe2f6be3973a04cbe4c57f8b2f55c39883b242b1 [file] [log] [blame]
#include <stdint.h>
#include "cape/bootloader_handoff.h"
// Sets everything up and then jumps to the main code.
static void jump_to_main(void) __attribute__((noreturn));
static void jump_to_main(void) {
__asm__ __volatile__(
"mov sp, %[stack]\n\t"
"bx %[reset]" : :
[stack]"r"(RAM_START + RAM_SIZE), [reset]"r"(MAIN_FLASH_START | 1)
: "memory");
__builtin_unreachable();
}
void _start(void) {
jump_to_main();
}