File tree Expand file tree Collapse file tree 6 files changed +17
-37
lines changed Expand file tree Collapse file tree 6 files changed +17
-37
lines changed Original file line number Diff line number Diff line change @@ -53,12 +53,12 @@ jobs:
5353 - name : Install Nightly Rust
5454 uses : actions-rust-lang/setup-rust-toolchain@v1
5555 with :
56- toolchain : nightly-2023-08-08
56+ toolchain : nightly-2025-03-03
5757 components : rustfmt
5858
5959 # Actual test run
6060 - name : Generate chip description sources
61- run : make RUSTUP_TOOLCHAIN=nightly-2023-08-08
61+ run : make RUSTUP_TOOLCHAIN=nightly-2025-03-03
6262 - name : Test-compile the crate
6363 run : cargo check --all-features
6464
8686 - name : Install Rust
8787 uses : actions-rust-lang/setup-rust-toolchain@v1
8888 with :
89- toolchain : nightly-2023-12-28
89+ toolchain : nightly-2025-03-03
90+ rustflags : " "
9091 components : rust-src,rustfmt
9192 - name : Install AVR gcc, binutils, and libc
9293 run : sudo apt-get install -y avr-libc binutils-avr gcc-avr
Original file line number Diff line number Diff line change 11[build ]
2- target = " avr-specs/avr-atmega328p.json"
2+ target = " avr-none"
3+ rustflags = [" -C" , " target-cpu=atmega328p" ]
34
45[target .'cfg(target_arch = "avr")' ]
56runner = " ravedude uno -cb 57600"
Original file line number Diff line number Diff line change 22name = " mega328-test"
33version = " 0.1.0"
44authors = [
" Frank Villaro-Dixon <[email protected] >" ]
5- edition = " 2021 "
5+ edition = " 2024 "
66license = " MIT OR Apache-2.0"
77
88[[bin ]]
@@ -18,7 +18,7 @@ embedded-hal = "0.2.3"
1818
1919
2020[dependencies .avr-device ]
21- version = " 0.5.3 "
21+ version = " 0.7 "
2222# To use the local version of avr-device instead, uncomment the following line:
2323# NB: make sure to build this crate first by running `make` at the root of the project
2424# path = "../.."
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11[toolchain ]
2- channel = " nightly-2023-12-28 "
2+ channel = " nightly-2025-03-03 "
33components = [" rust-src" ]
44profile = " minimal"
Original file line number Diff line number Diff line change @@ -38,13 +38,16 @@ fn TIMER0_OVF() {
3838 // We then count 61 times to approximate 1s.
3939 // XXX: this is a really bad way to count time
4040
41- static mut OVF_COUNTER : u16 = 0 ;
42- const ROLLOVER : u16 = 61 ;
41+ use core:: sync:: atomic:: { AtomicU8 , Ordering :: Relaxed } ;
4342
44- * OVF_COUNTER = OVF_COUNTER . wrapping_add ( 1 ) ;
45- if * OVF_COUNTER > ROLLOVER {
46- * OVF_COUNTER = 0 ;
43+ static OVF_COUNTER : AtomicU8 = AtomicU8 :: new ( 0 ) ;
44+ const ROLLOVER : u8 = 61 ;
4745
46+ let ovf = OVF_COUNTER . load ( Relaxed ) ;
47+ if ovf < ROLLOVER {
48+ OVF_COUNTER . store ( ovf + 1 , Relaxed ) ;
49+ } else {
50+ OVF_COUNTER . store ( 0 , Relaxed ) ;
4851 interrupt:: free ( |cs| {
4952 LED_STATE . borrow ( cs) . set ( !LED_STATE . borrow ( cs) . get ( ) ) ;
5053 } ) ;
You can’t perform that action at this time.
0 commit comments