jostlowe / Pico-DMX

A library for inputting and outputting the DMX512-A lighting control protocol from a Raspberry Pi Pico
BSD 3-Clause "New" or "Revised" License
193 stars 22 forks source link

Fix DMX input not working when DMA channels are already in use before #11

Closed kripton closed 2 years ago

kripton commented 2 years ago

There's a small glitch in the DMX input code: When either DMA channels are in use before configuring a DmxInput instance, the read will fail. Reason is that not the DMA channel was given to dma_channel_set_irq0_enabled but instead the number of the state machine. In the examples, those were identical by accident. In the real world, they might not always be.