~ruther/map-led-strip

82dcc6ffe0e37b6226c262897b834c77980b2a6e — František Boháček 1 year, 9 months ago 5660da0
feat: add serial to main
1 files changed, 22 insertions(+), 0 deletions(-)

M src/main.rs
M src/main.rs => src/main.rs +22 -0
@@ 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);


Do not follow this link