Skip to content

Commit f9f9897

Browse files
deps(grand_central_m4)!: Update HAL to v0.21.3
PR: #897 * upgrade library versions * Update eic interface
1 parent d460b68 commit f9f9897

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

boards/grand_central_m4/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ version = "0.7"
1515
optional = true
1616

1717
[dependencies.atsamd-hal]
18-
version = "0.19.0"
18+
version = "0.21.3"
1919
default-features = false
2020

2121
[dependencies.usb-device]
@@ -29,8 +29,8 @@ features = ["critical-section-single-core"]
2929
[dev-dependencies]
3030
cortex-m = "0.7"
3131
usbd-serial = "0.2"
32-
panic-halt = "0.2"
33-
panic-semihosting = "0.5"
32+
panic-halt = "1.0.0"
33+
panic-semihosting = "0.6"
3434
smart-leds = "0.3"
3535
ws2812-timer-delay = "0.3"
3636

@@ -40,6 +40,7 @@ dma = ["atsamd-hal/dma"]
4040
max-channels = ["dma", "atsamd-hal/max-channels"]
4141
rt = ["cortex-m-rt", "atsamd-hal/samd51p-rt"]
4242
usb = ["atsamd-hal/usb", "usb-device"]
43+
use_semihosting = []
4344

4445
# for cargo flash
4546
[package.metadata]

boards/grand_central_m4/examples/eic.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ use grand_central_m4 as bsp;
1919
use bsp::entry;
2020
use hal::clock::GenericClockController;
2121
use hal::delay::Delay;
22-
use hal::eic::{
23-
self,
24-
pin::{ExtInt6, ExternalInterrupt, Sense},
25-
};
22+
use hal::eic::{Eic, Sense};
2623
use hal::gpio::{Pin, PullUpInterrupt};
2724
use hal::prelude::*;
2825
use pac::{interrupt, CorePeripherals, Peripherals};
@@ -65,13 +62,13 @@ fn main() -> ! {
6562

6663
let gclk0 = clocks.gclk0();
6764
let eic_clock = clocks.eic(&gclk0).unwrap();
68-
let mut eic = eic::init_with_ulp32k(&mut peripherals.mclk, eic_clock, peripherals.eic);
65+
let eic = Eic::new(&mut peripherals.mclk, eic_clock, peripherals.eic);
66+
let eic_channels = eic.split();
6967
let button: Pin<_, PullUpInterrupt> = pins.d46.into();
70-
eic.button_debounce_pins(&[button.id()]);
71-
let mut extint_button = ExtInt6::new(button);
72-
extint_button.sense(&mut eic, Sense::Both);
73-
extint_button.enable_interrupt(&mut eic);
74-
eic.finalize();
68+
69+
let mut extint = eic_channels.6.with_pin(button);
70+
extint.sense(Sense::Both);
71+
extint.enable_interrupt();
7572

7673
// Enable EIC interrupt in the NVIC
7774
unsafe {

0 commit comments

Comments
 (0)