Skip to content

Instantly share code, notes, and snippets.

@stestagg
Last active May 22, 2017 08:22
Show Gist options
  • Save stestagg/0306edfbe95a3ea829bb94829e805f4b to your computer and use it in GitHub Desktop.
Save stestagg/0306edfbe95a3ea829bb94829e805f4b to your computer and use it in GitHub Desktop.
extern fn isr_rtc0();
#[allow(non_upper_case_globals)]
#[link_section=".isr_vector_nvic"]
#[no_mangle]
pub static NVICVectors: [Option<unsafe extern fn()>; ISR_COUNT+1] = [
None,
Some(isr_power_clock),
...
Some(isr_rtc0),
...
];
...
use zinc::hal::cortex_m0::{irq,nvic};
nrf51822::rtc::RTC.set_prescaler(0);
nrf51822::sleep_us(100000);
nrf51822::rtc::RTC.enable_tick_iterrupt();
nvic::enable_irq(11);
nrf51822::rtc::RTC.start();
...,
#[no_mangle]
pub unsafe extern fn isr_rtc0() {
nrf51822::rtc::RTC.clear_tick();
music::tick()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment