diff --git a/Makefile b/Makefile index 781452d..6915960 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ protodemo: protodemo.c piolib/*.c include/piomatter/*.h include/piomatter/protomatter.pio.h Makefile - g++ -std=c++20 -O0 -ggdb -x c++ -Iinclude -Ipiolib/include -o $@ $(filter %.c, $^) -Wno-narrowing + g++ -std=c++20 -O3 -ggdb -x c++ -Iinclude -Ipiolib/include -o $@ $(filter %.c, $^) -Wno-narrowing matrixmap.h: diff --git a/include/piomatter/piomatter.h b/include/piomatter/piomatter.h index 80cfaad..1114c74 100644 --- a/include/piomatter/piomatter.h +++ b/include/piomatter/piomatter.h @@ -12,7 +12,7 @@ namespace piomatter { -constexpr size_t MAX_XFER = 32768; +constexpr size_t MAX_XFER = 65532; void pio_sm_xfer_data_large(PIO pio, int sm, int direction, size_t size, uint32_t *databuf) { while(size) { @@ -52,6 +52,17 @@ struct piomatter : piomatter_base { ~piomatter() { if (pio != NULL && sm >= 0) { + + pin_deinit_one(pinout::PIN_OE); + pin_deinit_one(pinout::PIN_CLK); + pin_deinit_one(pinout::PIN_LAT); + + for(const auto p : pinout::PIN_RGB) + pin_deinit_one(p); + + for(size_t i=0; i