-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #210 from baoyachi/no_std
- Loading branch information
Showing
13 changed files
with
167 additions
and
32 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
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,19 @@ | ||
|
||
[target.riscv32imc-unknown-none-elf] | ||
runner = "espflash flash --monitor" | ||
|
||
[build] | ||
rustflags = [ | ||
"-C", "link-arg=-Tlinkall.x", | ||
# Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) | ||
# NOTE: May negatively impact performance of produced code | ||
"-C", "force-frame-pointers", | ||
] | ||
|
||
target = "riscv32imc-unknown-none-elf" | ||
|
||
[unstable] | ||
build-std = ["core"] | ||
|
||
[env] | ||
ESP_LOG="INFO" |
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,3 @@ | ||
/target | ||
Cargo.lock | ||
.idea/ |
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,25 @@ | ||
[package] | ||
name = "example_no_std" | ||
version = "0.1.8" | ||
edition = "2021" | ||
build = "build.rs" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
esp-backtrace = { version = "0.14.2", features = [ | ||
"esp32c3", | ||
"exception-handler", | ||
"panic-handler", | ||
"println", | ||
] } | ||
|
||
esp-hal = { version = "0.22.0", features = [ | ||
"esp32c3", | ||
] } | ||
esp-println = { version = "0.12.0", features = ["esp32c3", "log"] } | ||
shadow-rs = { path = "../", default-features = false } | ||
log = "0.4.22" | ||
|
||
[build-dependencies] | ||
shadow-rs = { path = "../", features = ["no_std"] } |
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,8 @@ | ||
use shadow_rs::ShadowBuilder; | ||
|
||
fn main() { | ||
ShadowBuilder::builder() | ||
.deny_const(Default::default()) | ||
.build() | ||
.unwrap(); | ||
} |
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,4 @@ | ||
[toolchain] | ||
channel = "stable" | ||
components = ["rust-src"] | ||
targets = ["riscv32imc-unknown-none-elf"] |
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,24 @@ | ||
#![no_std] | ||
#![no_main] | ||
|
||
use esp_backtrace as _; | ||
use esp_hal::delay::Delay; | ||
use esp_hal::prelude::*; | ||
use log::info; | ||
|
||
use shadow_rs::shadow; | ||
|
||
shadow!(build); | ||
#[entry] | ||
fn main() -> ! { | ||
esp_println::logger::init_logger_from_env(); | ||
|
||
let delay = Delay::new(); | ||
|
||
info!("{}", build::VERSION); | ||
|
||
loop { | ||
info!("Hello world!"); | ||
delay.delay(500.millis()); | ||
} | ||
} |
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
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