diff --git a/bluepill-rs/src/dmx.rs b/bluepill-rs/src/dmx.rs index 01d8400..d5cbba8 100644 --- a/bluepill-rs/src/dmx.rs +++ b/bluepill-rs/src/dmx.rs @@ -6,7 +6,7 @@ type TxDma = dma::TxDma, dma::dma1::C4>; type DMXUniverse = &'static mut [u8; DMX_LEN]; type DMXTransfer = dma::Transfer, TxDma>; -pub enum DMX { +pub enum DMX { Idle(Option, Option>), Busy(Option>), } @@ -20,6 +20,8 @@ impl DMX { where PINS: serial::Pins, { + assert!(DMX_LEN <= DMX_LEN_MAX); + serial.reconfigure(250_000.bps(), &clocks).unwrap(); Self::Idle(Some(serial.tx.with_dma(channel)), None)