-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
76 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[build] | ||
target = "riscv32imac-unknown-none-elf" | ||
|
||
[target."riscv32imac-unknown-none-elf"] | ||
runner = "wlink -v flash --enable-sdi-print --watch-serial" | ||
# runner = "wlink -v flash" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
[package] | ||
name = "ch32v208-examples" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
ch32-hal = { path = "../../", features = [ | ||
"ch32v208wbu6", | ||
"defmt", | ||
"embassy", | ||
"rt", | ||
], default-features = false } | ||
embassy-executor = { version = "0.5.0", features = [ | ||
"nightly", | ||
"integrated-timers", | ||
"arch-riscv32", | ||
"executor-thread", | ||
] } | ||
embassy-time = { version = "0.3.0" } | ||
|
||
qingke-rt = { version = "0.2.0" } | ||
qingke = { version = "0.2.0" } | ||
# qingke-rt = { version = "0.2.0", path = "../../../qingke/qingke-rt" } | ||
# qingke = { version = "0.2.0", path = "../../../qingke" } | ||
|
||
panic-halt = "0.2.0" | ||
|
||
[profile.release] | ||
strip = false # symbols are not flashed to the microcontroller, so don't strip them. | ||
lto = true | ||
opt-level = "z" # Optimize for size. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
fn main() { | ||
// println!("cargo:rustc-link-arg-bins=--nmagic"); | ||
println!("cargo:rustc-link-arg-bins=-Tlink.x"); | ||
// println!("cargo:rustc-link-arg-bins=-Tdefmt.x"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#![no_std] | ||
#![no_main] | ||
#![feature(type_alias_impl_trait)] | ||
|
||
use hal::gpio::{Level, Output}; | ||
use qingke::riscv; | ||
use {ch32_hal as hal, panic_halt as _}; | ||
|
||
#[qingke_rt::entry] | ||
fn main() -> ! { | ||
let p = hal::init(Default::default()); | ||
|
||
let mut led = Output::new(p.PB8, Level::Low, Default::default()); | ||
loop { | ||
led.toggle(); | ||
|
||
unsafe { | ||
riscv::asm::delay(1000000); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters