[esp] Add Rust no-std example.

This commit is contained in:
2025-09-21 09:35:04 -04:00
parent bb28b1e2ef
commit 85f588fcb3
22 changed files with 1375 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
# esp-idf-std
# 01_esp-idf-std
This is an example of using ESP-IDF with std enabled in Rust
This is an example of using ESP-IDF with std enabled in Rust using templates provided by https://github.com/esp-rs/esp-idf-template
When flashed to a device, the application just adjusts the intensity of the on-board LED for visual verification that flashing works correctly.
Steps used to generate this project

View File

@@ -21,11 +21,11 @@ fn main() -> anyhow::Result<()> {
println!("Starting duty-cycle loop");
let max_duty = channel.get_max_duty();
// Cycle the channel duty every 2s to visually show that things are working when flashed.
// Cycle the channel duty every 500ms to visually show that things are working when flashed.
for numerator in [0, 1, 2, 3, 4, 5].iter().cycle() {
println!("Duty {numerator}/5");
channel.set_duty(max_duty * numerator / 5)?;
FreeRtos::delay_ms(2000);
FreeRtos::delay_ms(500);
}
// We want this to run forever, so don't let the application terminate.