SAMD51: animations vs. blocking operations

Viewed 58

I am using this Adafruit_Protomatter library with an Adafruit MatrixPortal M4 and PlatformIO. Since I do blocking HTTP requests with WiFiNINA (adafruit fork), I thought I can update the matrix in an timer interrupt to be able to do a scollable text.

I am using the SAMD_TimerInterrupt library for the interrupts:

SAMDTimer ITimer0(TIMER_TC3);

Unfortunately, the program execution crashes if I call matrix.show() in the TimerHandler. The setCursor() and print() methods do not lead to a crash and I don't know why.

void TimerHandler0()
{
   static uint32_t curMillis = 0;

   curMillis = millis();
   if (curMillis > TIMER0_INTERVAL_MS)
   {
     matrix.fillScreen(0);
     matrix.setCursor(textX, textY);
     matrix.print(str);
     if ((--textX) < textMin)
        textX = matrix.width();
     matrix.show();
   }
   preMillisTimer0 = curMillis; 
}

Maybe there is a better way of doing HTTP requests/blocking operations during an scrolltext? I was not able to find a way of doing e.g. async http requests with the MatrixPortal...

Thanks in advance and best regards, Daniel

0 Answers
Related