File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ cortex-m = "0.6.2"
9
9
cortex-m-rt = " 0.6.12"
10
10
cortex-m-semihosting = " 0.3.5"
11
11
panic-semihosting = " 0.5.3"
12
- nrf52840-pac = " 0.9 .0"
12
+ nrf52840-pac = " 0.8 .0"
13
13
usb-device = " 0.2.5"
14
14
usbd-serial = " 0.1.0"
15
15
16
16
[dependencies .nrf52840-hal ]
17
- version = " 0.10 .0"
17
+ version = " 0.8 .0"
18
18
path = " ../../nrf52840-hal"
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ fn TIMER0() {
24
24
fn main ( ) -> ! {
25
25
static mut EP_BUF : [ u8 ; 512 ] = [ 0 ; 512 ] ;
26
26
27
+ let core = cortex_m:: Peripherals :: take ( ) . unwrap ( ) ;
27
28
let periph = Peripherals :: take ( ) . unwrap ( ) ;
28
29
while !periph
29
30
. POWER
@@ -45,6 +46,7 @@ fn main() -> ! {
45
46
let clocks = Clocks :: new ( periph. CLOCK ) ;
46
47
let clocks = clocks. enable_ext_hfosc ( ) ;
47
48
49
+ let mut nvic = core. NVIC ;
48
50
let mut timer = Timer :: one_shot ( periph. TIMER0 ) ;
49
51
let usbd = periph. USBD ;
50
52
let p0 = p0:: Parts :: new ( periph. P0 ) ;
@@ -54,7 +56,7 @@ fn main() -> ! {
54
56
let btn = p1. p1_00 . into_pullup_input ( ) ;
55
57
while btn. is_high ( ) . unwrap ( ) { }
56
58
57
- timer. enable_interrupt ( ) ;
59
+ timer. enable_interrupt ( Some ( & mut nvic ) ) ;
58
60
timer. start ( Timer :: < TIMER0 , OneShot > :: TICKS_PER_SECOND * 3 ) ;
59
61
60
62
led. set_low ( ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments