Skip to content

Commit

Permalink
Fix build errors and missing v3 feature (#5)
Browse files Browse the repository at this point in the history
* fix: missing v3 feature in rt crate

* fix(build): feature flags

* fix(build): rt cfg flags warning

* fixup! ci: create rust.yml
  • Loading branch information
andelf authored Oct 3, 2024
1 parent 13b64e6 commit 37435f1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Prepare Rust Target
run: rustup target add riscv32imac-unknown-none-elf
- name: Build
run: cargo build --all --target riscv32imac-unknown-none-elf
4 changes: 2 additions & 2 deletions qingke-rt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ readme = "README.md"

[features]
v2 = []
v3 = []
v3 = ["qingke/v3"]
v4 = []
# v5 is not released yet
# v5 = []
Expand All @@ -24,7 +24,7 @@ highcode = []

[dependencies]
qingke-rt-macros = { path = "./macros", version = "0.3" }
qingke = { path = "../", version = "0.3" }
qingke = { path = "../", version = "0.3", features = ["critical-section-impl"] }

[package.metadata.docs.rs]
targets = ["riscv32imac-unknown-none-elf"]
4 changes: 4 additions & 0 deletions qingke-rt/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ fn main() {
let target = env::var("TARGET").unwrap();
let cargo_flags = env::var("CARGO_ENCODED_RUSTFLAGS").unwrap();
// set configuration flags depending on the target

println!("cargo::rustc-check-cfg=cfg(riscvf)");
println!("cargo::rustc-check-cfg=cfg(riscvd)");

if target.starts_with("riscv") {
println!("cargo:rustc-cfg=riscv");

Expand Down
1 change: 1 addition & 0 deletions src/pfic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ pub unsafe fn disable_vtf(channel: u8) {
ptr::write_volatile(PFIC_VTFADDRR0.offset(channel as isize), val & 0xFFFF_FFFE);
}

#[cfg(feature = "critical-section-impl")]
pub unsafe fn wfi_to_wfe(v: bool) {
critical_section::with(|_| {
let mut val = ptr::read_volatile(PFIC_SCTLR);
Expand Down

0 comments on commit 37435f1

Please sign in to comment.