@@ 4,8 4,11 @@
mod strip;
use embedded_hal::serial::{Read, Write};
use esp_backtrace as _;
+use esp_println::println;
use hal::{clock::ClockControl, pulse_control::{ClockSource}, peripherals::Peripherals, prelude::*, timer::{TimerGroup, Timer, Timer0}, Rtc, IO, Delay, interrupt, PulseControl, Uart};
use hal::uart::config::{Config, DataBits, Parity, StopBits};
+use hal::uart::TxRxPins;
+use nb::block;
use nb::Error::{WouldBlock, Other};
use smart_leds::{RGB8, SmartLedsWrite};
use crate::strip::StripTiming;
@@ 38,6 41,25 @@ fn main() -> ! {
wdt1.disable();
let io = IO::new(peripherals.GPIO, peripherals.IO_MUX);
+ let pins = TxRxPins::new_tx_rx(
+ io.pins.gpio1.into_push_pull_output(),
+ io.pins.gpio3.into_floating_input(),
+ );
+
+ let config = Config {
+ baudrate: 115200,
+ data_bits: DataBits::DataBits8,
+ parity: Parity::ParityNone,
+ stop_bits: StopBits::STOP1,
+ };
+
+ let mut serial = Uart::new_with_config(
+ peripherals.UART0,
+ Some(config),
+ Some(pins),
+ &clocks,
+ &mut system.peripheral_clock_control,
+ );
let mut delay = Delay::new(&clocks);