Skip to content

Commit

Permalink
Use stable release channel for RISC-V targets
Browse files Browse the repository at this point in the history
  • Loading branch information
jessebraham committed Sep 10, 2024
1 parent 4ce9862 commit 1c5ce35
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ jobs:

# Install the Rust toolchain for RISC-V devices:
- if: ${{ !contains(fromJson('["esp32", "esp32s2", "esp32s3"]'), matrix.mcu) }}
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly-2024-06-01 # TODO: Remove date when able
uses: dtolnay/rust-toolchain@stable

# Install the Rust toolchain for Xtensa devices:
- if: ${{ contains(fromJson('["esp32", "esp32s2", "esp32s3"]'), matrix.mcu) }}
Expand Down
2 changes: 1 addition & 1 deletion embassy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ embassy-time = { version = "0.3.2", features = ["generic-queue-8"] }
esp-backtrace = { version = "0.14.1", features = ["{{ mcu }}", "defmt", "exception-handler", "panic-handler"] }
esp-hal = { version = "0.20.1", features = ["{{ mcu }}", "defmt", "async"] }
esp-hal-embassy = { version = "0.3.0", features = ["{{ mcu }}", "defmt"] }
static_cell = { version = "2.1.0", features = ["nightly"] }
static_cell = "2.1.0"

[profile.release]
debug = true # Debug info is useful, and does not affect the size of the final binary
Expand Down
2 changes: 1 addition & 1 deletion embassy/pre-script.rhai
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ if mcu in ["esp32", "esp32s2", "esp32s3"] {
};

variable::set("arch", "riscv");
variable::set("toolchain", "nightly-2024-06-01"); // TODO: Remove date when able
variable::set("toolchain", "stable");
variable::set("rust_target", `riscv32${extensions}-unknown-none-elf`);
}
19 changes: 19 additions & 0 deletions embassy/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
#![no_std]

/// Convert a `T` to a `&'static mut T`.
///
/// The macro declares a `static StaticCell` and then initializes it when run,
/// returning the `&'static mut`. Therefore, each instance can only be run once.
/// Next runs will panic. The `static` can additionally be decorated with
/// attributes, such as `#[link_section]`, `#[used]`, et al.
#[macro_export]
macro_rules! make_static {
( $t:ty, $val:expr) => ($crate::make_static!($t, $val, ));
( $t:ty, $val:expr, $(#[$m:meta])* ) => {{
$(#[$m])*
static STATIC_CELL: ::static_cell::StaticCell<$t> = ::static_cell::StaticCell::new();
#[deny(unused_attributes)]
let x = STATIC_CELL.uninit().write(($val));

x
}};
}

0 comments on commit 1c5ce35

Please sign in to comment.