Compare commits

...

3 commits

Author SHA1 Message Date
Phillip Burgess
2c070c8640 Fix chunk counter type for long chains 2023-08-03 18:21:27 -07:00
Phillip Burgess
b4788466de M4: better CLK duty cycle 2023-08-03 16:22:48 -07:00
Phillip Burgess
7bd6440c14 Adjust NOPs on M4 for new matrices 2023-08-03 15:02:09 -07:00
2 changed files with 9 additions and 9 deletions

View file

@ -198,17 +198,17 @@ uint32_t _PM_timerStop(Protomatter_core *core) {
// See notes in core.c before the "blast" functions // See notes in core.c before the "blast" functions
#if F_CPU >= 200000000 #if F_CPU >= 200000000
#define _PM_clockHoldHigh asm("nop; nop; nop; nop; nop"); #define _PM_clockHoldHigh asm("nop; nop");
#define _PM_clockHoldLow asm("nop; nop"); #define _PM_clockHoldLow asm("nop; nop; nop; nop; nop");
#elif F_CPU >= 180000000 #elif F_CPU >= 180000000
#define _PM_clockHoldHigh asm("nop; nop; nop; nop"); #define _PM_clockHoldHigh asm("nop; nop");
#define _PM_clockHoldLow asm("nop"); #define _PM_clockHoldLow asm("nop; nop; nop; nop");
#elif F_CPU >= 150000000 #elif F_CPU >= 150000000
#define _PM_clockHoldHigh asm("nop; nop; nop"); #define _PM_clockHoldHigh asm("nop");
#define _PM_clockHoldLow asm("nop"); #define _PM_clockHoldLow asm("nop; nop; nop");
#else #else
#define _PM_clockHoldHigh asm("nop; nop; nop"); #define _PM_clockHoldHigh asm("nop");
#define _PM_clockHoldLow asm("nop"); #define _PM_clockHoldLow asm("nop; nop");
#endif #endif
#define _PM_minMinPeriod 160 #define _PM_minMinPeriod 160

View file

@ -726,7 +726,7 @@ IRAM_ATTR static void blast_byte(Protomatter_core *core, uint8_t *data) {
_PM_PORT_TYPE rgbclock = core->rgbAndClockMask; // RGB + clock bit _PM_PORT_TYPE rgbclock = core->rgbAndClockMask; // RGB + clock bit
#endif #endif
_PM_PORT_TYPE clock = core->clockMask; // Clock bit _PM_PORT_TYPE clock = core->clockMask; // Clock bit
uint8_t chunks = (core->chainBits + (_PM_chunkSize - 1)) / _PM_chunkSize; uint16_t chunks = (core->chainBits + (_PM_chunkSize - 1)) / _PM_chunkSize;
// PORT has already been initialized with RGB data + clock bits // PORT has already been initialized with RGB data + clock bits
// all LOW, so we don't need to initialize that state here. // all LOW, so we don't need to initialize that state here.