latest stable esp-hal + hello world

This commit is contained in:
okhsunrog 2024-09-08 04:24:38 +03:00
parent 527b54b1d6
commit dce4ebc3f9
9 changed files with 362 additions and 325 deletions

5
.idea/.gitignore generated vendored
View file

@ -1,5 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/

130
.idea/cody_history.xml generated
View file

@ -1,130 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChatHistory">
<accountData>
<list>
<AccountData>
<accountId value="VXNlcjo0Njg3MzE=" />
<chats>
<list>
<chat>
<internalId value="44262a20-1f6b-41d9-aef0-8466b8eff72f" />
</chat>
<chat>
<internalId value="1e10fa7b-7b50-4f4e-ae21-6d0d0096da27" />
<messages>
<list>
<message>
<speaker value="HUMAN" />
<text value="create 2 tasks (for pin 4 and for pin 5), each one should await for rising edge and print info log when it detects one" />
</message>
<message>
<speaker value="ASSISTANT" />
<text value="Certainly! I'll create two tasks for pins 4 and 5 that await rising edges and print info logs when detected. Here's how we can modify the code to achieve this:&#10;&#10;1. First, let's add the necessary imports:&#10;&#10;```rust&#10;use esp_hal::{gpio::{Gpio4, Gpio5, Input, PullDown}, interrupt};&#10;use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;&#10;use embassy_sync::signal::Signal;&#10;```&#10;&#10;2. Now, let's define our task functions:&#10;&#10;```rust&#10;static SIGNAL_PIN4: Signal&lt;CriticalSectionRawMutex, ()&gt; = Signal::new();&#10;static SIGNAL_PIN5: Signal&lt;CriticalSectionRawMutex, ()&gt; = Signal::new();&#10;&#10;#[embassy_executor::task]&#10;async fn monitor_pin4() {&#10; loop {&#10; SIGNAL_PIN4.wait().await;&#10; info!(&quot;Rising edge detected on Pin 4!&quot;);&#10; }&#10;}&#10;&#10;#[embassy_executor::task]&#10;async fn monitor_pin5() {&#10; loop {&#10; SIGNAL_PIN5.wait().await;&#10; info!(&quot;Rising edge detected on Pin 5!&quot;);&#10; }&#10;}&#10;```&#10;&#10;3. In the `main` function, let's set up the GPIO pins and spawn the tasks:&#10;&#10;```rust&#10;#[main]&#10;async fn main(spawner: Spawner) {&#10; // ... (existing code)&#10;&#10; // Set up GPIO pins&#10; let io = esp_hal::gpio::IO::new(peripherals.GPIO, peripherals.IO_MUX);&#10; let mut pin4 = io.pins.gpio4.into_pull_down_input();&#10; let mut pin5 = io.pins.gpio5.into_pull_down_input();&#10;&#10; pin4.listen(interrupt::InterruptType::PosEdge);&#10; pin5.listen(interrupt::InterruptType::PosEdge);&#10;&#10; // Spawn tasks&#10; spawner.spawn(monitor_pin4()).unwrap();&#10; spawner.spawn(monitor_pin5()).unwrap();&#10;&#10; // ... (existing code)&#10;}&#10;```&#10;&#10;4. Finally, let's add interrupt handlers:&#10;&#10;```rust&#10;#[interrupt]&#10;fn GPIO() {&#10; let io = unsafe { esp_hal::gpio::IO::new(Peripherals::steal().GPIO, Peripherals::steal().IO_MUX) };&#10; &#10; if io.pins.gpio4.is_interrupt_set() {&#10; io.pins.gpio4.clear_interrupt();&#10; SIGNAL_PIN4.signal(());&#10; }&#10; &#10; if io.pins.gpio5.is_interrupt_set() {&#10; io.pins.gpio5.clear_interrupt();&#10; SIGNAL_PIN5.signal(());&#10; }&#10;}&#10;```&#10;&#10;These changes will create two tasks that monitor pins 4 and 5 for rising edges and print info logs when detected. The tasks are spawned in the `main` function, and the GPIO interrupt handler signals the appropriate task when a rising edge is detected on either pin." />
</message>
<message>
<speaker value="HUMAN" />
<text value="we don't actually need embassy_sync, critical sectiona and manual interrupts, the driver does all of that for us. look, we can work with gpio inputs as simple as that:&#10;&#10;//! embassy wait&#10;//!&#10;//! This is an example of asynchronously `Wait`ing for a pin state (boot button) to change.&#10;&#10;//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3&#10;//% FEATURES: async embassy embassy-generic-timers&#10;&#10;#![no_std]&#10;#![no_main]&#10;&#10;use embassy_executor::Spawner;&#10;use embassy_time::{Duration, Timer};&#10;use esp_backtrace as _;&#10;use esp_hal::{&#10; clock::ClockControl,&#10; gpio::{Input, Io, Pull},&#10; peripherals::Peripherals,&#10; system::SystemControl,&#10; timer::{timg::TimerGroup, ErasedTimer, OneShotTimer},&#10;};&#10;&#10;// When you are okay with using a nightly compiler it's better to use https://docs.rs/static_cell/2.1.0/static_cell/macro.make_static.html&#10;macro_rules! mk_static {&#10; ($t:ty,$val:expr) =&amp;gt; {{&#10; static STATIC_CELL: static_cell::StaticCell&amp;lt;$t&amp;gt; = static_cell::StaticCell::new();&#10; #[deny(unused_attributes)]&#10; let x = STATIC_CELL.uninit().write(($val));&#10; x&#10; }};&#10;}&#10;&#10;#[esp_hal_embassy::main]&#10;async fn main(_spawner: Spawner) {&#10; esp_println::println!(&amp;quot;Init!&amp;quot;);&#10; let peripherals = Peripherals::take();&#10; let system = SystemControl::new(peripherals.SYSTEM);&#10; let clocks = ClockControl::boot_defaults(system.clock_control).freeze();&#10;&#10; let timg0 = TimerGroup::new(peripherals.TIMG0, &amp;amp;clocks);&#10; let timer0: ErasedTimer = timg0.timer0.into();&#10; let timers = [OneShotTimer::new(timer0)];&#10; let timers = mk_static!([OneShotTimer&amp;lt;ErasedTimer&amp;gt;; 1], timers);&#10; esp_hal_embassy::init(&amp;amp;clocks, timers);&#10;&#10; let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);&#10; #[cfg(any(feature = &amp;quot;esp32&amp;quot;, feature = &amp;quot;esp32s2&amp;quot;, feature = &amp;quot;esp32s3&amp;quot;))]&#10; let mut input = Input::new(io.pins.gpio0, Pull::Down);&#10; #[cfg(not(any(feature = &amp;quot;esp32&amp;quot;, feature = &amp;quot;esp32s2&amp;quot;, feature = &amp;quot;esp32s3&amp;quot;)))]&#10; let mut input = Input::new(io.pins.gpio9, Pull::Down);&#10;&#10; loop {&#10; esp_println::println!(&amp;quot;Waiting...&amp;quot;);&#10; input.wait_for_rising_edge().await;&#10; esp_println::println!(&amp;quot;Ping!&amp;quot;);&#10; Timer::after(Duration::from_millis(100)).await;&#10; }&#10;}" />
</message>
<message>
<speaker value="ASSISTANT" />
</message>
<message>
<speaker value="HUMAN" />
<text value="we don't actually need embassy_sync, critical sectiona and manual interrupts, the driver does all of that for us. look, we can work with gpio inputs as simple as that:&#10;&#10;//! embassy wait&#10;//!&#10;//! This is an example of asynchronously `Wait`ing for a pin state (boot button) to change.&#10;&#10;//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3&#10;//% FEATURES: async embassy embassy-generic-timers&#10;&#10;#![no_std]&#10;#![no_main]&#10;&#10;use embassy_executor::Spawner;&#10;use embassy_time::{Duration, Timer};&#10;use esp_backtrace as _;&#10;use esp_hal::{&#10; clock::ClockControl,&#10; gpio::{Input, Io, Pull},&#10; peripherals::Peripherals,&#10; system::SystemControl,&#10; timer::{timg::TimerGroup, ErasedTimer, OneShotTimer},&#10;};&#10;&#10;// When you are okay with using a nightly compiler it's better to use https://docs.rs/static_cell/2.1.0/static_cell/macro.make_static.html&#10;macro_rules! mk_static {&#10; ($t:ty,$val:expr) =&amp;gt; {{&#10; static STATIC_CELL: static_cell::StaticCell&amp;lt;$t&amp;gt; = static_cell::StaticCell::new();&#10; #[deny(unused_attributes)]&#10; let x = STATIC_CELL.uninit().write(($val));&#10; x&#10; }};&#10;}&#10;&#10;#[esp_hal_embassy::main]&#10;async fn main(_spawner: Spawner) {&#10; esp_println::println!(&amp;quot;Init!&amp;quot;);&#10; let peripherals = Peripherals::take();&#10; let system = SystemControl::new(peripherals.SYSTEM);&#10; let clocks = ClockControl::boot_defaults(system.clock_control).freeze();&#10;&#10; let timg0 = TimerGroup::new(peripherals.TIMG0, &amp;amp;clocks);&#10; let timer0: ErasedTimer = timg0.timer0.into();&#10; let timers = [OneShotTimer::new(timer0)];&#10; let timers = mk_static!([OneShotTimer&amp;lt;ErasedTimer&amp;gt;; 1], timers);&#10; esp_hal_embassy::init(&amp;amp;clocks, timers);&#10;&#10; let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);&#10; #[cfg(any(feature = &amp;quot;esp32&amp;quot;, feature = &amp;quot;esp32s2&amp;quot;, feature = &amp;quot;esp32s3&amp;quot;))]&#10; let mut input = Input::new(io.pins.gpio0, Pull::Down);&#10; #[cfg(not(any(feature = &amp;quot;esp32&amp;quot;, feature = &amp;quot;esp32s2&amp;quot;, feature = &amp;quot;esp32s3&amp;quot;)))]&#10; let mut input = Input::new(io.pins.gpio9, Pull::Down);&#10;&#10; loop {&#10; esp_println::println!(&amp;quot;Waiting...&amp;quot;);&#10; input.wait_for_rising_edge().await;&#10; esp_println::println!(&amp;quot;Ping!&amp;quot;);&#10; Timer::after(Duration::from_millis(100)).await;&#10; }&#10;}&#10;" />
</message>
<message>
<speaker value="ASSISTANT" />
</message>
<message>
<speaker value="HUMAN" />
<text value="we don't actually need embassy_sync, critical sectiona and manual interrupts, the driver does all of that for us. look, we can work with gpio inputs as simple as that&#10;&#10;#![no_std]&#10;#![no_main]&#10;&#10;use embassy_executor::Spawner;&#10;use embassy_time::{Duration, Timer};&#10;use esp_backtrace as _;&#10;use esp_hal::{&#10; clock::ClockControl,&#10; gpio::{Input, Io, Pull},&#10; peripherals::Peripherals,&#10; system::SystemControl,&#10; timer::{timg::TimerGroup, ErasedTimer, OneShotTimer},&#10;};&#10;&#10;// When you are okay with using a nightly compiler it's better to use https://docs.rs/static_cell/2.1.0/static_cell/macro.make_static.html&#10;macro_rules! mk_static {&#10; ($t:ty,$val:expr) =&amp;gt; {{&#10; static STATIC_CELL: static_cell::StaticCell&amp;lt;$t&amp;gt; = static_cell::StaticCell::new();&#10; #[deny(unused_attributes)]&#10; let x = STATIC_CELL.uninit().write(($val));&#10; x&#10; }};&#10;}&#10;&#10;#[esp_hal_embassy::main]&#10;async fn main(_spawner: Spawner) {&#10; esp_println::println!(&amp;quot;Init!&amp;quot;);&#10; let peripherals = Peripherals::take();&#10; let system = SystemControl::new(peripherals.SYSTEM);&#10; let clocks = ClockControl::boot_defaults(system.clock_control).freeze();&#10;&#10; let timg0 = TimerGroup::new(peripherals.TIMG0, &amp;amp;clocks);&#10; let timer0: ErasedTimer = timg0.timer0.into();&#10; let timers = [OneShotTimer::new(timer0)];&#10; let timers = mk_static!([OneShotTimer&amp;lt;ErasedTimer&amp;gt;; 1], timers);&#10; esp_hal_embassy::init(&amp;amp;clocks, timers);&#10;&#10; let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);&#10; #[cfg(any(feature = &amp;quot;esp32&amp;quot;, feature = &amp;quot;esp32s2&amp;quot;, feature = &amp;quot;esp32s3&amp;quot;))]&#10; let mut input = Input::new(io.pins.gpio0, Pull::Down);&#10; #[cfg(not(any(feature = &amp;quot;esp32&amp;quot;, feature = &amp;quot;esp32s2&amp;quot;, feature = &amp;quot;esp32s3&amp;quot;)))]&#10; let mut input = Input::new(io.pins.gpio9, Pull::Down);&#10;&#10; loop {&#10; esp_println::println!(&amp;quot;Waiting...&amp;quot;);&#10; input.wait_for_rising_edge().await;&#10; esp_println::println!(&amp;quot;Ping!&amp;quot;);&#10; Timer::after(Duration::from_millis(100)).await;&#10; }&#10;}&#10;" />
</message>
<message>
<speaker value="ASSISTANT" />
<text value="You're absolutely right! The esp-hal driver indeed provides a much simpler way to work with GPIO inputs, including built-in support for awaiting rising edges. This approach is cleaner and more straightforward. Let's implement the two tasks for pins 4 and 5 using this simpler method:&#10;&#10;```rust&#10;use embassy_executor::Spawner;&#10;use embassy_time::{Duration, Timer};&#10;use esp_backtrace as _;&#10;use esp_hal::{&#10; clock::ClockControl,&#10; gpio::{Input, Io, Pull},&#10; peripherals::Peripherals,&#10; system::SystemControl,&#10; timer::{timg::TimerGroup, ErasedTimer, OneShotTimer},&#10;};&#10;&#10;#[embassy_executor::task]&#10;async fn monitor_pin4(mut input: Input&lt;'static&gt;) {&#10; loop {&#10; input.wait_for_rising_edge().await;&#10; esp_println::println!(&quot;Rising edge detected on Pin 4!&quot;);&#10; Timer::after(Duration::from_millis(100)).await;&#10; }&#10;}&#10;&#10;#[embassy_executor::task]&#10;async fn monitor_pin5(mut input: Input&lt;'static&gt;) {&#10; loop {&#10; input.wait_for_rising_edge().await;&#10; esp_println::println!(&quot;Rising edge detected on Pin 5!&quot;);&#10; Timer::after(Duration::from_millis(100)).await;&#10; }&#10;}&#10;&#10;#[esp_hal_embassy::main]&#10;async fn main(spawner: Spawner) {&#10; esp_println::println!(&quot;Init!&quot;);&#10; let peripherals = Peripherals::take();&#10; let system = SystemControl::new(peripherals.SYSTEM);&#10; let clocks = ClockControl::boot_defaults(system.clock_control).freeze();&#10;&#10; let timg0 = TimerGroup::new(peripherals.TIMG0, &amp;clocks);&#10; let timer0: ErasedTimer = timg0.timer0.into();&#10; let timers = [OneShotTimer::new(timer0)];&#10; let timers = mk_static!([OneShotTimer&lt;ErasedTimer&gt;; 1], timers);&#10; esp_hal_embassy::init(&amp;clocks, timers);&#10;&#10; let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);&#10; let input4 = Input::new(io.pins.gpio4, Pull::Down);&#10; let input5 = Input::new(io.pins.gpio5, Pull::Down);&#10;&#10; spawner.spawn(monitor_pin4(input4)).unwrap();&#10; spawner.spawn(monitor_pin5(input5)).unwrap();&#10;&#10; loop {&#10; Timer::after(Duration::from_secs(1)).await;&#10; }&#10;}&#10;```&#10;&#10;This implementation is indeed much simpler and more elegant. It uses the built-in `wait_for_rising_edge()` method provided by the esp-hal driver, eliminating the need for manual interrupt handling and synchronization primitives. The tasks are spawned in the main function, each monitoring its respective pin for rising edges." />
</message>
<message>
<speaker value="HUMAN" />
<text value="help me fix this:&#10;&#10;error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied&#10; --&amp;gt; src/main.rs:26:34&#10; |&#10;26 | async fn monitor_pin4(mut input: Input&amp;lt;'static&amp;gt;) {&#10; | ^^^^^ expected 1 generic argument&#10; |&#10;note: struct defined here, with 1 generic parameter: `P`&#10; --&amp;gt; /home/okhsunrog/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-hal-0.19.0/src/gpio/mod.rs:1673:12&#10; |&#10;1673 | pub struct Input&amp;lt;'d, P&amp;gt; {&#10; | ^^^^^ -&#10;help: add missing generic argument&#10; |&#10;26 | async fn monitor_pin4(mut input: Input&amp;lt;'static, P&amp;gt;) {&#10; | +++&#10;&#10;error[E0308]: mismatched types&#10; --&amp;gt; src/main.rs:43:1&#10; |&#10;43 | #[main]&#10; | ^^^^^^^&#10; | |&#10; | expected `Spawner`, found `embassy_executor::spawner::Spawner`&#10; | arguments to this function are incorrect&#10; |&#10; = note: `embassy_executor::spawner::Spawner` and `Spawner` have similar names, but are actually distinct types&#10;note: `embassy_executor::spawner::Spawner` is defined in crate `embassy_executor`&#10; --&amp;gt; /home/okhsunrog/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embassy-executor-0.5.0/src/spawner.rs:71:1&#10; |&#10;71 | pub struct Spawner {&#10; | ^^^^^^^^^^^^^^^^^^&#10;note: `Spawner` is defined in crate `embassy_executor`&#10; --&amp;gt; /home/okhsunrog/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embassy-executor-0.6.0/src/spawner.rs:71:1&#10; |&#10;71 | pub struct Spawner {&#10; | ^^^^^^^^^^^^^^^^^^&#10; = note: perhaps two different versions of crate `embassy_executor` are being used?&#10;note: function defined here&#10; --&amp;gt; src/main.rs:43:1&#10; |&#10;43 | #[main]&#10; | ^^^^^^^&#10;44 | async fn main(spawner: Spawner) {&#10; | ----------------&#10; = note: this error originates in the attribute macro `main` (in Nightly builds, run with -Z macro-backtrace for more info)&#10;&#10;error[E0308]: mismatched types&#10; --&amp;gt; src/main.rs:43:1&#10; |&#10;43 | #[main]&#10; | ^^^^^^^&#10; | |&#10; | expected `SpawnToken&amp;lt;_&amp;gt;`, found `SpawnToken&amp;lt;impl Sized&amp;gt;`&#10; | arguments to this method are incorrect&#10; |&#10; = note: `SpawnToken&amp;lt;impl Sized&amp;gt;` and `SpawnToken&amp;lt;_&amp;gt;` have similar names, but are actually distinct types&#10;note: `SpawnToken&amp;lt;impl Sized&amp;gt;` is defined in crate `embassy_executor`&#10; --&amp;gt; /home/okhsunrog/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embassy-executor-0.6.0/src/spawner.rs:23:1&#10; |&#10;23 | pub struct SpawnToken&amp;lt;S&amp;gt; {&#10; | ^^^^^^^^^^^^^^^^^^^^^^^^&#10;note: `SpawnToken&amp;lt;_&amp;gt;` is defined in crate `embassy_executor`&#10; --&amp;gt; /home/okhsunrog/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embassy-executor-0.5.0/src/spawner.rs:23:1&#10; |&#10;23 | pub struct SpawnToken&amp;lt;S&amp;gt; {&#10; | ^^^^^^^^^^^^^^^^^^^^^^^^&#10; = note: perhaps two different versions of crate `embassy_executor` are being used?&#10;note: method defined here&#10; --&amp;gt; /home/okhsunrog/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embassy-executor-0.5.0/src/spawner.rs:127:12&#10; |&#10;127 | pub fn must_spawn&amp;lt;S&amp;gt;(&amp;amp;self, token: SpawnToken&amp;lt;S&amp;gt;) {&#10; | ^^^^^^^^^^&#10; = note: this error originates in the attribute macro `main` (in Nightly builds, run with -Z macro-backtrace for more info)&#10;&#10;Some errors have detailed explanations: E0107, E0308.&#10;For more information about an error, try `rustc --explain E0107`.&#10;error: could not compile `esp_hal_probe` (bin &amp;quot;esp_hal_probe&amp;quot;) due to 3 previous errors&#10;" />
</message>
<message>
<speaker value="ASSISTANT" />
</message>
<message>
<speaker value="HUMAN" />
<text value="help me fix this:&#10;&#10;error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied&#10; --&amp;gt; src/main.rs:26:34&#10; |&#10;26 | async fn monitor_pin4(mut input: Input&amp;lt;'static&amp;gt;) {&#10; | ^^^^^ expected 1 generic argument&#10; |&#10;note: struct defined here, with 1 generic parameter: `P`&#10; --&amp;gt; /home/okhsunrog/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-hal-0.19.0/src/gpio/mod.rs:1673:12&#10; |&#10;1673 | pub struct Input&amp;lt;'d, P&amp;gt; {&#10; | ^^^^^ -&#10;help: add missing generic argument&#10; |&#10;26 | async fn monitor_pin4(mut input: Input&amp;lt;'static, P&amp;gt;) {&#10; | +++&#10;&#10;error[E0308]: mismatched types&#10; --&amp;gt; src/main.rs:43:1&#10; |&#10;43 | #[main]&#10; | ^^^^^^^&#10; | |&#10; | expected `Spawner`, found `embassy_executor::spawner::Spawner`&#10; | arguments to this function are incorrect&#10; |&#10; = note: `embassy_executor::spawner::Spawner` and `Spawner` have similar names, but are actually distinct types&#10;note: `embassy_executor::spawner::Spawner` is defined in crate `embassy_executor`&#10; --&amp;gt; /home/okhsunrog/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embassy-executor-0.5.0/src/spawner.rs:71:1&#10; |&#10;71 | pub struct Spawner {&#10; | ^^^^^^^^^^^^^^^^^^&#10;note: `Spawner` is defined in crate `embassy_executor`&#10; --&amp;gt; /home/okhsunrog/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embassy-executor-0.6.0/src/spawner.rs:71:1&#10; |&#10;71 | pub struct Spawner {&#10; | ^^^^^^^^^^^^^^^^^^&#10; = note: perhaps two different versions of crate `embassy_executor` are being used?&#10;note: function defined here&#10; --&amp;gt; src/main.rs:43:1&#10; |&#10;43 | #[main]&#10; | ^^^^^^^&#10;44 | async fn main(spawner: Spawner) {&#10; | ----------------&#10; = note: this error originates in the attribute macro `main` (in Nightly builds, run with -Z macro-backtrace for more info)&#10;&#10;error[E0308]: mismatched types&#10; --&amp;gt; src/main.rs:43:1&#10; |&#10;43 | #[main]&#10; | ^^^^^^^&#10; | |&#10; | expected `SpawnToken&amp;lt;_&amp;gt;`, found `SpawnToken&amp;lt;impl Sized&amp;gt;`&#10; | arguments to this method are incorrect&#10; |&#10; = note: `SpawnToken&amp;lt;impl Sized&amp;gt;` and `SpawnToken&amp;lt;_&amp;gt;` have similar names, but are actually distinct types&#10;note: `SpawnToken&amp;lt;impl Sized&amp;gt;` is defined in crate `embassy_executor`&#10; --&amp;gt; /home/okhsunrog/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embassy-executor-0.6.0/src/spawner.rs:23:1&#10; |&#10;23 | pub struct SpawnToken&amp;lt;S&amp;gt; {&#10; | ^^^^^^^^^^^^^^^^^^^^^^^^&#10;note: `SpawnToken&amp;lt;_&amp;gt;` is defined in crate `embassy_executor`&#10; --&amp;gt; /home/okhsunrog/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embassy-executor-0.5.0/src/spawner.rs:23:1&#10; |&#10;23 | pub struct SpawnToken&amp;lt;S&amp;gt; {&#10; | ^^^^^^^^^^^^^^^^^^^^^^^^&#10; = note: perhaps two different versions of crate `embassy_executor` are being used?&#10;note: method defined here&#10; --&amp;gt; /home/okhsunrog/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embassy-executor-0.5.0/src/spawner.rs:127:12&#10; |&#10;127 | pub fn must_spawn&amp;lt;S&amp;gt;(&amp;amp;self, token: SpawnToken&amp;lt;S&amp;gt;) {&#10; | ^^^^^^^^^^&#10; = note: this error originates in the attribute macro `main` (in Nightly builds, run with -Z macro-backtrace for more info)&#10;&#10;" />
</message>
<message>
<speaker value="ASSISTANT" />
</message>
<message>
<speaker value="HUMAN" />
<text value="create one task, that takes these 2 input pins and uses select to wait for rising edge, then uses info! to print logs&#10;&#10;#![no_std]&#10;#![no_main]&#10;#![feature(type_alias_impl_trait)]&#10;&#10;use defmt::info;&#10;use defmt_rtt as _;&#10;use embassy_executor::Spawner;&#10;use embassy_time::{Duration, Timer};&#10;use esp_backtrace as _;&#10;use esp_hal::{&#10; clock::ClockControl,&#10; peripherals::Peripherals,&#10; prelude::*,&#10; rtc_cntl::Rtc,&#10; system::SystemControl,&#10; timer::{timg::TimerGroup, OneShotTimer},&#10;};&#10;use esp_hal::gpio::{GpioPin, Input, Io, Pull};&#10;use static_cell::make_static;&#10;&#10;#[main]&#10;async fn main(spawner: Spawner) {&#10; let peripherals = Peripherals::take();&#10; let system = SystemControl::new(peripherals.SYSTEM);&#10; let clocks = ClockControl::boot_defaults(system.clock_control).freeze();&#10;&#10; // Enable the RWDT watchdog timer:&#10; let mut rtc = Rtc::new(peripherals.LPWR, None);&#10; rtc.rwdt.set_timeout(2.secs());&#10; rtc.rwdt.enable();&#10; info!(&amp;quot;RWDT watchdog enabled!&amp;quot;);&#10;&#10; // Initialize the SYSTIMER peripheral, and then Embassy:&#10; let timg0 = TimerGroup::new(peripherals.TIMG0, &amp;amp;clocks, None);&#10; let timers = [OneShotTimer::new(timg0.timer0.into())];&#10; let timers = make_static!(timers);&#10;&#10; let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);&#10; let input4: Input&amp;lt;GpioPin&amp;lt;4&amp;gt;&amp;gt; = Input::new(io.pins.gpio4, Pull::Down);&#10; let input5: Input&amp;lt;GpioPin&amp;lt;5&amp;gt;&amp;gt; = Input::new(io.pins.gpio5, Pull::Down);&#10;&#10; esp_hal_embassy::init(&amp;amp;clocks, timers);&#10; info!(&amp;quot;Embassy initialized!&amp;quot;);&#10; &#10; &#10;&#10; // TODO: Spawn some tasks&#10; let _ = spawner;&#10;&#10; // Periodically feed the RWDT watchdog timer when our tasks are not running:&#10; loop {&#10; rtc.rwdt.feed();&#10; Timer::after(Duration::from_secs(1)).await;&#10; }&#10;}&#10;" />
</message>
<message>
<speaker value="ASSISTANT" />
</message>
<message>
<speaker value="HUMAN" />
<text value="create one task, that takes these 2 input pins and uses select to wait for rising edge, then uses info! to print logs&#10;&#10;#![no_std]&#10;#![no_main]&#10;#![feature(type_alias_impl_trait)]&#10;&#10;use defmt::info;&#10;use defmt_rtt as _;&#10;use embassy_executor::Spawner;&#10;use embassy_time::{Duration, Timer};&#10;use esp_backtrace as _;&#10;use esp_hal::{&#10; clock::ClockControl,&#10; peripherals::Peripherals,&#10; prelude::*,&#10; rtc_cntl::Rtc,&#10; system::SystemControl,&#10; timer::{timg::TimerGroup, OneShotTimer},&#10;};&#10;use esp_hal::gpio::{GpioPin, Input, Io, Pull};&#10;use static_cell::make_static;&#10;&#10;#[main]&#10;async fn main(spawner: Spawner) {&#10; let peripherals = Peripherals::take();&#10; let system = SystemControl::new(peripherals.SYSTEM);&#10; let clocks = ClockControl::boot_defaults(system.clock_control).freeze();&#10;&#10; // Enable the RWDT watchdog timer:&#10; let mut rtc = Rtc::new(peripherals.LPWR, None);&#10; rtc.rwdt.set_timeout(2.secs());&#10; rtc.rwdt.enable();&#10; info!(&amp;quot;RWDT watchdog enabled!&amp;quot;);&#10;&#10; // Initialize the SYSTIMER peripheral, and then Embassy:&#10; let timg0 = TimerGroup::new(peripherals.TIMG0, &amp;amp;clocks, None);&#10; let timers = [OneShotTimer::new(timg0.timer0.into())];&#10; let timers = make_static!(timers);&#10;&#10; let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);&#10; let input4: Input&amp;lt;GpioPin&amp;lt;4&amp;gt;&amp;gt; = Input::new(io.pins.gpio4, Pull::Down);&#10; let input5: Input&amp;lt;GpioPin&amp;lt;5&amp;gt;&amp;gt; = Input::new(io.pins.gpio5, Pull::Down);&#10;&#10; esp_hal_embassy::init(&amp;amp;clocks, timers);&#10; info!(&amp;quot;Embassy initialized!&amp;quot;);&#10; &#10; &#10;&#10; // TODO: Spawn some tasks&#10; let _ = spawner;&#10;&#10; // Periodically feed the RWDT watchdog timer when our tasks are not running:&#10; loop {&#10; rtc.rwdt.feed();&#10; Timer::after(Duration::from_secs(1)).await;&#10; }&#10;}&#10;" />
</message>
<message>
<speaker value="ASSISTANT" />
</message>
<message>
<speaker value="HUMAN" />
<text value="create one task, that takes these 2 input pins and uses select to wait for rising edge, then uses info! to print logs&#10;&#10;#![no_std]&#10;#![no_main]&#10;#![feature(type_alias_impl_trait)]&#10;&#10;use defmt::info;&#10;use defmt_rtt as _;&#10;use embassy_executor::Spawner;&#10;use embassy_time::{Duration, Timer};&#10;use esp_backtrace as _;&#10;use esp_hal::{&#10; clock::ClockControl,&#10; peripherals::Peripherals,&#10; prelude::*,&#10; rtc_cntl::Rtc,&#10; system::SystemControl,&#10; timer::{timg::TimerGroup, OneShotTimer},&#10;};&#10;use esp_hal::gpio::{GpioPin, Input, Io, Pull};&#10;use static_cell::make_static;&#10;&#10;#[main]&#10;async fn main(spawner: Spawner) {&#10; let peripherals = Peripherals::take();&#10; let system = SystemControl::new(peripherals.SYSTEM);&#10; let clocks = ClockControl::boot_defaults(system.clock_control).freeze();&#10;&#10; // Enable the RWDT watchdog timer:&#10; let mut rtc = Rtc::new(peripherals.LPWR, None);&#10; rtc.rwdt.set_timeout(2.secs());&#10; rtc.rwdt.enable();&#10; info!(&amp;quot;RWDT watchdog enabled!&amp;quot;);&#10;&#10; // Initialize the SYSTIMER peripheral, and then Embassy:&#10; let timg0 = TimerGroup::new(peripherals.TIMG0, &amp;amp;clocks, None);&#10; let timers = [OneShotTimer::new(timg0.timer0.into())];&#10; let timers = make_static!(timers);&#10;&#10; let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);&#10; let input4: Input&amp;lt;GpioPin&amp;lt;4&amp;gt;&amp;gt; = Input::new(io.pins.gpio4, Pull::Down);&#10; let input5: Input&amp;lt;GpioPin&amp;lt;5&amp;gt;&amp;gt; = Input::new(io.pins.gpio5, Pull::Down);&#10;&#10; esp_hal_embassy::init(&amp;amp;clocks, timers);&#10; info!(&amp;quot;Embassy initialized!&amp;quot;);&#10; &#10; &#10;&#10; // TODO: Spawn some tasks&#10; let _ = spawner;&#10;&#10; // Periodically feed the RWDT watchdog timer when our tasks are not running:&#10; loop {&#10; rtc.rwdt.feed();&#10; Timer::after(Duration::from_secs(1)).await;&#10; }&#10;}&#10; " />
</message>
<message>
<speaker value="ASSISTANT" />
</message>
<message>
<speaker value="HUMAN" />
<text value="create one task, that takes these 2 input pins and uses select to wait for rising edge, then uses info! to print logs&#10;&#10;#![no_std]&#10;#![no_main]&#10;#![feature(type_alias_impl_trait)]&#10;&#10;use defmt::info;&#10;use defmt_rtt as _;&#10;use embassy_executor::Spawner;&#10;use embassy_time::{Duration, Timer};&#10;use esp_backtrace as _;&#10;use esp_hal::{&#10; clock::ClockControl,&#10; peripherals::Peripherals,&#10; prelude::*,&#10; rtc_cntl::Rtc,&#10; system::SystemControl,&#10; timer::{timg::TimerGroup, OneShotTimer},&#10;};&#10;use esp_hal::gpio::{GpioPin, Input, Io, Pull};&#10;use static_cell::make_static;&#10;&#10;#[main]&#10;async fn main(spawner: Spawner) {&#10; let peripherals = Peripherals::take();&#10; let system = SystemControl::new(peripherals.SYSTEM);&#10; let clocks = ClockControl::boot_defaults(system.clock_control).freeze();&#10;&#10; // Enable the RWDT watchdog timer:&#10; let mut rtc = Rtc::new(peripherals.LPWR, None);&#10; rtc.rwdt.set_timeout(2.secs());&#10; rtc.rwdt.enable();&#10; info!(&amp;quot;RWDT watchdog enabled!&amp;quot;);&#10;&#10; // Initialize the SYSTIMER peripheral, and then Embassy:&#10; let timg0 = TimerGroup::new(peripherals.TIMG0, &amp;amp;clocks, None);&#10; let timers = [OneShotTimer::new(timg0.timer0.into())];&#10; let timers = make_static!(timers);&#10;&#10; let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);&#10; let input4: Input&amp;lt;GpioPin&amp;lt;4&amp;gt;&amp;gt; = Input::new(io.pins.gpio4, Pull::Down);&#10; let input5: Input&amp;lt;GpioPin&amp;lt;5&amp;gt;&amp;gt; = Input::new(io.pins.gpio5, Pull::Down);&#10;&#10; esp_hal_embassy::init(&amp;amp;clocks, timers);&#10; info!(&amp;quot;Embassy initialized!&amp;quot;);&#10; &#10; &#10;&#10; // TODO: Spawn some tasks&#10; let _ = spawner;&#10;&#10; // Periodically feed the RWDT watchdog timer when our tasks are not running:&#10; loop {&#10; rtc.rwdt.feed();&#10; Timer::after(Duration::from_secs(1)).await;&#10; }&#10;}&#10; " />
</message>
<message>
<speaker value="ASSISTANT" />
<text value="Certainly! Here's how we can create a single task that monitors both input pins using `select` and prints logs using `info!`:&#10;&#10;```rust&#10;use embassy_futures::select::{select, Either};&#10;&#10;#[embassy_executor::task]&#10;async fn monitor_pins(mut input4: Input&lt;'static, GpioPin&lt;4&gt;&gt;, mut input5: Input&lt;'static, GpioPin&lt;5&gt;&gt;) {&#10; loop {&#10; match select(input4.wait_for_rising_edge(), input5.wait_for_rising_edge()).await {&#10; Either::First(_) =&gt; info!(&quot;Rising edge detected on Pin 4!&quot;),&#10; Either::Second(_) =&gt; info!(&quot;Rising edge detected on Pin 5!&quot;),&#10; }&#10; Timer::after(Duration::from_millis(100)).await;&#10; }&#10;}&#10;&#10;#[main]&#10;async fn main(spawner: Spawner) {&#10; // ... (previous code remains the same)&#10;&#10; let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);&#10; let input4 = Input::new(io.pins.gpio4, Pull::Down);&#10; let input5 = Input::new(io.pins.gpio5, Pull::Down);&#10;&#10; spawner.spawn(monitor_pins(input4, input5)).unwrap();&#10;&#10; // ... (rest of the code remains the same)&#10;}&#10;```&#10;&#10;This implementation creates a single task `monitor_pins` that takes both input pins as parameters. It uses `select` to wait for a rising edge on either pin, then prints the appropriate log message using `info!`. The task is spawned in the `main` function, passing both input pins as arguments." />
</message>
<message>
<speaker value="HUMAN" />
<text value="we have to keep the name of the type in the constants here, right?&#10;embassy tasks can't contain generics&#10;" />
</message>
<message>
<speaker value="ASSISTANT" />
</message>
<message>
<speaker value="HUMAN" />
<text value="we have to keep the name of the type in the constants here, right?&#10;embassy tasks can't contain generics&#10;" />
</message>
<message>
<speaker value="ASSISTANT" />
</message>
<message>
<speaker value="HUMAN" />
<text value="we have to keep the name of the pins in the type here, right?&#10;embassy tasks can't contain generics:&#10;&#10;#[embassy_executor::task]&#10;async fn monitor_pins(&#10; mut input4: Input&amp;lt;'static, GpioPin&amp;lt;4&amp;gt;&amp;gt;,&#10; mut input5: Input&amp;lt;'static, GpioPin&amp;lt;5&amp;gt;&amp;gt;,&#10;) {" />
</message>
<message>
<speaker value="ASSISTANT" />
<text value="Yes, that's correct. In this case, we need to keep the specific pin numbers in the type signatures for `input4` and `input5`. Embassy tasks indeed cannot contain generics, so specifying the exact pin types `GpioPin&lt;4&gt;` and `GpioPin&lt;5&gt;` is the right approach. This ensures type safety and allows the compiler to verify that we're using the correct pins throughout our code." />
</message>
<message>
<speaker value="HUMAN" />
<text value="analog of dracut's install_items+=&amp;quot; /etc/zfs/zroot.key &amp;quot; in mkinitcpio for arch" />
</message>
<message>
<speaker value="ASSISTANT" />
<text value="To achieve the equivalent of dracut's `install_items+=&quot; /etc/zfs/zroot.key &quot;` in mkinitcpio for Arch Linux, you can use the `FILES` array in your mkinitcpio configuration. &#10;&#10;Add the following line to your `/etc/mkinitcpio.conf`:&#10;&#10;```&#10;FILES=(/etc/zfs/zroot.key)&#10;```&#10;&#10;This will include the specified file in your initramfs image. If you need to add multiple files, you can separate them with spaces:&#10;&#10;```&#10;FILES=(/etc/zfs/zroot.key /path/to/another/file)&#10;```&#10;&#10;After making this change, remember to regenerate your initramfs:&#10;&#10;```&#10;mkinitcpio -P&#10;```&#10;&#10;This approach will ensure that your ZFS key file is included in the initramfs, similar to how dracut's `install_items` works." />
</message>
</list>
</messages>
<updatedAt value="2024-08-08T23:29:01.352549629" />
</chat>
</list>
</chats>
</AccountData>
</list>
</accountData>
</component>
</project>

View file

@ -1,6 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="RsUnusedImport" enabled="false" level="WARNING" enabled_by_default="false" />
</profile>
</component>

108
.idea/workspace.xml generated Normal file
View file

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="ALL" />
</component>
<component name="CargoProjects">
<cargoProject FILE="$PROJECT_DIR$/Cargo.toml" />
</component>
<component name="ChangeListManager">
<list default="true" id="7b22105a-0bfb-4392-932c-cec93348d8e9" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/.gitignore" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/cody_history.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.vscode/settings.json" beforeDir="false" afterPath="$PROJECT_DIR$/.vscode/settings.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Cargo.lock" beforeDir="false" afterPath="$PROJECT_DIR$/Cargo.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Cargo.toml" beforeDir="false" afterPath="$PROJECT_DIR$/Cargo.toml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/rust-toolchain.toml" beforeDir="false" afterPath="$PROJECT_DIR$/rust-toolchain.toml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/main.rs" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="RsBuildProfile:dev" />
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="MacroExpansionManager">
<option name="directoryName" value="c4jj78ke" />
</component>
<component name="ProjectColorInfo">{
&quot;customColor&quot;: &quot;&quot;,
&quot;associatedIndex&quot;: 8
}</component>
<component name="ProjectId" id="2llP8G0IC1fHEwEaTUqH1GY9b72" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.rust.reset.selective.auto.import&quot;: &quot;true&quot;,
&quot;git-widget-placeholder&quot;: &quot;main&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;org.rust.cargo.project.model.PROJECT_DISCOVERY&quot;: &quot;true&quot;,
&quot;org.rust.first.attach.projects&quot;: &quot;true&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}
}</component>
<component name="RunManager" selected="Cargo.Run esp_hal_probe">
<configuration name="Run esp_hal_probe" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
<option name="buildProfileId" value="dev" />
<option name="command" value="run --package esp_hal_probe --bin esp_hal_probe" />
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
<envs />
<option name="emulateTerminal" value="true" />
<option name="channel" value="DEFAULT" />
<option name="requiredFeatures" value="true" />
<option name="allFeatures" value="false" />
<option name="withSudo" value="false" />
<option name="buildTarget" value="REMOTE" />
<option name="backtrace" value="SHORT" />
<option name="isRedirectInput" value="false" />
<option name="redirectInputPath" value="" />
<method v="2">
<option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" />
</method>
</configuration>
<configuration name="Test esp_hal_probe" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
<option name="command" value="test --workspace" />
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
<envs />
<option name="emulateTerminal" value="true" />
<option name="channel" value="DEFAULT" />
<option name="requiredFeatures" value="true" />
<option name="allFeatures" value="false" />
<option name="withSudo" value="false" />
<option name="buildTarget" value="REMOTE" />
<option name="backtrace" value="SHORT" />
<option name="isRedirectInput" value="false" />
<option name="redirectInputPath" value="" />
<method v="2">
<option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" />
</method>
</configuration>
</component>
<component name="RustProjectSettings">
<option name="toolchainHomeDirectory" value="/usr/bin" />
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="7b22105a-0bfb-4392-932c-cec93348d8e9" name="Changes" comment="" />
<created>1725751529946</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1725751529946</updated>
<workItem from="1725751530671" duration="64000" />
<workItem from="1725752698276" duration="5000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
</project>

View file

@ -1,10 +1,10 @@
{
"editor.formatOnSave": true,
// Even Better TOML:
"evenBetterToml.formatter.alignComments": true,
"evenBetterToml.formatter.alignEntries": true,
"evenBetterToml.formatter.arrayAutoExpand": true,
"evenBetterToml.formatter.arrayTrailingComma": true,
"evenBetterToml.formatter.reorderArrays": true
}
"evenBetterToml.formatter.reorderArrays": true,
"rust-analyzer.checkOnSave.allTargets": false,
}

374
Cargo.lock generated
View file

@ -3,19 +3,59 @@
version = 3
[[package]]
name = "aho-corasick"
version = "1.1.3"
name = "anstream"
version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526"
dependencies = [
"memchr",
"anstyle",
"anstyle-parse",
"anstyle-query",
"anstyle-wincon",
"colorchoice",
"is_terminal_polyfill",
"utf8parse",
]
[[package]]
name = "anstyle"
version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1"
[[package]]
name = "anstyle-parse"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb"
dependencies = [
"utf8parse",
]
[[package]]
name = "anstyle-query"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a"
dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "anstyle-wincon"
version = "3.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8"
dependencies = [
"anstyle",
"windows-sys 0.52.0",
]
[[package]]
name = "anyhow"
version = "1.0.86"
version = "1.0.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8"
[[package]]
name = "autocfg"
@ -40,9 +80,9 @@ dependencies = [
[[package]]
name = "bitfield"
version = "0.15.0"
version = "0.16.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c821a6e124197eb56d907ccc2188eab1038fb919c914f47976e64dd8dbc855d1"
checksum = "ee8655230d3b9bcaa07b9c013a523afa39d3454e631d32794c8a0df71cb22139"
[[package]]
name = "bitflags"
@ -58,9 +98,9 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
[[package]]
name = "bytemuck"
version = "1.16.3"
version = "1.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "102087e286b4677862ea56cf8fc58bb2cdfa8725c40ffb80fe3a008eb7f2fc83"
checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae"
[[package]]
name = "byteorder"
@ -75,23 +115,56 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "core-isa-parser"
version = "0.2.0"
name = "clap"
version = "4.5.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23ec98e54b735872e54b2335c2e5a5c7fa7d9c3bfd45500f75280f84089a0083"
checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac"
dependencies = [
"anyhow",
"enum-as-inner",
"regex",
"strum 0.24.1",
"strum_macros 0.24.3",
"clap_builder",
"clap_derive",
]
[[package]]
name = "critical-section"
version = "1.1.2"
name = "clap_builder"
version = "4.5.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216"
checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73"
dependencies = [
"anstream",
"anstyle",
"clap_lex",
"strsim",
]
[[package]]
name = "clap_derive"
version = "4.5.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0"
dependencies = [
"heck 0.5.0",
"proc-macro2",
"quote",
"syn 2.0.77",
]
[[package]]
name = "clap_lex"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97"
[[package]]
name = "colorchoice"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0"
[[package]]
name = "critical-section"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f64009896348fc5af4222e9cf7d7d82a95a256c634ebcf61c53e4ea461422242"
[[package]]
name = "darling"
@ -114,7 +187,7 @@ dependencies = [
"proc-macro2",
"quote",
"strsim",
"syn 2.0.72",
"syn 2.0.77",
]
[[package]]
@ -125,7 +198,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806"
dependencies = [
"darling_core",
"quote",
"syn 2.0.72",
"syn 2.0.77",
]
[[package]]
@ -148,7 +221,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn 2.0.72",
"syn 2.0.77",
]
[[package]]
@ -178,7 +251,7 @@ checksum = "4e018fccbeeb50ff26562ece792ed06659b9c2dae79ece77c4456bb10d9bf79b"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.72",
"syn 2.0.77",
]
[[package]]
@ -192,9 +265,9 @@ dependencies = [
[[package]]
name = "embassy-executor"
version = "0.5.0"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec648daedd2143466eff4b3e8002024f9f6c1de4ab7666bb679688752624c925"
checksum = "09ed0e24bdd4a5f4ff1b72ee4f264b1d23e179ea71a77d984b5fd24877a2bbe1"
dependencies = [
"critical-section",
"defmt",
@ -204,14 +277,14 @@ dependencies = [
[[package]]
name = "embassy-executor-macros"
version = "0.4.1"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad454accf80050e9cf7a51e994132ba0e56286b31f9317b68703897c328c59b5"
checksum = "d4d4c0c34b32c2c653c9eecce1cefaf8539dd9a54e61deb5499254f01e2fcac2"
dependencies = [
"darling",
"proc-macro2",
"quote",
"syn 2.0.72",
"syn 2.0.77",
]
[[package]]
@ -309,15 +382,6 @@ dependencies = [
"nb 1.1.0",
]
[[package]]
name = "embedded-dma"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "994f7e5b5cb23521c22304927195f236813053eb9c065dd2226a32ba64695446"
dependencies = [
"stable_deref_trait",
]
[[package]]
name = "embedded-hal"
version = "0.2.7"
@ -377,14 +441,14 @@ dependencies = [
[[package]]
name = "enum-as-inner"
version = "0.4.0"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73"
checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a"
dependencies = [
"heck 0.4.1",
"proc-macro2",
"quote",
"syn 1.0.109",
"syn 2.0.77",
]
[[package]]
@ -405,7 +469,7 @@ dependencies = [
"darling",
"proc-macro2",
"quote",
"syn 2.0.72",
"syn 2.0.77",
]
[[package]]
@ -416,9 +480,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
[[package]]
name = "esp-backtrace"
version = "0.13.0"
version = "0.14.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a34817530dceba397172d6a9fb660b684a73a3a591fbe7fb0da27bed796f270"
checksum = "9c2ff4bce686f28fe48a5d16aaa48c30b627a423bb689be57949bb210b8551d0"
dependencies = [
"defmt",
"esp-build",
@ -432,15 +496,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b94a4b8d74e7cc7baabcca5b2277b41877e039ad9cd49959d48ef94dac7eab4b"
dependencies = [
"quote",
"syn 2.0.72",
"syn 2.0.77",
"termcolor",
]
[[package]]
name = "esp-hal"
version = "0.19.0"
version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe4f8cb6a9dcf0fd4506a856fbb4a0622b92042978c601a23c840c28f621a59f"
checksum = "64f5393b8f7e7f055455d9f86706ddb675f943c12f12a7b80b8a79c3a94233ff"
dependencies = [
"basic-toml",
"bitfield",
@ -456,7 +520,6 @@ dependencies = [
"embassy-usb-driver",
"embassy-usb-synopsys-otg",
"embedded-can",
"embedded-dma",
"embedded-hal 1.0.0",
"embedded-hal-async",
"embedded-hal-nb",
@ -481,16 +544,16 @@ dependencies = [
"rand_core",
"riscv",
"serde",
"strum 0.26.3",
"strum",
"void",
"xtensa-lx-rt",
]
[[package]]
name = "esp-hal-embassy"
version = "0.2.0"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5206e4c63993df6da47fd30432ccc22111bd084ebfd0372afd45202b491e717e"
checksum = "46e47f06e0d7ddf411c3a582ec8fdc4fbc91713aa14bad736618677df0ffb606"
dependencies = [
"cfg-if",
"critical-section",
@ -500,15 +563,17 @@ dependencies = [
"embassy-time-driver",
"esp-build",
"esp-hal",
"esp-hal-procmacros",
"esp-metadata",
"portable-atomic",
"static_cell",
]
[[package]]
name = "esp-hal-procmacros"
version = "0.12.0"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9569ccb286c5a0c39292dbaaa0995bbb2a2a9d671ef3ce807b8b5b3d9a589d35"
checksum = "6eac531546027909a355fc9c2449f22c839955fa4b7f1976b64ddd04b2f22f83"
dependencies = [
"darling",
"document-features",
@ -517,26 +582,28 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn 2.0.72",
"syn 2.0.77",
]
[[package]]
name = "esp-metadata"
version = "0.2.0"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6013420eb303c3087d82c2d2a38944427662b0b07a9ae79e5b1636fc1442e0ba"
checksum = "b471bc61fa817ca4ae41a31d5d453258328b31e5ad82db72b473621d36cc4cb6"
dependencies = [
"anyhow",
"basic-toml",
"clap",
"lazy_static",
"serde",
"strum 0.26.3",
"strum",
]
[[package]]
name = "esp-println"
version = "0.10.0"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58cd4fa834980ba64aad00a5c2c1a630020af984eadef65a125cb99085f6f54c"
checksum = "0d9dd4fc40306450e432cdf104ab00c8f6bd5c4f6c77b76c5fc3024c0e2a535d"
dependencies = [
"esp-build",
]
@ -554,9 +621,9 @@ dependencies = [
[[package]]
name = "esp32"
version = "0.32.0"
version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf4f67907f683a5049ad257cb57a757852bce959eed3e0e8f5e8c212de807714"
checksum = "85287b57fae3e318b62fd860787b1ac85a5e7bf91ad43eb66837c5e567218009"
dependencies = [
"critical-section",
"defmt",
@ -566,9 +633,9 @@ dependencies = [
[[package]]
name = "esp32c2"
version = "0.21.0"
version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "716899095bd30d98a705257470e47383d2e19acece0a14fe0884da029668e4a7"
checksum = "8f9216c7ca4aefe4723d38a765e27801c4e92dec792870403466fc9adb438056"
dependencies = [
"critical-section",
"defmt",
@ -577,9 +644,9 @@ dependencies = [
[[package]]
name = "esp32c3"
version = "0.24.0"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf6865f32b4936b2c396fd1bed3e935850b130282fdcb935af79c2da192cb638"
checksum = "3922cd13da83d070892c47e66f005856c62510952198c3008bc4f3b79f3e9623"
dependencies = [
"critical-section",
"defmt",
@ -588,9 +655,9 @@ dependencies = [
[[package]]
name = "esp32c6"
version = "0.15.0"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5824acf92f8536c997e673113ce704c004f77e154fd550dc511b92d61bb34f6"
checksum = "f0c05e230022cf5a8d10e9bcdc4878c0886a3a5701a96d6763cb42562e42ecd7"
dependencies = [
"critical-section",
"defmt",
@ -599,9 +666,9 @@ dependencies = [
[[package]]
name = "esp32h2"
version = "0.11.0"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99592d177fda6a7756d6e98822b0c30edad8ac55342303beec72f6c073dca4fa"
checksum = "1b05edd3bb766f66180b49c53b3503cf41b72936912a9552462a6a233ccdcac4"
dependencies = [
"critical-section",
"defmt",
@ -610,9 +677,9 @@ dependencies = [
[[package]]
name = "esp32s2"
version = "0.23.0"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3037b677df9ca5e58b278cdf9a68206fd993a5363d5d1f3e067132f75c6a919"
checksum = "9cc0ce1947afdcc4cb74dc8955e1575fcfa38931e0282ed171811dde0afc0fc6"
dependencies = [
"critical-section",
"defmt",
@ -622,9 +689,9 @@ dependencies = [
[[package]]
name = "esp32s3"
version = "0.27.0"
version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7989c8d8e81a0b1037926ccaec6b2ff8bed36b758e6beb9145111ba33892fe6f"
checksum = "eae51703c44196b924910bd8ea7285e5a234d1a5aebcd0b60a997cd5081eb002"
dependencies = [
"critical-section",
"defmt",
@ -737,14 +804,20 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
[[package]]
name = "indexmap"
version = "2.3.0"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0"
checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5"
dependencies = [
"equivalent",
"hashbrown",
]
[[package]]
name = "is_terminal_polyfill"
version = "1.70.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
[[package]]
name = "lazy_static"
version = "1.5.0"
@ -778,9 +851,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
[[package]]
name = "minijinja"
version = "1.0.21"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55e877d961d4f96ce13615862322df7c0b6d169d40cab71a7ef3f9b9e594451e"
checksum = "6d7d3e3a3eece1fa4618237ad41e1de855ced47eab705cec1c9a920e1d1c5aad"
dependencies = [
"serde",
]
@ -832,9 +905,9 @@ checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265"
[[package]]
name = "proc-macro-crate"
version = "3.1.0"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284"
checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b"
dependencies = [
"toml_edit",
]
@ -874,9 +947,9 @@ dependencies = [
[[package]]
name = "quote"
version = "1.0.36"
version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
dependencies = [
"proc-macro2",
]
@ -893,35 +966,6 @@ version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
[[package]]
name = "regex"
version = "1.10.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata",
"regex-syntax",
]
[[package]]
name = "regex-automata"
version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
]
[[package]]
name = "regex-syntax"
version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b"
[[package]]
name = "riscv"
version = "0.11.1"
@ -957,22 +1001,31 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "serde"
version = "1.0.205"
version = "1.0.210"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e33aedb1a7135da52b7c21791455563facbbcc43d0f0f66165b42c21b3dfb150"
checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.205"
version = "1.0.210"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "692d6f5ac90220161d6774db30c662202721e64aed9058d2c394f451261420c1"
checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.72",
"syn 2.0.77",
]
[[package]]
name = "serde_spanned"
version = "0.6.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d"
dependencies = [
"serde",
]
[[package]]
@ -1005,32 +1058,13 @@ version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "strum"
version = "0.24.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f"
[[package]]
name = "strum"
version = "0.26.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06"
dependencies = [
"strum_macros 0.26.4",
]
[[package]]
name = "strum_macros"
version = "0.24.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59"
dependencies = [
"heck 0.4.1",
"proc-macro2",
"quote",
"rustversion",
"syn 1.0.109",
"strum_macros",
]
[[package]]
@ -1043,7 +1077,7 @@ dependencies = [
"proc-macro2",
"quote",
"rustversion",
"syn 2.0.72",
"syn 2.0.77",
]
[[package]]
@ -1059,9 +1093,9 @@ dependencies = [
[[package]]
name = "syn"
version = "2.0.72"
version = "2.0.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af"
checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed"
dependencies = [
"proc-macro2",
"quote",
@ -1094,7 +1128,19 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.72",
"syn 2.0.77",
]
[[package]]
name = "toml"
version = "0.8.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e"
dependencies = [
"serde",
"serde_spanned",
"toml_datetime",
"toml_edit",
]
[[package]]
@ -1102,14 +1148,19 @@ name = "toml_datetime"
version = "0.6.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41"
dependencies = [
"serde",
]
[[package]]
name = "toml_edit"
version = "0.21.1"
version = "0.22.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1"
checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d"
dependencies = [
"indexmap",
"serde",
"serde_spanned",
"toml_datetime",
"winnow",
]
@ -1120,6 +1171,12 @@ version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
[[package]]
name = "utf8parse"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
name = "vcell"
version = "0.1.3"
@ -1144,7 +1201,16 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
dependencies = [
"windows-sys",
"windows-sys 0.59.0",
]
[[package]]
name = "windows-sys"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
"windows-targets",
]
[[package]]
@ -1222,9 +1288,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "winnow"
version = "0.5.40"
version = "0.6.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876"
checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f"
dependencies = [
"memchr",
]
@ -1242,25 +1308,31 @@ dependencies = [
[[package]]
name = "xtensa-lx-rt"
version = "0.16.0"
version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "904102108b780c9a5e3275c5f3c63dc348ec43ae5da5237868515498b447d51a"
checksum = "2ceb69c1487b78d83531c5d94fb81d0dceef1ccb0affba29f29420b1f72d3ddb"
dependencies = [
"anyhow",
"bare-metal",
"core-isa-parser",
"document-features",
"enum-as-inner",
"minijinja",
"r0",
"serde",
"strum",
"toml",
"xtensa-lx",
"xtensa-lx-rt-proc-macros",
]
[[package]]
name = "xtensa-lx-rt-proc-macros"
version = "0.2.1"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "082cdede098bbec9af15b0e74085e5f3d16f2923597de7aed7b8112003af2da7"
checksum = "11277b1e4cbb7ffe44678c668518b249c843c81df249b8f096701757bc50d7ee"
dependencies = [
"darling",
"proc-macro2",
"quote",
"syn 2.0.72",
"syn 2.0.77",
]

View file

@ -5,15 +5,15 @@ edition = "2021"
rust-version = "1.76.0"
[dependencies]
defmt = "0.3.8"
defmt-rtt = "0.4.1"
embassy-executor = { version = "0.5.0", features = ["defmt"] }
embassy-time = { version = "0.3.1", features = ["generic-queue-8"] }
embassy-futures = "0.1.1"
esp-backtrace = { version = "0.13.0", features = ["esp32c3", "defmt", "exception-handler", "panic-handler"] }
esp-hal = { version = "0.19.0", features = ["esp32c3", "defmt", "async"] }
esp-hal-embassy = { version = "0.2.0", features = ["esp32c3", "defmt"] }
static_cell = { version = "2.1.0", features = ["nightly"] }
defmt = "0.3"
defmt-rtt = "0.4"
embassy-executor = { version = "0.6", features = ["defmt"] }
embassy-time = { version = "0.3", features = ["generic-queue-8"] }
embassy-futures = "0.1"
esp-backtrace = { version = "0.14", features = ["esp32c3", "defmt", "exception-handler", "panic-handler"] }
esp-hal = { version = "0.20", features = ["esp32c3", "defmt", "async"] }
esp-hal-embassy = { version = "0.3", features = ["esp32c3", "defmt"] }
static_cell = { version = "2.1", features = ["nightly"] }
[profile.release]
debug = true # Debug info is useful, and does not affect the size of the final binary

View file

@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2024-06-01"
channel = "nightly"
components = ["rust-src"]
targets = ["riscv32imc-unknown-none-elf"]

View file

@ -1,42 +1,40 @@
#![no_std]
#![no_main]
#![feature(type_alias_impl_trait)]
use defmt::info;
use defmt_rtt as _;
use embassy_executor::Spawner;
use embassy_futures::select::{select, Either};
use embassy_time::{Duration, Timer};
use esp_backtrace as _;
use esp_hal::{
clock::ClockControl,
gpio::{GpioPin, Input, Io, Pull},
peripherals::Peripherals,
prelude::*,
system::SystemControl,
timer::{timg::TimerGroup, OneShotTimer},
timer::timg::TimerGroup,
};
use static_cell::make_static;
#[main]
async fn main(_spawner: Spawner) {
#[embassy_executor::task]
async fn run() {
loop {
info!("Hello world from embassy using esp-hal-async!");
Timer::after(Duration::from_millis(1_000)).await;
}
}
#[esp_hal_embassy::main]
async fn main(spawner: Spawner) {
info!("Init!");
let peripherals = Peripherals::take();
let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
// Initialize the SYSTIMER peripheral, and then Embassy:
let timg0 = TimerGroup::new(peripherals.TIMG0, &clocks, None);
let timers = make_static!([OneShotTimer::new(timg0.timer0.into())]);
esp_hal_embassy::init(&clocks, timers);
info!("Embassy initialized!");
let timg0 = TimerGroup::new(peripherals.TIMG0, &clocks);
esp_hal_embassy::init(&clocks, timg0.timer0);
let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
let mut input4: Input<GpioPin<4>> = Input::new(io.pins.gpio4, Pull::None);
let mut input5: Input<GpioPin<5>> = Input::new(io.pins.gpio5, Pull::None);
spawner.spawn(run()).ok();
loop {
match select(input4.wait_for_rising_edge(), input5.wait_for_rising_edge()).await {
Either::First(_) => info!("Rising edge detected on Pin 4!"),
Either::Second(_) => info!("Rising edge detected on Pin 5!"),
}
// info!("Bing!");
Timer::after(Duration::from_millis(5_000)).await;
}
}