Use volatile write operation for 'set_mask_raw' function

The other methods had previously been updated to use volatile memops,
but due to an oversight this method was missed.

Fixes avr-rust/ruduino#31.

Thanks to @MalteT for reporting this issue.
This commit is contained in:
Dylan McKay 2020-10-30 01:04:47 +13:00
parent 41967edeb2
commit 79dd2543a1
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ pub trait Register : Sized {
#[inline(always)]
fn set_mask_raw(mask: Self::T) {
unsafe {
*Self::ADDRESS |= mask;
core::ptr::write_volatile(Self::ADDRESS, core::ptr::read_volatile(Self::ADDRESS) | mask);
}
}