diff options
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/lib.rs b/src/lib.rs index 9899564d8..4e5ac0109 100644 --- a/src/lib.rs +++ b/src/lib.rs | |||
| @@ -62,29 +62,29 @@ pub fn init(cfg: crate::config::Config) -> Peripherals { | |||
| 62 | peripherals | 62 | peripherals |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | /// Optional hook called by cortex-m-rt before RAM init. | 65 | // /// Optional hook called by cortex-m-rt before RAM init. |
| 66 | /// We proactively mask and clear all NVIC IRQs to avoid wedges from stale state | 66 | // /// We proactively mask and clear all NVIC IRQs to avoid wedges from stale state |
| 67 | /// left by soft resets/debug sessions. | 67 | // /// left by soft resets/debug sessions. |
| 68 | /// | 68 | // /// |
| 69 | /// NOTE: Manual VTOR setup is required for RAM execution. The cortex-m-rt 'set-vtor' | 69 | // /// NOTE: Manual VTOR setup is required for RAM execution. The cortex-m-rt 'set-vtor' |
| 70 | /// feature is incompatible with our setup because it expects __vector_table to be | 70 | // /// feature is incompatible with our setup because it expects __vector_table to be |
| 71 | /// defined differently than how our RAM-based linker script arranges it. | 71 | // /// defined differently than how our RAM-based linker script arranges it. |
| 72 | #[no_mangle] | 72 | // #[no_mangle] |
| 73 | pub unsafe extern "C" fn __pre_init() { | 73 | // pub unsafe extern "C" fn __pre_init() { |
| 74 | // Set the VTOR to point to the interrupt vector table in RAM | 74 | // // Set the VTOR to point to the interrupt vector table in RAM |
| 75 | // This is required since code runs from RAM on this MCU | 75 | // // This is required since code runs from RAM on this MCU |
| 76 | crate::interrupt::vtor_set_ram_vector_base(0x2000_0000 as *const u32); | 76 | // crate::interrupt::vtor_set_ram_vector_base(0x2000_0000 as *const u32); |
| 77 | 77 | ||
| 78 | // Mask and clear pending for all NVIC lines (0..127) to avoid stale state across runs. | 78 | // // Mask and clear pending for all NVIC lines (0..127) to avoid stale state across runs. |
| 79 | let nvic = &*cortex_m::peripheral::NVIC::PTR; | 79 | // let nvic = &*cortex_m::peripheral::NVIC::PTR; |
| 80 | for i in 0..4 { | 80 | // for i in 0..4 { |
| 81 | // 4 words x 32 = 128 IRQs | 81 | // // 4 words x 32 = 128 IRQs |
| 82 | nvic.icer[i].write(0xFFFF_FFFF); | 82 | // nvic.icer[i].write(0xFFFF_FFFF); |
| 83 | nvic.icpr[i].write(0xFFFF_FFFF); | 83 | // nvic.icpr[i].write(0xFFFF_FFFF); |
| 84 | } | 84 | // } |
| 85 | // Do NOT touch peripheral registers here: clocks may be off and accesses can fault. | 85 | // // Do NOT touch peripheral registers here: clocks may be off and accesses can fault. |
| 86 | crate::interrupt::clear_default_handler_snapshot(); | 86 | // crate::interrupt::clear_default_handler_snapshot(); |
| 87 | } | 87 | // } |
| 88 | 88 | ||
| 89 | /// Internal helper to dispatch a type-level interrupt handler. | 89 | /// Internal helper to dispatch a type-level interrupt handler. |
| 90 | #[inline(always)] | 90 | #[inline(always)] |
