rtic/examples/esp32c3
Finomnis 8c23e178f3
Monotonic rewrite (#874)
* Rework timer_queue and monotonic architecture

Goals:
 * make Monotonic purely internal
 * make Monotonic purely tick passed, no fugit involved
 * create a wrapper struct in the user's code via a macro that then
   converts the "now" from the tick based monotonic to a fugit based
   timestamp

We need to proxy the delay functions of the timer queue anyway,
so we could simply perform the conversion in those proxy functions.

* Update cargo.lock

* Update readme of rtic-time

* CI: ESP32: Redact esp_image: Too volatile

* Fixup: Changelog double entry rebase mistake

---------

Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
2024-04-10 22:00:38 +00:00
..
.cargo CI: Add ESP32-C3 QEMU support (#914) 2024-04-10 18:35:14 +00:00
examples Adjust esp32c3 codegen, bump pac to 0.21.0 (#906) 2024-04-04 09:35:41 +00:00
Cargo.lock Adjust esp32c3 codegen, bump pac to 0.21.0 (#906) 2024-04-04 09:35:41 +00:00
Cargo.toml Adjust esp32c3 codegen, bump pac to 0.21.0 (#906) 2024-04-04 09:35:41 +00:00
README.md Adjust esp32c3 codegen, bump pac to 0.21.0 (#906) 2024-04-04 09:35:41 +00:00
runner.sh Monotonic rewrite (#874) 2024-04-10 22:00:38 +00:00
rust-toolchain.toml Adjust esp32c3 codegen, bump pac to 0.21.0 (#906) 2024-04-04 09:35:41 +00:00

ESP32-C3 RTIC template

This crate showcases a simple RTIC application for the ESP32-C3.

Prerequisites

Nightly Rust

The ESP32-C3 HAL requires a nightly build of Rust. Following the example of the (Espressif no_std book)[https://docs.esp-rs.org/no_std-training/02_2_software.html], we use this specific build: rustup toolchain install nightly-2023-11-14 --component rust-src --target riscv32imc-unknown-none-elf

Espressif toolchain

This crate uses the most convenient option in cargo-espflash and espflash cargo install cargo-espflash espflash

Running the crate

cargo run --example sw_and_hw --features=riscv-esp32c3-backend (--release)

should do the trick.

Expected behavior

The program

  • Prints init
  • Enters a high prio task
  • During the execution of the high prio task, the button should be non-functional
  • Pends a low prio task
  • Exits the high prio task
  • Enters the low prio task
  • During the execution of the low prio task, the button should be functional.
  • Exits the low prio task
  • Prints idle