mirror of
https://github.com/stakwork/sphinx-key.git
synced 2026-02-01 05:44:19 +01:00
periph: set led pin to 0
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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...");
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user