We now disable interrupts before jumping to application,
as overwriting the VTOR with interrupts enabled is rather risky.
Also don't assume that interrupts are enabled when the bootloader
is run -- enable them explicitly when we need them.
type Reg32 = register::Register<u32>;
extern {
+ fn enable_interrupts();
+ fn disable_interrupts();
+
fn jump_to_application(address: u32);
}
port::set_af(port::PORTE, 24, 1);
port::set_pull(port::PORTE, 24, port::Pull::Up);
+ enable_interrupts();
+
if application_missing() || bootloader_requested() {
usb_serial::init(0xf055, USB_PID);
usb_serial::shutdown();
}
+ disable_interrupts();
+
jump_to_application(APPLICATION_ADDR);
}