dfu: cleanup
This commit is contained in:
parent
2e6116016a
commit
251e4d3dd4
@ -2,10 +2,11 @@ use cortex_m_rt::{pre_init};
|
|||||||
|
|
||||||
const DFU_TRIG_MSG: u32 = 0xDECAFBAD;
|
const DFU_TRIG_MSG: u32 = 0xDECAFBAD;
|
||||||
|
|
||||||
pub unsafe fn set_dfu_trigger() {
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
static mut _dfu_msg: u32;
|
static mut _dfu_msg: u32;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub unsafe fn set_dfu_trigger() {
|
||||||
_dfu_msg = DFU_TRIG_MSG;
|
_dfu_msg = DFU_TRIG_MSG;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -14,10 +15,6 @@ pub unsafe fn set_dfu_trigger() {
|
|||||||
/// bootloader expects MCU to be in reset state when called.
|
/// bootloader expects MCU to be in reset state when called.
|
||||||
#[pre_init]
|
#[pre_init]
|
||||||
unsafe fn __pre_init() {
|
unsafe fn __pre_init() {
|
||||||
extern "C" {
|
|
||||||
static mut _dfu_msg: u32;
|
|
||||||
}
|
|
||||||
|
|
||||||
if _dfu_msg == DFU_TRIG_MSG {
|
if _dfu_msg == DFU_TRIG_MSG {
|
||||||
_dfu_msg = 0x00000000;
|
_dfu_msg = 0x00000000;
|
||||||
|
|
||||||
|
@ -431,7 +431,7 @@ fn main() -> ! {
|
|||||||
unsafe {
|
unsafe {
|
||||||
dfu::set_dfu_trigger();
|
dfu::set_dfu_trigger();
|
||||||
}
|
}
|
||||||
socket.close();
|
|
||||||
SCB::sys_reset();
|
SCB::sys_reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user