Skip to content

update toolchain to 2025-03-03 #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -53,12 +53,12 @@ jobs:
- name: Install Nightly Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-08-08
toolchain: nightly-2025-03-03
components: rustfmt

# Actual test run
- name: Generate chip description sources
run: make RUSTUP_TOOLCHAIN=nightly-2023-08-08
run: make RUSTUP_TOOLCHAIN=nightly-2025-03-03
- name: Test-compile the crate
run: cargo check --all-features

@@ -86,7 +86,8 @@ jobs:
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-12-28
toolchain: nightly-2025-03-03
rustflags: ""
components: rust-src,rustfmt
- name: Install AVR gcc, binutils, and libc
run: sudo apt-get install -y avr-libc binutils-avr gcc-avr
3 changes: 2 additions & 1 deletion examples/atmega328p/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[build]
target = "avr-specs/avr-atmega328p.json"
target = "avr-none"
rustflags = ["-C", "target-cpu=atmega328p"]

[target.'cfg(target_arch = "avr")']
runner = "ravedude uno -cb 57600"
4 changes: 2 additions & 2 deletions examples/atmega328p/Cargo.toml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
name = "mega328-test"
version = "0.1.0"
authors = ["Frank Villaro-Dixon <frank@villaro-dixon.eu>"]
edition = "2021"
edition = "2024"
license = "MIT OR Apache-2.0"

[[bin]]
@@ -18,7 +18,7 @@ embedded-hal = "0.2.3"


[dependencies.avr-device]
version = "0.5.3"
version = "0.7"
# To use the local version of avr-device instead, uncomment the following line:
# NB: make sure to build this crate first by running `make` at the root of the project
# path = "../.."
25 changes: 0 additions & 25 deletions examples/atmega328p/avr-specs/avr-atmega328p.json

This file was deleted.

2 changes: 1 addition & 1 deletion examples/atmega328p/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2023-12-28"
channel = "nightly-2025-03-03"
components = ["rust-src"]
profile = "minimal"
13 changes: 8 additions & 5 deletions examples/atmega328p/src/main.rs
Original file line number Diff line number Diff line change
@@ -38,13 +38,16 @@ fn TIMER0_OVF() {
// We then count 61 times to approximate 1s.
// XXX: this is a really bad way to count time

static mut OVF_COUNTER: u16 = 0;
const ROLLOVER: u16 = 61;
use core::sync::atomic::{AtomicU8, Ordering::Relaxed};

*OVF_COUNTER = OVF_COUNTER.wrapping_add(1);
if *OVF_COUNTER > ROLLOVER {
*OVF_COUNTER = 0;
static OVF_COUNTER: AtomicU8 = AtomicU8::new(0);
const ROLLOVER: u8 = 61;

let ovf = OVF_COUNTER.load(Relaxed);
if ovf < ROLLOVER {
OVF_COUNTER.store(ovf + 1, Relaxed);
} else {
OVF_COUNTER.store(0, Relaxed);
interrupt::free(|cs| {
LED_STATE.borrow(cs).set(!LED_STATE.borrow(cs).get());
});
Loading