Skip to content

Commit

Permalink
Re-export Interrupt, NVIC_PRIO_BITS. Feature-gate SysTick definition.
Browse files Browse the repository at this point in the history
This adds two new changes for the `rtic` feature:

1. Re-export the `Interrupt` and `NVIC_PRIO_BITS` as `rtic` requires
   these for generated code related to interrupts.
2. Remove the `SysTick` definition to remove duplicating the `rtic`
   definition.
  • Loading branch information
mitchmindtree committed Jun 29, 2020
1 parent 6471875 commit 1981e22
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ pub mod usb;

pub use hal::ral::interrupt;

// `rtic` expects these in the root.
#[cfg(feature = "rtic")]
pub use hal::ral::{interrupt as Interrupt, NVIC_PRIO_BITS};

pub use cortex_m_rt as rt;
pub use imxrt_hal as hal;

Expand Down Expand Up @@ -351,12 +355,11 @@ pub extern "C" fn delay(millis: u32) {

/// Scoping of data related to SYSTICK
mod systick {
use crate::rt::exception;

#[no_mangle]
static mut systick_millis_count: u32 = 0;

#[exception]
#[cfg(not(feature = "rtic"))]
#[crate::rt::exception]
fn SysTick() {
unsafe {
let ms = core::ptr::read_volatile(&systick_millis_count);
Expand Down

0 comments on commit 1981e22

Please sign in to comment.