Skip to content

Commit 896d876

Browse files
committed
Require exclusive access to the RESET peripheral for RP2040/RP2350
If you don't have exclusive access to the RESET peripheral, someone else could race you on the read/modify/write cycle on the update of the RESETS.reset register. This is a breaking change.
1 parent fa0d9be commit 896d876

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

rtic-monotonics/src/rp2040.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl TimerBackend {
5050
/// **Do not use this function directly.**
5151
///
5252
/// Use the prelude macros instead.
53-
pub fn _start(timer: TIMER, resets: &RESETS) {
53+
pub fn _start(timer: TIMER, resets: &mut RESETS) {
5454
resets.reset().modify(|_, w| w.timer().clear_bit());
5555
while resets.reset_done().read().timer().bit_is_clear() {}
5656
timer.inte().modify(|_, w| w.alarm_0().bit(true));

rtic-monotonics/src/rp235x.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl TimerBackend {
5252
/// **Do not use this function directly.**
5353
///
5454
/// Use the prelude macros instead.
55-
pub fn _start(timer: TIMER0, resets: &RESETS) {
55+
pub fn _start(timer: TIMER0, resets: &mut RESETS) {
5656
resets.reset().modify(|_, w| w.timer0().clear_bit());
5757
while resets.reset_done().read().timer0().bit_is_clear() {}
5858
timer.inte().modify(|_, w| w.alarm_0().bit(true));

0 commit comments

Comments
 (0)