Skip to content

Commit

Permalink
Add back _reset
Browse files Browse the repository at this point in the history
  • Loading branch information
jcsoo committed Jul 17, 2017
1 parent 40c9651 commit 8164246
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
18 changes: 9 additions & 9 deletions onebit-elle0/src/exceptions.rs
Expand Up @@ -4,15 +4,15 @@ pub unsafe extern "C" fn default_handler_entry_point() -> ! {
loop {}
}

// #[doc(hidden)]
// #[export_name = "_reset"]
// pub unsafe extern "C" fn reset() -> ! {
// extern "C" {
// fn main();
// }
// main();
// loop {}
// }
#[doc(hidden)]
#[export_name = "_reset"]
pub unsafe extern "C" fn reset() -> ! {
extern "C" {
fn main();
}
main();
loop {}
}

pub type Handler = unsafe extern "C" fn();

Expand Down
5 changes: 2 additions & 3 deletions onebit-elle0/src/main.rs
Expand Up @@ -16,9 +16,8 @@ pub const RCC_AHB1ENR: *mut u32 = 0x4002_3830 as *mut u32;
pub const GPIOA_MODER: *mut u32 = 0x4002_0000 as *mut u32;
pub const GPIOA_BSRR: *mut u32 = 0x4002_0018 as *mut u32;

#[doc(hidden)]
#[export_name = "_reset"]
pub extern "C" fn reset() -> ! {
#[no_mangle]
pub extern "C" fn main() -> ! {
unsafe {
// Enable GPIOA
ptr::write_volatile(RCC_AHB1ENR, ptr::read_volatile(RCC_AHB1ENR) | 1 << 0);
Expand Down

0 comments on commit 8164246

Please sign in to comment.