esp-rs/esp-hal

Something broke in f11c18a6b93eb54e02494fa4df2a2941dcd5b44f

Closed this issue · 2 comments

Commit f11c18a broke something

Here is the repro: https://github.com/bjoernQ/rust-esp32s3-ili9341/blob/borked/

The commit before works

Minimal repro:

//! Blinks an LED
//!
//! The following wiring is assumed:
//! - LED => GPIO0

//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3


#![no_std]
#![no_main]

use esp_backtrace as _;
use esp_hal::{
    delay::Delay,
    gpio::{Io, Level, Output},
    prelude::*,
};

#[entry]
fn main() -> ! {
    let peripherals = esp_hal::init(esp_hal::Config::default());

    // Set GPIO0 as an output, and set its state high initially.
    let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
    let mut led = Output::new(io.pins.gpio4, Level::High);

    let delay = Delay::new();

    loop {
        set(&mut led, true);
        delay.delay_millis(50);
        set(&mut led, false);
        delay.delay_millis(50);
    }
}

fn set<T>(pin: &mut T, state: bool) where T: embedded_hal_02::digital::v2::OutputPin {
    if state {
        pin.set_high().ok();
    } else {
        pin.set_low().ok();
    }
}

The level stays high in the example - eh1.0 seems to be fine