File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -774,7 +774,12 @@ void RGBmatrixPanel::updateDisplay(void) {
774
774
while (TIMER->COUNT16 .STATUS .bit .SYNCBUSY );
775
775
#endif // SAMD21
776
776
#elif defined(ARDUINO_ARCH_ESP32)
777
- timer_set_alarm_value (TIMER_GROUP_1, TIMER_0, duration);
777
+ static timg_dev_t *TG[2 ] = {&TIMERG0, &TIMERG1};
778
+ static portMUX_TYPE timer_spinlock[TIMER_GROUP_MAX] = {portMUX_INITIALIZER_UNLOCKED, portMUX_INITIALIZER_UNLOCKED};
779
+ portENTER_CRITICAL (&timer_spinlock[TIMER_GROUP_1]);
780
+ TG[TIMER_GROUP_1]->hw_timer [TIMER_0].alarm_high = (uint32_t ) (duration >> 32 );
781
+ TG[TIMER_GROUP_1]->hw_timer [TIMER_0].alarm_low = (uint32_t ) duration;
782
+ portEXIT_CRITICAL (&timer_spinlock[TIMER_GROUP_1]);
778
783
#endif // ARDUINO_ARCH_SAMD
779
784
*oeport &= ~oemask; // Re-enable output
780
785
*latport &= ~latmask; // Latch down
You can’t perform that action at this time.
0 commit comments