periph: set led pin to 0

This commit is contained in:
decentclock
2022-10-13 12:50:46 -04:00
parent 9bafe5f0eb
commit 7de8a6192f
3 changed files with 5 additions and 5 deletions

View File

@@ -7,7 +7,7 @@ use std::time::Duration;
pub fn set_ota_led() {
let peripherals = Peripherals::take().unwrap();
let led = peripherals.pins.gpio4.into_output().unwrap();
let led = peripherals.pins.gpio0.into_output().unwrap();
let channel = peripherals.rmt.channel0;
let config = TransmitConfig::new().clock_divider(1);
let mut tx = Transmit::new(led, channel, &config).unwrap();

View File

@@ -43,7 +43,7 @@ fn main() -> Result<()> {
let (led_tx, led_rx) = mpsc::channel();
// LED control thread
led_control_loop(pins.gpio4, peripherals.rmt.channel0, led_rx);
led_control_loop(pins.gpio0, peripherals.rmt.channel0, led_rx);
led_tx.send(Status::MountingSDCard).unwrap();
println!("About to mount the sdcard...");

View File

@@ -33,11 +33,11 @@ fn states() -> BTreeMap<Status, (Color, Time)> {
}
pub fn led_control_loop(
gpio4: gpio::Gpio4<gpio::Unknown>,
gpio0: gpio::Gpio0<gpio::Unknown>,
channel0: rmt::CHANNEL0,
rx: mpsc::Receiver<Status>,
) {
let led = gpio4.into_output().unwrap();
let led = gpio0.into_output().unwrap();
let config = TransmitConfig::new().clock_divider(1);
let transmit = Arc::new(Mutex::new(Transmit::new(led, channel0, &config).unwrap()));
thread::spawn(move || {
@@ -71,7 +71,7 @@ impl Led {
pub fn blink(
&mut self,
transmit: Arc<Mutex<Transmit<gpio::Gpio4<gpio::Output>, rmt::CHANNEL0>>>,
transmit: Arc<Mutex<Transmit<gpio::Gpio0<gpio::Output>, rmt::CHANNEL0>>>,
) {
// Prepare signal
let mut tx = transmit.lock().unwrap();