Skip to content

Commit 6003c00

Browse files
committed
Merge upstream
2 parents 064850e + 70d34ae commit 6003c00

File tree

17 files changed

+509
-258
lines changed

17 files changed

+509
-258
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
build:
1010
runs-on: ubuntu-latest
11-
timeout-minutes: 10
11+
timeout-minutes: 30
1212
continue-on-error: ${{ matrix.rust_version == 'nightly' }}
1313

1414
steps:
@@ -34,7 +34,12 @@ jobs:
3434
thumbv8m.main-none-eabi
3535
- name: Build Crates
3636
run: cargo test -p xtask
37+
env:
38+
RUSTFLAGS: ${{ matrix.rustflags }}
3739

3840
strategy:
3941
matrix:
40-
rust_version: [stable, beta, nightly]
42+
rust_version: [beta, nightly]
43+
include:
44+
- rust_version: stable
45+
rustflags: --deny warnings

CHANGELOG.md

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,42 @@
1010
- LPCOMP module ([#195]).
1111
- TWIS module ([#196]).
1212
- PWM module ([#200]).
13-
- I2S module ([#201]).
14-
- SPIS module ([#226]).
13+
- I2S module ([#201] [#209] [#225] [#237]).
14+
- SPIS module ([#226] [#236]).
1515
- Add support for the nRF52811 ([#227]).
16+
- Add PPI channel group tasks ([#212]).
17+
- Add PPI endpoints for timers ([#239]).
18+
19+
### Enhancements
20+
21+
- Improve SAADC docs ([#218]).
22+
- Update Embed.toml of all examples to new defaults ([#229]).
23+
- Make `ConfigurablePpi` and subtrait of `Ppi` ([#244]).
1624

1725
### Fixes
1826

1927
- Refuse to build nRF52+ HALs for thumbv6m targets ([#203]).
2028
- Refuse to build `nrf52810-hal` for hard-float targets, and `nrf51-hal` for thumbv7+ targets
2129
([#206]).
22-
- GPIOTE Port 1 and 0 differentiation for nRF52833 and nRF52840 ([#217])
30+
- Set the correct Port in GPIOTE ([#217] [#248]).
2331
- Correct TWIM port initialization for P1 pins ([#221]).
32+
- Fix race condition in RTC event handling ([#243]).
2433

2534
### Breaking Changes
2635

27-
- Remove `Spi::read` ([#190]).
36+
- Remove `Spi::read` in favor of `transfer_split_uneven` ([#190]).
2837
- Seal the `timer::Instance` trait ([#214]).
29-
- Make GPIOs start in a `Disconnected` state instead of `Input<Floating>` ([#220]).
38+
- Make GPIOs start in a `Disconnected` state instead of `Input<Floating>` ([#220] [#245]).
39+
- 🦭 all `Instance` traits ([#255]).
40+
- 🦭 PPI traits ([#259]).
41+
- Various TWIM fixes and improvements - removes automatic transfer splitting ([#242]).
42+
- Remove typestate from RTC to make it easier to use ([#252]).
43+
- Also return owned `Pins` from `Usart::free()` ([#261]).
44+
45+
### Internal Improvements
46+
47+
- Utilize [`cargo-xtask`] to simplify CI and the release process ([#207] [#210]).
48+
- Add `conf()` utility function to reduce code duplication in GPIO ([#250]).
3049

3150
[#185]: https://github.com/nrf-rs/nrf-hal/pull/185
3251
[#188]: https://github.com/nrf-rs/nrf-hal/pull/188
@@ -36,12 +55,35 @@
3655
[#200]: https://github.com/nrf-rs/nrf-hal/pull/200
3756
[#201]: https://github.com/nrf-rs/nrf-hal/pull/201
3857
[#203]: https://github.com/nrf-rs/nrf-hal/pull/203
58+
[#209]: https://github.com/nrf-rs/nrf-hal/pull/209
3959
[#190]: https://github.com/nrf-rs/nrf-hal/pull/190
4060
[#206]: https://github.com/nrf-rs/nrf-hal/pull/206
61+
[#207]: https://github.com/nrf-rs/nrf-hal/pull/207
62+
[#210]: https://github.com/nrf-rs/nrf-hal/pull/210
63+
[#212]: https://github.com/nrf-rs/nrf-hal/pull/212
4164
[#217]: https://github.com/nrf-rs/nrf-hal/pull/217
4265
[#214]: https://github.com/nrf-rs/nrf-hal/pull/214
66+
[#218]: https://github.com/nrf-rs/nrf-hal/pull/218
4367
[#220]: https://github.com/nrf-rs/nrf-hal/pull/220
4468
[#221]: https://github.com/nrf-rs/nrf-hal/pull/221
69+
[#225]: https://github.com/nrf-rs/nrf-hal/pull/225
70+
[#226]: https://github.com/nrf-rs/nrf-hal/pull/226
71+
[#227]: https://github.com/nrf-rs/nrf-hal/pull/227
72+
[#229]: https://github.com/nrf-rs/nrf-hal/pull/229
73+
[#236]: https://github.com/nrf-rs/nrf-hal/pull/236
74+
[#237]: https://github.com/nrf-rs/nrf-hal/pull/237
75+
[#239]: https://github.com/nrf-rs/nrf-hal/pull/239
76+
[#242]: https://github.com/nrf-rs/nrf-hal/pull/242
77+
[#243]: https://github.com/nrf-rs/nrf-hal/pull/243
78+
[#244]: https://github.com/nrf-rs/nrf-hal/pull/244
79+
[#245]: https://github.com/nrf-rs/nrf-hal/pull/245
80+
[#248]: https://github.com/nrf-rs/nrf-hal/pull/248
81+
[#250]: https://github.com/nrf-rs/nrf-hal/pull/250
82+
[#252]: https://github.com/nrf-rs/nrf-hal/pull/252
83+
[#255]: https://github.com/nrf-rs/nrf-hal/pull/255
84+
[#259]: https://github.com/nrf-rs/nrf-hal/pull/259
85+
[#261]: https://github.com/nrf-rs/nrf-hal/pull/261
86+
[`cargo-xtask`]: https://github.com/matklad/cargo-xtask
4587

4688
## [0.11.1]
4789

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ Please refer to the [changelog] to see what changed in the last releases.
1414

1515
Every nRF chip has its own crate, listed below:
1616

17-
| Crate | Docs | crates.io |
18-
|-------|------|-----------|
19-
| [`nrf51-hal`](./nrf51-hal) | [![docs.rs](https://docs.rs/nrf51-hal/badge.svg)](https://docs.rs/nrf51-hal) | [![crates.io](https://img.shields.io/crates/d/nrf51-hal.svg)](https://crates.io/crates/nrf51-hal) |
20-
| [`nrf52810-hal`](./nrf52810-hal) | [![docs.rs](https://docs.rs/nrf52810-hal/badge.svg)](https://docs.rs/nrf52810-hal) | [![crates.io](https://img.shields.io/crates/d/nrf52810-hal.svg)](https://crates.io/crates/nrf52810-hal) |
21-
| [`nrf52811-hal`](./nrf52811-hal) | [![docs.rs](https://docs.rs/nrf52811-hal/badge.svg)](https://docs.rs/nrf52811-hal) | [![crates.io](https://img.shields.io/crates/d/nrf52811-hal.svg)](https://crates.io/crates/nrf52811-hal) |
22-
| [`nrf52832-hal`](./nrf52832-hal) | [![docs.rs](https://docs.rs/nrf52832-hal/badge.svg)](https://docs.rs/nrf52832-hal) | [![crates.io](https://img.shields.io/crates/d/nrf52832-hal.svg)](https://crates.io/crates/nrf52832-hal) |
23-
| [`nrf52833-hal`](./nrf52833-hal) | [![docs.rs](https://docs.rs/nrf52833-hal/badge.svg)](https://docs.rs/nrf52833-hal) | [![crates.io](https://img.shields.io/crates/d/nrf52833-hal.svg)](https://crates.io/crates/nrf52833-hal) |
24-
| [`nrf52840-hal`](./nrf52840-hal) | [![docs.rs](https://docs.rs/nrf52840-hal/badge.svg)](https://docs.rs/nrf52840-hal) | [![crates.io](https://img.shields.io/crates/d/nrf52840-hal.svg)](https://crates.io/crates/nrf52840-hal) |
25-
| [`nrf9160-hal`](./nrf9160-hal) | [![docs.rs](https://docs.rs/nrf9160-hal/badge.svg)](https://docs.rs/nrf9160-hal) | [![crates.io](https://img.shields.io/crates/d/nrf9160-hal.svg)](https://crates.io/crates/nrf9160-hal) |
17+
| Crate | Docs | crates.io | target |
18+
|-------|------|-----------|--------|
19+
| [`nrf51-hal`](./nrf51-hal) | [![docs.rs](https://docs.rs/nrf51-hal/badge.svg)](https://docs.rs/nrf51-hal) | [![crates.io](https://img.shields.io/crates/d/nrf51-hal.svg)](https://crates.io/crates/nrf51-hal) | `thumbv6m-none-eabi` |
20+
| [`nrf52810-hal`](./nrf52810-hal) | [![docs.rs](https://docs.rs/nrf52810-hal/badge.svg)](https://docs.rs/nrf52810-hal) | [![crates.io](https://img.shields.io/crates/d/nrf52810-hal.svg)](https://crates.io/crates/nrf52810-hal) | `thumbv7em-none-eabi` |
21+
| [`nrf52811-hal`](./nrf52811-hal) | [![docs.rs](https://docs.rs/nrf52811-hal/badge.svg)](https://docs.rs/nrf52811-hal) | [![crates.io](https://img.shields.io/crates/d/nrf52811-hal.svg)](https://crates.io/crates/nrf52811-hal) | `thumbv7em-none-eabi` |
22+
| [`nrf52832-hal`](./nrf52832-hal) | [![docs.rs](https://docs.rs/nrf52832-hal/badge.svg)](https://docs.rs/nrf52832-hal) | [![crates.io](https://img.shields.io/crates/d/nrf52832-hal.svg)](https://crates.io/crates/nrf52832-hal) | `thumbv7em-none-eabihf` |
23+
| [`nrf52833-hal`](./nrf52833-hal) | [![docs.rs](https://docs.rs/nrf52833-hal/badge.svg)](https://docs.rs/nrf52833-hal) | [![crates.io](https://img.shields.io/crates/d/nrf52833-hal.svg)](https://crates.io/crates/nrf52833-hal) | `thumbv7em-none-eabihf` |
24+
| [`nrf52840-hal`](./nrf52840-hal) | [![docs.rs](https://docs.rs/nrf52840-hal/badge.svg)](https://docs.rs/nrf52840-hal) | [![crates.io](https://img.shields.io/crates/d/nrf52840-hal.svg)](https://crates.io/crates/nrf52840-hal) | `thumbv7em-none-eabihf` |
25+
| [`nrf9160-hal`](./nrf9160-hal) | [![docs.rs](https://docs.rs/nrf9160-hal/badge.svg)](https://docs.rs/nrf9160-hal) | [![crates.io](https://img.shields.io/crates/d/nrf9160-hal.svg)](https://crates.io/crates/nrf9160-hal) | `thumbv8m.main-none-eabihf` |
2626

2727
## Device Reference Manuals from Nordic
2828

examples/pwm-demo/src/main.rs

Lines changed: 54 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ pub enum AppStatus {
3232
Demo4,
3333
}
3434

35+
type SeqBuffer = &'static mut [u16; 48];
36+
3537
#[rtic::app(device = crate::hal::pac, peripherals = true, monotonic = rtic::cyccnt::CYCCNT)]
3638
const APP: () = {
3739
struct Resources {
@@ -40,13 +42,16 @@ const APP: () = {
4042
btn2: Pin<Input<PullUp>>,
4143
btn3: Pin<Input<PullUp>>,
4244
btn4: Pin<Input<PullUp>>,
43-
pwm: Pwm<PWM0>,
4445
#[init(AppStatus::Idle)]
4546
status: AppStatus,
47+
pwm: Option<PwmSeq<PWM0, SeqBuffer, SeqBuffer>>,
4648
}
4749

4850
#[init]
4951
fn init(mut ctx: init::Context) -> init::LateResources {
52+
static mut BUF0: [u16; 48] = [0u16; 48];
53+
static mut BUF1: [u16; 48] = [0u16; 48];
54+
5055
let _clocks = hal::clocks::Clocks::new(ctx.device.CLOCK).enable_ext_hfosc();
5156
ctx.core.DCB.enable_trace();
5257
ctx.core.DWT.enable_cycle_counter();
@@ -84,7 +89,7 @@ const APP: () = {
8489
btn2,
8590
btn3,
8691
btn4,
87-
pwm,
92+
pwm: pwm.load(Some(BUF0), Some(BUF1), false).ok(),
8893
}
8994
}
9095

@@ -98,29 +103,30 @@ const APP: () = {
98103

99104
#[task(binds = PWM0, resources = [pwm])]
100105
fn on_pwm(ctx: on_pwm::Context) {
101-
let pwm = ctx.resources.pwm;
102-
if pwm.is_event_triggered(PwmEvent::Stopped) {
103-
pwm.reset_event(PwmEvent::Stopped);
106+
let pwm_seq = ctx.resources.pwm.as_ref().unwrap();
107+
if pwm_seq.is_event_triggered(PwmEvent::Stopped) {
108+
pwm_seq.reset_event(PwmEvent::Stopped);
104109
rprintln!("PWM generation was stopped");
105110
}
106111
}
107112

108113
#[task(binds = GPIOTE, resources = [gpiote], schedule = [debounce])]
109114
fn on_gpiote(ctx: on_gpiote::Context) {
110115
ctx.resources.gpiote.reset_events();
111-
ctx.schedule.debounce(ctx.start + 3_000_000.cycles()).ok();
116+
ctx.schedule.debounce(ctx.start + 2_500_000.cycles()).ok();
112117
}
113118

114119
#[task(resources = [btn1, btn2, btn3, btn4, pwm, status])]
115120
fn debounce(ctx: debounce::Context) {
116-
static mut BUF: [u16; 48] = [0u16; 48];
117-
let status = ctx.resources.status;
121+
let (buf0, buf1, pwm) = ctx.resources.pwm.take().unwrap().split();
122+
let BUF0 = buf0.unwrap();
123+
let BUF1 = buf1.unwrap();
118124

119-
let pwm = ctx.resources.pwm;
120125
let max_duty = pwm.max_duty();
121126
let (ch0, ch1, ch2, ch3) = pwm.split_channels();
122127
let (grp0, grp1) = pwm.split_groups();
123128

129+
let status = ctx.resources.status;
124130
if ctx.resources.btn1.is_low().unwrap() {
125131
match status {
126132
AppStatus::Demo1B => {
@@ -143,68 +149,65 @@ const APP: () = {
143149
pwm.set_duty_on_common(max_duty / 10);
144150
}
145151
}
146-
}
147-
if ctx.resources.btn2.is_low().unwrap() {
152+
*ctx.resources.pwm = pwm.load(Some(BUF0), Some(BUF1), false).ok();
153+
} else if ctx.resources.btn2.is_low().unwrap() {
148154
match status {
149155
AppStatus::Demo2B => {
150156
rprintln!("DEMO 2C: Play grouped sequence 4 times");
151157
*status = AppStatus::Demo2C;
152158
let ampl = max_duty as i32 / 20;
153-
let len: usize = 12;
159+
let len: usize = BUF0.len() / 2;
154160
// In `Grouped` mode, each step consists of two values [G0, G1]
155161
for x in 0..len {
156-
BUF[x * 2] = triangle_wave(x, len, ampl, 6, 0) as u16;
157-
BUF[x * 2 + 1] = triangle_wave(x, len, ampl, 0, 0) as u16;
162+
BUF0[x * 2] = triangle_wave(x, len, ampl, 6, 0) as u16;
163+
BUF0[x * 2 + 1] = triangle_wave(x, len, ampl, 0, 0) as u16;
158164
}
165+
BUF1.copy_from_slice(&BUF0[..]);
159166
pwm.set_load_mode(LoadMode::Grouped)
160167
.set_step_mode(StepMode::Auto)
161-
.set_seq_refresh(Seq::Seq0, 70) // Playback rate (periods per step)
162-
.set_seq_refresh(Seq::Seq1, 30)
168+
.set_seq_refresh(Seq::Seq0, 30) // Playback rate (periods per step)
169+
.set_seq_refresh(Seq::Seq1, 10)
163170
.repeat(4);
164-
pwm.load_seq(Seq::Seq0, &BUF[..len]).ok();
165-
pwm.load_seq(Seq::Seq1, &BUF[len..(2 * len)]).ok();
166-
pwm.start_seq(Seq::Seq0);
171+
*ctx.resources.pwm = pwm.load(Some(BUF0), Some(BUF1), true).ok();
167172
}
168173
AppStatus::Demo2A => {
169174
rprintln!("DEMO 2B: Loop individual sequences");
170175
*status = AppStatus::Demo2B;
171176
let ampl = max_duty as i32 / 5;
172177
let offset = max_duty as i32 / 300;
173-
let len = 12;
178+
let len = BUF0.len() / 4;
174179
// In `Individual` mode, each step consists of four values [C0, C1, C2, C3]
175180
for x in 0..len {
176-
BUF[4 * x] = triangle_wave(x, len, ampl, 0, offset) as u16;
177-
BUF[4 * x + 1] = triangle_wave(x, len, ampl, 3, offset) as u16;
178-
BUF[4 * x + 2] = triangle_wave(x, len, ampl, 6, offset) as u16;
179-
BUF[4 * x + 3] = triangle_wave(x, len, ampl, 9, offset) as u16;
181+
BUF0[4 * x] = triangle_wave(x, len, ampl, 0, offset) as u16;
182+
BUF0[4 * x + 1] = triangle_wave(x, len, ampl, 3, offset) as u16;
183+
BUF0[4 * x + 2] = triangle_wave(x, len, ampl, 6, offset) as u16;
184+
BUF0[4 * x + 3] = triangle_wave(x, len, ampl, 9, offset) as u16;
180185
}
186+
BUF1.copy_from_slice(&BUF0[..]);
181187
pwm.set_load_mode(LoadMode::Individual)
182188
.set_seq_refresh(Seq::Seq0, 30)
183189
.set_seq_refresh(Seq::Seq1, 30)
184190
.loop_inf();
185-
pwm.load_seq(Seq::Seq0, &BUF[..(4 * len)]).ok();
186-
pwm.load_seq(Seq::Seq1, &BUF[..(4 * len)]).ok();
187-
pwm.start_seq(Seq::Seq0);
191+
*ctx.resources.pwm = pwm.load(Some(BUF0), Some(BUF1), true).ok();
188192
}
189193
_ => {
190194
rprintln!("DEMO 2A: Play common sequence once");
191195
*status = AppStatus::Demo2A;
192-
let len = 10;
196+
let len = BUF0.len();
193197
// In `Common` mode, each step consists of one value for all channels.
194198
for x in 0..len {
195-
BUF[x] = triangle_wave(x, len, 2000, 0, 100) as u16;
199+
BUF0[x] = triangle_wave(x, len, 2000, 0, 100) as u16;
196200
}
201+
BUF1.copy_from_slice(&BUF0[..]);
197202
pwm.set_load_mode(LoadMode::Common)
198203
.set_step_mode(StepMode::Auto)
199-
.set_seq_refresh(Seq::Seq0, 50)
200-
.one_shot()
201-
.load_seq(Seq::Seq0, &BUF[..len])
202-
.ok();
203-
pwm.start_seq(Seq::Seq0);
204+
.set_seq_refresh(Seq::Seq0, 20)
205+
.set_seq_refresh(Seq::Seq1, 20)
206+
.one_shot();
207+
*ctx.resources.pwm = pwm.load(Some(BUF0), Some(BUF1), true).ok();
204208
}
205209
}
206-
}
207-
if ctx.resources.btn3.is_low().unwrap() {
210+
} else if ctx.resources.btn3.is_low().unwrap() {
208211
match status {
209212
AppStatus::Demo3 => {
210213
rprintln!("DEMO 3: Next step");
@@ -215,46 +218,46 @@ const APP: () = {
215218
pwm.stop();
216219
*status = AppStatus::Idle;
217220
}
221+
*ctx.resources.pwm = pwm.load(Some(BUF0), Some(BUF1), false).ok();
218222
}
219223
_ => {
220224
rprintln!("DEMO 3: Manually step through sequence");
221225
*status = AppStatus::Demo3;
222226
let amplitude = max_duty as i32 / 20;
223227
let offset = max_duty as i32 / 300;
224-
let len = 6;
228+
let len = BUF0.len();
225229
for x in 0..len {
226-
BUF[x] = triangle_wave(x, len, amplitude, 0, offset) as u16;
230+
BUF0[x] = triangle_wave(x * 8, len, amplitude, 0, offset) as u16;
227231
}
232+
BUF1.copy_from_slice(&BUF0[..]);
228233
pwm.set_load_mode(LoadMode::Common)
229234
.set_step_mode(StepMode::NextStep)
230235
.loop_inf();
231-
pwm.load_seq(Seq::Seq0, &BUF[..(len / 2)]).ok();
232-
pwm.load_seq(Seq::Seq1, &BUF[(len / 2)..len]).ok();
233-
pwm.start_seq(Seq::Seq0);
236+
*ctx.resources.pwm = pwm.load(Some(BUF0), Some(BUF1), true).ok();
234237
}
235238
}
236-
}
237-
if ctx.resources.btn4.is_low().unwrap() {
239+
} else if ctx.resources.btn4.is_low().unwrap() {
238240
rprintln!("DEMO 4: Waveform mode");
239241
*status = AppStatus::Demo4;
240-
let len = 12;
242+
let len = BUF0.len() / 4;
241243
// In `Waveform` mode, each step consists of four values [C0, C1, C2, MAX_DUTY]
242244
// So the maximum duty cycle can be set on a per step basis, affecting the PWM frequency
243245
for x in 0..len {
244246
let current_max = x * 2_200 + 5_000;
245-
BUF[4 * x] = ((x % 3) * current_max / (5 * (x + 1))) as u16;
246-
BUF[4 * x + 1] = (((x + 1) % 3) * current_max / (5 * (x + 1))) as u16;
247-
BUF[4 * x + 2] = (((x + 2) % 3) * current_max / (5 * (x + 1))) as u16;
248-
BUF[4 * x + 3] = current_max as u16;
247+
BUF0[4 * x] = ((x % 3) * current_max / (5 * (x + 1))) as u16;
248+
BUF0[4 * x + 1] = (((x + 1) % 3) * current_max / (5 * (x + 1))) as u16;
249+
BUF0[4 * x + 2] = (((x + 2) % 3) * current_max / (5 * (x + 1))) as u16;
250+
BUF0[4 * x + 3] = current_max as u16;
249251
}
252+
BUF1.copy_from_slice(&BUF0[..]);
250253
pwm.set_load_mode(LoadMode::Waveform)
251254
.set_step_mode(StepMode::Auto)
252255
.set_seq_refresh(Seq::Seq0, 150)
253256
.set_seq_refresh(Seq::Seq1, 150)
254257
.loop_inf();
255-
pwm.load_seq(Seq::Seq0, &BUF[..(4 * len)]).ok();
256-
pwm.load_seq(Seq::Seq1, &BUF[..(4 * len)]).ok();
257-
pwm.start_seq(Seq::Seq0);
258+
*ctx.resources.pwm = pwm.load(Some(BUF0), Some(BUF1), true).ok();
259+
} else {
260+
*ctx.resources.pwm = pwm.load(Some(BUF0), Some(BUF1), false).ok();
258261
}
259262
}
260263

examples/rtc-demo/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ fn main() -> ! {
2424
let clocks = clocks.start_lfclk();
2525

2626
// Run RTC for 1 second
27-
let mut rtc = Rtc::new(p.RTC0);
27+
let mut rtc = Rtc::new(p.RTC0, 0).unwrap();
2828
rtc.set_compare(RtcCompareReg::Compare0, 32_768).unwrap();
2929
rtc.enable_event(RtcInterrupt::Compare0);
3030

3131
rprintln!("Starting RTC");
32-
let rtc = rtc.enable_counter();
32+
rtc.enable_counter();
3333

3434
rprintln!("Waiting for compare match");
3535
while !rtc.is_event_triggered(RtcInterrupt::Compare0) {}
3636
rtc.reset_event(RtcInterrupt::Compare0);
3737

3838
rprintln!("Compare match, stopping RTC");
39-
let rtc = rtc.disable_counter();
39+
rtc.disable_counter();
4040

4141
rprintln!("Counter stopped at {} ticks", rtc.get_counter());
4242

0 commit comments

Comments
 (0)