Closed alvaroarenas closed 2 years ago
UPDATE: I think the bug is in the library. I modified the blinky example as below and the light stays constant
loop {
led.toggle().unwrap();
delay(CORE_HZ);
led.toggle().unwrap();
delay(CORE_HZ);
}
I had recently fixed this same issue in esp-idf-hal
as well, forgot to submit the changes here:
https://github.com/esp-rs/esp-idf-hal/pull/18/files
I will open a PR later today or this week addressing this.
Hi there,
I am new to Rust and I started playing with my ESP32. I am trying to toggle a led connected to gpio2 by messaging between threads using
mpsc::channel
. I noticed that although I toggle the pin theis_set_high()
always returnsfalse
.I am using the code below. Which does toggle the led because it uses
counter
to keep the state. But I would like to use the state the gpio has, so that I can use multiple threads. I tried initiating the led pin outside the thread and moving it with an Arc<Mutex<>> with the same result. What am I doing wrong ? or could it be that there is a bug in the library implementation?I am using esp32-hal version 0.3.0.