Teensyduino 1.58 Beta #3

You can change teensyduino versions in the Boards manager. Second icon down on the left edge of main window opens that.
Pull the scroll bar way down and you will find "Teensy by Paul Stoffregen". It should show, by your post, Version 1.57.2 installed.
At the bottom of that block is a pull=down menu, from that you can select 0.58.3 (the latest beta) and click on the install button below it.
The IDE takes care of the rest. You can do the same thing to revert to 1.57.2 later if you decide.

Just be aware that because the beta version number is lower than the latest version, the IDE will tell you you have board updates available, if you click on install it will put you back on 1.57.2

- Wes, W5ZZO
 
I'm considering wrapping up what we have now as version 1.58. The main idea is publishing the new toolchain, updates for MacOS Ventura, and some bug fixes.... but intentionally not putting many new features into 1.58 so it can be pretty much a toolchain update.

Are there any really serious low-risk-to-fix bugs to be fixed last minute? I saw conversation about USB host mass storage. Anything else in dire need of getting into a stable release?
 
I'm considering wrapping up what we have now as version 1.58. The main idea is publishing the new toolchain, updates for MacOS Ventura, and some bug fixes.... but intentionally not putting many new features into 1.58 so it can be pretty much a toolchain update.

Are there any really serious low-risk-to-fix bugs to be fixed last minute? I saw conversation about USB host mass storage. Anything else in dire need of getting into a stable release?
I don't have much of anything:
Audio library, there were two different PRs to allow one to play a wav file from all Filesystems, not hard coded to SD... Again not overly critical.

Cores: Looks like you have several PRs to fix some of the warning messages, which you may or may not want to look through.

USBHost_t36: as you mentioned the one by @wwatson. There may also be some for the different compiler warnings.

Also #111 appears to add a little safety checking in the MassStorageDriver.cpp that checks to see if the create of the pip fails.
They maybe should have deleted teh first pipe when the 2nd one fails...

#82 - adds a new VID/PID to Serial code for CP320X...

#109 - Antplus hang fix. Only run through the list so many attempts.

Some others are older and probably more complex

FlexIO
I think there was a FlexIO one you already picked up.
 
Building for USB type - midi

Does it work? Note: I know almost nothing about midi, nor use it at all.

But tried opening the TransmitEverything.ino example sketch on a couple of day old Arduino 2 nightly build.
Board type: Micromod
Configured for USB Type: Midi
Windows 11.

Tried a build and it failed in the link:
Code:
c:/users/kurte/appdata/local/arduino15/packages/teensy/tools/teensy-compile/11.3.1-beta2/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\kurte\AppData\Local\Temp\arduino\sketches\34A3E2B5E32FE77675868481EB9FE5FF\sketch\TransmitEverything.ino.cpp.o: in function `usb_midi_class::send(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)':
C:\Users\kurte\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.58.3\cores\teensy4/usb_midi.h:245: undefined reference to `usb_midi_write_packed'
c:/users/kurte/appdata/local/arduino15/packages/teensy/tools/teensy-compile/11.3.1-beta2/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\kurte\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.58.3\cores\teensy4/usb_midi.h:245: undefined reference to `usb_midi_write_packed'
c:/users/kurte/appdata/local/arduino15/packages/teensy/tools/teensy-compile/11.3.1-beta2/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\kurte\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.58.3\cores\teensy4/usb_midi.h:245: undefined reference to `usb_midi_write_packed'
c:/users/kurte/appdata/local/arduino15/packages/teensy/tools/teensy-compile/11.3.1-beta2/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\kurte\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.58.3\cores\teensy4/usb_midi.h:245: undefined reference to `usb_midi_write_packed'
c:/users/kurte/appdata/local/arduino15/packages/teensy/tools/teensy-compile/11.3.1-beta2/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\kurte\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.58.3\cores\teensy4/usb_midi.h:245: undefined reference to `usb_midi_write_packed'
c:/users/kurte/appdata/local/arduino15/packages/teensy/tools/teensy-compile/11.3.1-beta2/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\kurte\AppData\Local\Temp\arduino\sketches\34A3E2B5E32FE77675868481EB9FE5FF\sketch\TransmitEverything.ino.cpp.o:C:\Users\kurte\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.58.3\cores\teensy4/usb_midi.h:245: more undefined references to `usb_midi_write_packed' follow
c:/users/kurte/appdata/local/arduino15/packages/teensy/tools/teensy-compile/11.3.1-beta2/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\kurte\AppData\Local\Temp\arduino\sketches\34A3E2B5E32FE77675868481EB9FE5FF\sketch\TransmitEverything.ino.cpp.o: in function `usb_midi_class::sendSysEx(unsigned long, unsigned char const*, bool, unsigned char)':
C:\Users\kurte\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.58.3\cores\teensy4/usb_midi.h:175: undefined reference to `usb_midi_send_sysex_add_term_bytes'
c:/users/kurte/appdata/local/arduino15/packages/teensy/tools/teensy-compile/11.3.1-beta2/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\kurte\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.58.3\cores\teensy4/usb_midi.h:173: undefined reference to `usb_midi_send_sysex_buffer_has_term'
c:/users/kurte/appdata/local/arduino15/packages/teensy/tools/teensy-compile/11.3.1-beta2/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\kurte\AppData\Local\Temp\arduino\sketches\34A3E2B5E32FE77675868481EB9FE5FF\sketch\TransmitEverything.ino.cpp.o: in function `usb_midi_class::send(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)':
C:\Users\kurte\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.58.3\cores\teensy4/usb_midi.h:245: undefined reference to `usb_midi_write_packed'
c:/users/kurte/appdata/local/arduino15/packages/teensy/tools/teensy-compile/11.3.1-beta2/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\kurte\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.58.3\cores\teensy4/usb_midi.h:245: undefined reference to `usb_midi_write_packed'
c:/users/kurte/appdata/local/arduino15/packages/teensy/tools/teensy-compile/11.3.1-beta2/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\kurte\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.58.3\cores\teensy4/usb_midi.h:245: undefined reference to `usb_midi_write_packed'
c:/users/kurte/appdata/local/arduino15/packages/teensy/tools/teensy-compile/11.3.1-beta2/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\kurte\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.58.3\cores\teensy4/usb_midi.h:245: undefined reference to `usb_midi_write_packed'
c:/users/kurte/appdata/local/arduino15/packages/teensy/tools/teensy-compile/11.3.1-beta2/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\kurte\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.58.3\cores\teensy4/usb_midi.h:245: undefined reference to `usb_midi_write_packed'
c:/users/kurte/appdata/local/arduino15/packages/teensy/tools/teensy-compile/11.3.1-beta2/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\kurte\AppData\Local\Temp\arduino\sketches\34A3E2B5E32FE77675868481EB9FE5FF\sketch\TransmitEverything.ino.cpp.o:C:\Users\kurte\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.58.3\cores\teensy4/usb_midi.h:245: more undefined references to `usb_midi_write_packed' follow
c:/users/kurte/appdata/local/arduino15/packages/teensy/tools/teensy-compile/11.3.1-beta2/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\kurte\AppData\Local\Temp\arduino\sketches\34A3E2B5E32FE77675868481EB9FE5FF\sketch\TransmitEverything.ino.cpp.o: in function `usb_midi_class::read(unsigned char)':
C:\Users\kurte\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.58.3\cores\teensy4/usb_midi.h:263: [COLOR="#FF0000"]undefined reference to `usb_midi_read'[/COLOR]

collect2.exe: error: ld returned 1 exit status

I will try it on a different machine (Ubuntu 22.04), but wondering if it works for others?
 
I am currently trying to solve a MIDI problem, it is with 1.57.2 I have tested so far.

The problem is that the LaunchControl XL sends the slider and potentiometer positions at startup, immediately after power on. If slider(s) are fully up (value 127) they get value 0, if they are just slightly down (like 126) they get correct value.

This happens only at power up. if I disconnect and connect the USB it gets them correctly. I have been verifying my code and find nothing wrong, also discussing with Novation.

Currently I suspect there is something that goes wrong with USBHost_t36.h at power up, with MIDI. This is how I read the incoming data.

Code:
void processUSBhostMIDI() {
  uint8_t type, channel, data1, data2, cable, CC_element, Note_element;

  // MIDI message, defined by these 5 numbers (except SysEX)
  type    = USBhostMIDI[LCXL1.port].getType();      // MIDI message, 128-255
  channel = USBhostMIDI[LCXL1.port].getChannel();   // MIDI channel, 1-16
  data1   = USBhostMIDI[LCXL1.port].getData1();     // first data byte, 0-127
  data2   = USBhostMIDI[LCXL1.port].getData2();     // second data byte, 0-127
  cable   = USBhostMIDI[LCXL1.port].getCable();     // which virtual cable with MIDIx8, 0-7
  
  
    switch (type) {

      
  case 0xB0:
             {
              if(data1 >= 13 && data1 <=20){ LCXL_Controls[data1 - 12].SendA        = data2; LCXL_Controls[data1 - 12].updated = true; } 
              if(data1 >= 29 && data1 <=36){ LCXL_Controls[data1 - 28].SendB        = data2; LCXL_Controls[data1 - 28].updated = true; }
              if(data1 >= 49 && data1 <=56){ LCXL_Controls[data1 - 48].Pan_Device   = data2; LCXL_Controls[data1 - 48].updated = true; }
              if(data1 >= 77 && data1 <=84){ LCXL_Controls[data1 - 76].Slider       = data2; LCXL_Controls[data1 - 76].updated = true; }

              if(data1 == 104 ){ LCXL_Select.SendSelectUp     = data2; LCXL_Select.updated = true; }
              if(data1 == 105 ){ LCXL_Select.SendSelectDown   = data2; LCXL_Select.updated = true; }
              if(data1 == 106 ){ LCXL_Select.TrackSelectLeft  = data2; LCXL_Select.updated = true; }
              if(data1 == 107 ){ LCXL_Select.TrackSelectRight = data2; LCXL_Select.updated = true; }

             } break;

After power when sliders are moved all works perfect. also reading slider 127. A simple demo, this maps the controls to control the LEDs, just to test. https://youtube.com/shorts/KL92lL4lBfY?feature=share This demonstrates the problem https://youtube.com/shorts/FEitLntxIrI?feature=share when slider is fully up the 2 bottom LEDs should be red. the knobs do not have this problem.
 
It would be nice if the audio examples that reference the SD card are fixed so that they at least mention the defaults for Teensy 4.0/4.1. Preferably it would make the defaults for Teensy 4.x be the default since realistically Teensy 3.2, 3.5, and 3.6 are going to be scarce if not unobtainable for quite some time. It is getting tiresome whenever I point people to the examples and then I have to say, you have to edit the source (and said source doesn't even mention Teensy 4.0).

For example, audio -> HardwareTesting -> SD_CARD -> SdCardTest has:

Code:
// Use these with the Teensy Audio Shield
#define SDCARD_CS_PIN    10
#define SDCARD_MOSI_PIN  7
#define SDCARD_SCK_PIN   14

// Use these with the Teensy 3.5 & 3.6 SD card
//#define SDCARD_CS_PIN    BUILTIN_SDCARD
//#define SDCARD_MOSI_PIN  11  // not actually used
//#define SDCARD_SCK_PIN   13  // not actually used

// Use these for the SD+Wiz820 or other adaptors
//#define SDCARD_CS_PIN    4
//#define SDCARD_MOSI_PIN  11
//#define SDCARD_SCK_PIN   13

I think this should be replaced by:

Code:
// Use these with the Teensy Audio Shield
#if defined(ARDUINO_TEENSY40) || defined(ARDUINO_TEENSY41)
#define SDCARD_CS_PIN    10
#define SDCARD_MOSI_PIN  11
#define SDCARD_SCK_PIN   13

#else /* Teensy 3.x Audio Shield  */
#define SDCARD_CS_PIN    10
#define SDCARD_MOSI_PIN  7
#define SDCARD_SCK_PIN   14
#endif

// Use these with the Teensy 3.5, 3.6, and 4.1 SD card
//#define SDCARD_CS_PIN    BUILTIN_SDCARD
//#define SDCARD_MOSI_PIN  11  // not actually used
//#define SDCARD_SCK_PIN   13  // not actually used

// Use these for the SD+Wiz820 or other adaptors
//#define SDCARD_CS_PIN    4
//#define SDCARD_MOSI_PIN  11
//#define SDCARD_SCK_PIN   13
 
Was going to start a new thread but I am curious about MIDI as well. Wanted to experiment a little bit with MIDI and USBHost so I loaded the transmit example from Using USB MIDI on a Teensy 4.1:
Code:
#include <Bounce.h>  // Bounce library makes button change detection easy
const int channel = 1;

Bounce button1 = Bounce(1, 5);  // 5 = 5 ms debounce time
Bounce button2 = Bounce(2, 5);  // which is appropriate for good
Bounce button3 = Bounce(3, 5);  // quality mechanical pushbuttons
void setup() {
  pinMode(1, INPUT_PULLUP);
  pinMode(2, INPUT_PULLUP);
  pinMode(3, INPUT_PULLUP);
}

void loop() {
  button1.update();
  button2.update();
  button3.update();
  // Note On messages when each button is pressed
  if (button1.fallingEdge()) {
    usbMIDI.sendNoteOn(60, 99, channel);  // 60 = C4
  }
  if (button2.fallingEdge()) {
    usbMIDI.sendNoteOn(61, 99, channel);  // 61 = C#4
  }
  if (button3.fallingEdge()) {
    usbMIDI.sendNoteOn(62, 99, channel);  // 62 = D4
  }
  // Note Off messages when each button is released
  if (button1.risingEdge()) {
    usbMIDI.sendNoteOff(60, 0, channel);  // 60 = C4
  }
  if (button2.risingEdge()) {
    usbMIDI.sendNoteOff(61, 0, channel);  // 61 = C#4
  }
  if (button3.risingEdge()) {
    usbMIDI.sendNoteOff(62, 0, channel);  // 62 = D4
  }

  // MIDI Controllers should discard incoming MIDI messages.
  while (usbMIDI.read()) {
  }
}
then on a Teensy MicroMod modified the receive note example to use USBHost:
Code:
// USB MIDI receive example, Note on/off -> LED on/off
// contributed by Alessandro Fasan
#include "USBHost_t36.h"
USBHost myusb;
USBHub hub1(myusb);
USBHub hub2(myusb);
USBHub hub3(myusb);
MIDIDevice midi1(myusb);

int ledPin = 13;

void OnNoteOn(byte channel, byte note, byte velocity) {
  digitalWrite(ledPin, HIGH); // Any Note-On turns on LED
  Serial.println("LED ON");
}

void OnNoteOff(byte channel, byte note, byte velocity) {
  digitalWrite(ledPin, LOW);  // Any Note-Off turns off LED
  Serial.println("LED Off");

}

void setup() {
  pinMode(ledPin, OUTPUT);
  midi1.setHandleNoteOff(OnNoteOff);
  midi1.setHandleNoteOn(OnNoteOn) ;
  digitalWrite(ledPin, HIGH);
  delay(400);                 // Blink LED once at startup
  digitalWrite(ledPin, LOW);
}

void loop() {
  midi1.read();
}

I tested the code on the teensy 4.1 using MIDI-OX
Code:
 ===> MIDI-OX Version: 7.0.2.372
 ===> Log Opened: Tue 28-Mar-2023 17:22:29 ===>
 TIMESTAMP IN PORT STATUS DATA1 DATA2 CHAN NOTE EVENT               
 0000B6A4   1  --     90    3E    63    1  D  4 Note On               
 0000B827   1  --     80    3E    00    1  D  4 Note Off              
 0000BB37   1  --     90    3D    63    1  C# 4 Note On               
 0000BCB4   1  --     80    3D    00    1  C# 4 Note Off              
 0000BFBB   1  --     90    3C    63    1  C  4 Note On               
 0000BFBF   1  --     80    3C    00    1  C  4 Note Off              
 0000C004   1  --     90    3C    63    1  C  4 Note On               
 0000C140   1  --     80    3C    00    1  C  4 Note Off              
 <=== MIDI-OX Log Closed: Tue 28-Mar-2023 17:23:26 <===

I am using this on the TMM but not 100% sure its correct for what I want to do:
Code:
// USB MIDI receive example, Note on/off -> LED on/off
// contributed by Alessandro Fasan
#include "USBHost_t36.h"
USBHost myusb;
USBHub hub1(myusb);
USBHub hub2(myusb);
USBHub hub3(myusb);
MIDIDevice midi1(myusb);

int ledPin = 13;

void OnNoteOn(byte channel, byte note, byte velocity) {
  digitalWrite(ledPin, HIGH); // Any Note-On turns on LED
  Serial.println("LED ON");
}

void OnNoteOff(byte channel, byte note, byte velocity) {
  digitalWrite(ledPin, LOW);  // Any Note-Off turns off LED
  Serial.println("LED Off");

}

void setup() {
  Serial.begin(115200);

  // Wait 1.5 seconds before turning on USB Host.  If connected USB devices
  // use too much power, Teensy at least completes USB enumeration, which
  // makes isolating the power issue easier.
  delay(1500);

  myusb.begin();
  
  pinMode(ledPin, OUTPUT);
  midi1.setHandleNoteOff(OnNoteOff);
  midi1.setHandleNoteOn(OnNoteOn) ;
  digitalWrite(ledPin, HIGH);
  delay(400);                 // Blink LED once at startup
  digitalWrite(ledPin, LOW);
}

void loop() {
    myusb.Task();
  midi1.read();
}

EDIT: compiling both sketches with Serial+MIDI
 
Last edited:
It would be nice if the audio examples that reference the SD card are fixed so that they at least mention the defaults for Teensy 4.0/4.1.

I've added comments to all the examples to document the SPI pins Teensy 4 actually uses (it ignores attempts to change the pins).

https://github.com/PaulStoffregen/Audio/commit/7346c5401cbbe5d78f41ab9c68bb4a35270d8a7c

The comments about BUILTIN_SDCARD applying to Teensy 4.1 were updated some time ago. Yet another reason to get 1.58 released (without another beta... only very low risk changes).

I also recently updated all the audio tutorial examples to work on Teensy 4.

https://github.com/PaulStoffregen/Audio/commit/3a686c24a24c6f54dfd9d609e3dd67fdfb885314

The main change is a couple examples would blink the LED on pin 13, which worked because Teensy 3.x uses pin 14 for SPI clock. But in hindsight it was always a bad idea because pin 13 also connects to the STGL5000 data output.

The examples now expect a LED on pin 5. Robin is working on updating the tutorial parts kit with a red LED and 220 ohm resistor.
 
Cores: Looks like you have several PRs to fix some of the warning messages, which you may or may not want to look through.

Merged a couple of them.

The others I don't consider low enough risk right before a release. They fix warnings that only occur is using an even newer toolchain or different flags like -Wextra.
 
@PaulStoffregen - @KurtE

Looks like there may be issue brewing with MIDI/USBHost, see posts starting around post #727 in the USBHost_t36 USB Mass Storage Driver Experiments thread. Post #737 has the actual sketches we been working with.

If you get a chance at some point you might want to take a look at what we been looking at.
 
I've added comments to all the examples to document the SPI pins Teensy 4 actually uses (it ignores attempts to change the pins).

https://github.com/PaulStoffregen/Audio/commit/7346c5401cbbe5d78f41ab9c68bb4a35270d8a7c

The comments about BUILTIN_SDCARD applying to Teensy 4.1 were updated some time ago. Yet another reason to get 1.58 released (without another beta... only very low risk changes).

I also recently updated all the audio tutorial examples to work on Teensy 4.

https://github.com/PaulStoffregen/Audio/commit/3a686c24a24c6f54dfd9d609e3dd67fdfb885314

The main change is a couple examples would blink the LED on pin 13, which worked because Teensy 3.x uses pin 14 for SPI clock. But in hindsight it was always a bad idea because pin 13 also connects to the STGL5000 data output.

The examples now expect a LED on pin 5. Robin is working on updating the tutorial parts kit with a red LED and 220 ohm resistor.
Great, thanks.
 
Ok, lots of (hopefully) low risk changes just went in, so I'm packaging up 1.58-beta4 for a final quick chance to test. Plan it to test for maybe 1-2 days, fix any serious issues, then release 1.58.
 
Sounds good. I am playing a little with the USBHost stuff, to maybe plug a few more possible data corruption possibilities.

For example, in RAWHID you do a sendPacket
It simply calls through to the HID code: return driver_->sendPacket(buffer);
Which does not disable the USB interrupt when it calls:

queue_Data_Transfer(out_pipe, p, cb, this);

So could be impacted by another call to queue_... inside ISR...

I am walking through some of the different places to find things like this.

Edit: this same call is out through hid, is in joystick, bluetooth, seremu
 
I was playing with some SmartMatrix demos (such as Adafruit_Gfx), and the new compiler in the 1.58 beta releases throws some new warnings for the Smartmatrix library. I will post this over at the Smartmaxtrix forum as well:

Code:
In file included from /home/meissner/Arduino/libraries/SmartMatrix/src/Layer_BackgroundGfx.h:173,
                 from /home/meissner/Arduino/libraries/SmartMatrix/src/SmartMatrix.h:59,
                 from /home/meissner/Arduino/Tests/RGB_Matrix/Adafruit_Gfx/Adafruit_Gfx.ino:39:
/home/meissner/Arduino/libraries/SmartMatrix/src/Layer_BackgroundGfx_Impl.h: In instantiation of 'void SMLayerBackgroundGFX<RGB, optionFlags>::swapBuffers(bool) [with RGB = rgb24; unsigned int optionFlags = 0]':
/home/meissner/Arduino/Tests/RGB_Matrix/Adafruit_Gfx/Adafruit_Gfx.ino:142:55:   required from here
/home/meissner/Arduino/libraries/SmartMatrix/src/Layer_BackgroundGfx_Impl.h:197:19: warning: 'void* memcpy(void*, const void*, size_t)' writing to an object of type 'struct rgb24' with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
  197 |             memcpy(backgroundBuffers[1], backgroundBuffers[0], sizeof(RGB) * (this->matrixWidth * this->matrixHeight));
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/meissner/Arduino/libraries/SmartMatrix/src/SmartMatrix.h:50,
                 from /home/meissner/Arduino/Tests/RGB_Matrix/Adafruit_Gfx/Adafruit_Gfx.ino:39:
/home/meissner/Arduino/libraries/SmartMatrix/src/MatrixCommon.h:139:16: note: 'struct rgb24' declared here
  139 | typedef struct rgb24 {
      |                ^~~~~
In file included from /home/meissner/Arduino/libraries/SmartMatrix/src/Layer_BackgroundGfx.h:173,
                 from /home/meissner/Arduino/libraries/SmartMatrix/src/SmartMatrix.h:59,
                 from /home/meissner/Arduino/Tests/RGB_Matrix/Adafruit_Gfx/Adafruit_Gfx.ino:39:
/home/meissner/Arduino/libraries/SmartMatrix/src/Layer_BackgroundGfx_Impl.h:199:19: warning: 'void* memcpy(void*, const void*, size_t)' writing to an object of type 'struct rgb24' with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
  199 |             memcpy(backgroundBuffers[0], backgroundBuffers[1], sizeof(RGB) * (this->matrixWidth * this->matrixHeight));
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/meissner/Arduino/libraries/SmartMatrix/src/SmartMatrix.h:50,
                 from /home/meissner/Arduino/Tests/RGB_Matrix/Adafruit_Gfx/Adafruit_Gfx.ino:39:
/home/meissner/Arduino/libraries/SmartMatrix/src/MatrixCommon.h:139:16: note: 'struct rgb24' declared here
  139 | typedef struct rgb24 {
      |                ^~~~~
In file included from /home/meissner/Arduino/libraries/SmartMatrix/src/SmartMatrix.h:218,
                 from /home/meissner/Arduino/Tests/RGB_Matrix/Adafruit_Gfx/Adafruit_Gfx.ino:39:
/home/meissner/Arduino/libraries/SmartMatrix/src/MatrixTeensy4Hub75Refresh_Impl.h: In instantiation of 'static void SmartMatrixRefreshT4<refreshDepth, matrixWidth, matrixHeight, panelType, optionFlags>::hardwareSetup() [with int refreshDepth = 36; int matrixWidth = 64; int matrixHeight = 64; unsigned char panelType = 2; long unsigned int optionFlags = 0]':
/home/meissner/Arduino/libraries/SmartMatrix/src/MatrixTeensy4Hub75Refresh_Impl.h:389:18:   required from 'static void SmartMatrixRefreshT4<refreshDepth, matrixWidth, matrixHeight, panelType, optionFlags>::begin() [with int refreshDepth = 36; int matrixWidth = 64; int matrixHeight = 64; unsigned char panelType = 2; long unsigned int optionFlags = 0]'
/home/meissner/Arduino/libraries/SmartMatrix/src/MatrixTeensy4Hub75Calc_Impl.h:272:97:   required from 'void SmartMatrixHub75Calc<refreshDepth, matrixWidth, matrixHeight, panelType, optionFlags>::begin() [with int refreshDepth = 36; int matrixWidth = 64; int matrixHeight = 64; unsigned char panelType = 2; long unsigned int optionFlags = 0]'
/home/meissner/Arduino/Tests/RGB_Matrix/Adafruit_Gfx/Adafruit_Gfx.ino:380:15:   required from here
/home/meissner/Arduino/libraries/SmartMatrix/src/MatrixTeensy4Hub75Refresh_Impl.h:669:88: warning: taking address of packed member of 'SmartMatrixRefreshT4<36, 64, 64, 2, 0>::timerpair' may result in an unaligned pointer value [-Waddress-of-packed-member]
  669 |     sourceAddress = (volatile uint32_t*) & (matrixUpdateRows[0].rowbits[0].timerValues.timer_oe);
      |                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
In file included from /home/meissner/Arduino/libraries/SmartMatrix/src/SmartMatrix.h:219,
                 from /home/meissner/Arduino/Tests/RGB_Matrix/Adafruit_Gfx/Adafruit_Gfx.ino:39:
/home/meissner/Arduino/libraries/SmartMatrix/src/MatrixTeensy4Hub75Calc_Impl.h: In instantiation of 'static void SmartMatrixHub75Calc<refreshDepth, matrixWidth, matrixHeight, panelType, optionFlags>::loadMatrixBuffers48(volatile rowDataStruct*, unsigned int) [with int refreshDepth = 36; int matrixWidth = 64; int matrixHeight = 64; unsigned char panelType = 2; long unsigned int optionFlags = 0; SmartMatrixHub75Calc<refreshDepth, matrixWidth, matrixHeight, panelType, optionFlags>::rowDataStruct = SmartMatrixRefreshT4<36, 64, 64, 2, 0>::rowDataStruct]':
/home/meissner/Arduino/libraries/SmartMatrix/src/MatrixTeensy4Hub75Calc_Impl.h:548:24:   required from 'static void SmartMatrixHub75Calc<refreshDepth, matrixWidth, matrixHeight, panelType, optionFlags>::loadMatrixBuffers(unsigned int) [with int refreshDepth = 36; int matrixWidth = 64; int matrixHeight = 64; unsigned char panelType = 2; long unsigned int optionFlags = 0]'
/home/meissner/Arduino/libraries/SmartMatrix/src/MatrixTeensy4Hub75Calc_Impl.h:168:113:   required from 'static void SmartMatrixHub75Calc<refreshDepth, matrixWidth, matrixHeight, panelType, optionFlags>::matrixCalculations(bool) [with int refreshDepth = 36; int matrixWidth = 64; int matrixHeight = 64; unsigned char panelType = 2; long unsigned int optionFlags = 0]'
/home/meissner/Arduino/libraries/SmartMatrix/src/MatrixTeensy4Hub75Calc_Impl.h:270:121:   required from 'void SmartMatrixHub75Calc<refreshDepth, matrixWidth, matrixHeight, panelType, optionFlags>::begin() [with int refreshDepth = 36; int matrixWidth = 64; int matrixHeight = 64; unsigned char panelType = 2; long unsigned int optionFlags = 0]'
/home/meissner/Arduino/Tests/RGB_Matrix/Adafruit_Gfx/Adafruit_Gfx.ino:380:15:   required from here
/home/meissner/Arduino/libraries/SmartMatrix/src/MatrixTeensy4Hub75Calc_Impl.h:384:15: warning: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'rgb48' {aka 'struct rgb48'}; use assignment or value-initialization instead [-Wclass-memaccess]
  384 |         memset(tempRow0, 0, sizeof(tempRow0));
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/meissner/Arduino/libraries/SmartMatrix/src/SmartMatrix.h:50,
                 from /home/meissner/Arduino/Tests/RGB_Matrix/Adafruit_Gfx/Adafruit_Gfx.ino:39:
/home/meissner/Arduino/libraries/SmartMatrix/src/MatrixCommon.h:159:16: note: 'rgb48' {aka 'struct rgb48'} declared here
  159 | typedef struct rgb48 {
      |                ^~~~~
In file included from /home/meissner/Arduino/libraries/SmartMatrix/src/SmartMatrix.h:219,
                 from /home/meissner/Arduino/Tests/RGB_Matrix/Adafruit_Gfx/Adafruit_Gfx.ino:39:
/home/meissner/Arduino/libraries/SmartMatrix/src/MatrixTeensy4Hub75Calc_Impl.h:385:15: warning: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'rgb48' {aka 'struct rgb48'}; use assignment or value-initialization instead [-Wclass-memaccess]
  385 |         memset(tempRow1, 0, sizeof(tempRow1));
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/meissner/Arduino/libraries/SmartMatrix/src/SmartMatrix.h:50,
                 from /home/meissner/Arduino/Tests/RGB_Matrix/Adafruit_Gfx/Adafruit_Gfx.ino:39:
/home/meissner/Arduino/libraries/SmartMatrix/src/MatrixCommon.h:159:16: note: 'rgb48' {aka 'struct rgb48'} declared here
  159 | typedef struct rgb48 {
      |                ^~~~~
Memory Usage on Teensy 4.1:
  FLASH: code:53692, data:9864, headers:9144   free for files:8053764
   RAM1: variables:37856, code:51048, padding:14488   free for local variables:420896
   RAM2: variables:19680  free for malloc/new:504608

Here is the code I was using:

Code:
/*
 * This example shows how to use the Adafruit_GFX compatible Layers in SmartMatrix Library
 * This example was adapted from Adafruit's FX example for the Adafruit ILI9341 Breakout and Shield, see text below
 */

/***************************************************
  This is our GFX example for the Adafruit ILI9341 Breakout and Shield
  ----> http://www.adafruit.com/products/1651
  Check out the links above for our tutorials and wiring diagrams
  These displays use SPI to communicate, 4 or 5 pins are required to
  interface (RST is optional)
  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!
  Written by Limor Fried/Ladyada for Adafruit Industries.
  MIT license, all text above must be included in any redistribution
 ****************************************************/

#define USE_ADAFRUIT_GFX_LAYERS

// uncomment one line to select your MatrixHardware configuration - configuration header needs to be included before <SmartMatrix.h>
//#include <MatrixHardware_Teensy3_ShieldV4.h>        // SmartLED Shield for Teensy 3 (V4)
//#include <MatrixHardware_Teensy4_ShieldV5.h>        // SmartLED Shield for Teensy 4 (V5)
//#include <MatrixHardware_Teensy3_ShieldV1toV3.h>    // SmartMatrix Shield for Teensy 3 V1-V3
//#include <MatrixHardware_Teensy4_ShieldV4Adapter.h> // Teensy 4 Adapter attached to SmartLED Shield for Teensy 3 (V4)
//#include <MatrixHardware_ESP32_V0.h>                // This file contains multiple ESP32 hardware configurations, edit the file to define GPIOPINOUT (or add #define GPIOPINOUT with a hardcoded number before this #include)
//#include "MatrixHardware_Custom.h"                  // Copy an existing MatrixHardware file to your Sketch directory, rename, customize, and you can include it like this

#if defined(ARDUINO_TEENSY40) || defined(ARDUINO_TEENSY41)
#include <MatrixHardware_Teensy4_ShieldV5.h>		// SmartLED Shield for Teensy 4 (V5)

#elif defined(ARDUINO_TEENSY35) || defined(ARDUINO_TEENSY36)
#include <MatrixHardware_Teensy4_ShieldV4.h>		// SmartLED Shield for Teensy 4 (V5)

#else
#error "Include the correct header for the microprocessor"
#endif

#include <SmartMatrix.h>

#define COLOR_DEPTH 24                  // Choose the color depth used for storing pixels in the layers: 24 or 48 (24 is good for most sketches - If the sketch uses type `rgb24` directly, COLOR_DEPTH must be 24)
#define kMatrixWidth 64                 // Set to the width of your display, must be a multiple of 8
#define kMatrixHeight 64                // Set to the height of your display
const uint8_t kRefreshDepth = 36;       // Tradeoff of color quality vs refresh rate, max brightness, and RAM usage.  36 is typically good, drop down to 24 if you need to.  On Teensy, multiples of 3, up to 48: 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48.  On ESP32: 24, 36, 48
const uint8_t kDmaBufferRows = 4;       // known working: 2-4, use 2 to save RAM, more to keep from dropping frames and automatically lowering refresh rate.  (This isn't used on ESP32, leave as default)

// Choose the configuration that matches your panels.  See more details in
// MatrixCommonHub75.h and the docs: https://github.com/pixelmatix/SmartMatrix/wiki
#if kMatrixHeight == 64
const uint8_t kPanelType = SM_PANELTYPE_HUB75_64ROW_MOD32SCAN;

#elif kMatrixHeight == 32
const uint8_t kPanelType = SM_PANELTYPE_HUB75_32ROW_MOD16SCAN;

#elif kMatrixHeight == 16
const uint8_t kPanelType = SM_PANELTYPE_HUB75_16ROW_MOD8SCAN;

#else
#error "Update setting kPanelType"
#endif

const uint32_t kMatrixOptions = (SM_HUB75_OPTIONS_NONE);        // see docs for options: https://github.com/pixelmatix/SmartMatrix/wiki

SMARTMATRIX_ALLOCATE_BUFFERS(matrix, kMatrixWidth, kMatrixHeight, kRefreshDepth, kDmaBufferRows, kPanelType, kMatrixOptions);

// There are two Adafruit_GFX compatible layers, a Mono layer and an RGB layer, and this example sketch works with either (choose one):
#if 1
  const uint8_t kBackgroundLayerOptions = (SM_BACKGROUND_OPTIONS_NONE);
  SMARTMATRIX_ALLOCATE_BACKGROUND_LAYER(backgroundLayer, kMatrixWidth, kMatrixHeight, COLOR_DEPTH, kBackgroundLayerOptions);
#else
  const uint8_t kMonoLayerOptions = (SM_GFX_MONO_OPTIONS_NONE);
  SMARTMATRIX_ALLOCATE_GFX_MONO_LAYER(backgroundLayer, kMatrixWidth, kMatrixHeight, kMatrixWidth, kMatrixHeight, COLOR_DEPTH, kMonoLayerOptions);
  
  // these backwards compatible ALLOCATE macros also work:
  //SMARTMATRIX_ALLOCATE_SCROLLING_LAYER(backgroundLayer, kMatrixWidth, kMatrixHeight, COLOR_DEPTH, kMonoLayerOptions);
  //SMARTMATRIX_ALLOCATE_INDEXED_LAYER(backgroundLayer, kMatrixWidth, kMatrixHeight, COLOR_DEPTH, kMonoLayerOptions);
#endif

// Assign human-readable names to some common 16-bit color values:
#define BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF

// enable this to see the intermediate drawing steps, otherwise screen will only be updated at the end of each test (this slows the tests down considerably)
const bool swapAfterEveryDraw = false;

unsigned long testFillScreen() {
  unsigned long start = micros();
  backgroundLayer.fillScreen(BLACK);
  backgroundLayer.fillScreen(RED);
  backgroundLayer.fillScreen(GREEN);
  backgroundLayer.fillScreen(BLUE);
  backgroundLayer.fillScreen(BLACK);
  return micros() - start;
}

unsigned long testText() {
  backgroundLayer.fillScreen(BLACK);
  unsigned long start = micros();
  backgroundLayer.setCursor(0, 0);
  backgroundLayer.setTextColor(WHITE);  backgroundLayer.setTextSize(1);
  backgroundLayer.println("Hello World!");
  backgroundLayer.setTextColor(YELLOW); backgroundLayer.setTextSize(2);
  backgroundLayer.println(1234.56);
  backgroundLayer.setTextColor(RED);    backgroundLayer.setTextSize(3);
//  backgroundLayer.println(0xDEADBEEF, HEX);
//  backgroundLayer.println();
  backgroundLayer.setTextColor(GREEN);
  backgroundLayer.setTextSize(5);
  backgroundLayer.println("Groop");
  backgroundLayer.setTextSize(2);
  backgroundLayer.println("I implore thee,");
  backgroundLayer.setTextSize(1);
  backgroundLayer.println("my foonting turlingdromes.");
  backgroundLayer.println("And hooptiously drangle me");
  backgroundLayer.println("with crinkly bindlewurdles,");
  backgroundLayer.println("Or I will rend thee");
  backgroundLayer.println("in the gobberwarts");
  backgroundLayer.println("with my blurglecruncheon,");
  backgroundLayer.println("see if I don't!");
  return micros() - start;
}

unsigned long testLines(uint16_t color) {
  unsigned long start, t;
  int           x1, y1, x2, y2,
                w = backgroundLayer.width(),
                h = backgroundLayer.height();

  backgroundLayer.fillScreen(BLACK);

  x1 = y1 = 0;
  y2    = h - 1;
  start = micros();
  for(x2=0; x2<w; x2+=6) {
    backgroundLayer.drawLine(x1, y1, x2, y2, color);
    if(swapAfterEveryDraw) backgroundLayer.swapBuffers();
  }
  x2    = w - 1;
  for(y2=0; y2<h; y2+=6) {
    backgroundLayer.drawLine(x1, y1, x2, y2, color);
    if(swapAfterEveryDraw) backgroundLayer.swapBuffers();
  }
  t     = micros() - start; // fillScreen doesn't count against timing
  backgroundLayer.swapBuffers();

  backgroundLayer.fillScreen(BLACK);

  x1    = w - 1;
  y1    = 0;
  y2    = h - 1;
  start = micros();
  for(x2=0; x2<w; x2+=6) {
    backgroundLayer.drawLine(x1, y1, x2, y2, color);
    if(swapAfterEveryDraw) backgroundLayer.swapBuffers();
  }
  x2    = 0;
  for(y2=0; y2<h; y2+=6) {
    backgroundLayer.drawLine(x1, y1, x2, y2, color);
    if(swapAfterEveryDraw) backgroundLayer.swapBuffers();
  }
  t    += micros() - start;
  backgroundLayer.swapBuffers();

  backgroundLayer.fillScreen(BLACK);

  x1    = 0;
  y1    = h - 1;
  y2    = 0;
  start = micros();
  for(x2=0; x2<w; x2+=6) {
    backgroundLayer.drawLine(x1, y1, x2, y2, color);
    if(swapAfterEveryDraw) backgroundLayer.swapBuffers();
  }
  x2    = w - 1;
  for(y2=0; y2<h; y2+=6) {
    backgroundLayer.drawLine(x1, y1, x2, y2, color);
    if(swapAfterEveryDraw) backgroundLayer.swapBuffers();
  }
  t    += micros() - start;
  backgroundLayer.swapBuffers();

  backgroundLayer.fillScreen(BLACK);

  x1    = w - 1;
  y1    = h - 1;
  y2    = 0;
  start = micros();
  for(x2=0; x2<w; x2+=6) {
    backgroundLayer.drawLine(x1, y1, x2, y2, color);
    if(swapAfterEveryDraw) backgroundLayer.swapBuffers();
  }
  x2    = 0;
  for(y2=0; y2<h; y2+=6) {
    backgroundLayer.drawLine(x1, y1, x2, y2, color);
    if(swapAfterEveryDraw) backgroundLayer.swapBuffers();
  }
  t    += micros() - start;
  backgroundLayer.swapBuffers();

  return t;
}
unsigned long testFastLines(uint16_t color1, uint16_t color2) {
  unsigned long start;
  int           x, y, w = backgroundLayer.width(), h = backgroundLayer.height();

  backgroundLayer.fillScreen(BLACK);
  start = micros();
  for(y=0; y<h; y+=5) {
    backgroundLayer.drawFastHLine(0, y, w, color1);
    if(swapAfterEveryDraw) backgroundLayer.swapBuffers();
  }
  for(x=0; x<w; x+=5) {
    backgroundLayer.drawFastVLine(x, 0, h, color2);
    if(swapAfterEveryDraw) backgroundLayer.swapBuffers();
  }

  return micros() - start;
}

unsigned long testRects(uint16_t color) {
  unsigned long start;
  int           n, i, i2,
                cx = backgroundLayer.width()  / 2,
                cy = backgroundLayer.height() / 2;

  backgroundLayer.fillScreen(BLACK);
  n     = min(backgroundLayer.width(), backgroundLayer.height());
  start = micros();
  for(i=2; i<n; i+=6) {
    i2 = i / 2;
    backgroundLayer.drawRect(cx-i2, cy-i2, i, i, color);
    if(swapAfterEveryDraw) backgroundLayer.swapBuffers();
  }

  return micros() - start;
}

unsigned long testFilledRects(uint16_t color1, uint16_t color2) {
  unsigned long start, t = 0;
  int           n, i, i2,
                cx = backgroundLayer.width()  / 2 - 1,
                cy = backgroundLayer.height() / 2 - 1;

  backgroundLayer.fillScreen(BLACK);
  n = min(backgroundLayer.width(), backgroundLayer.height());
  for(i=n; i>0; i-=6) {
    i2    = i / 2;
    start = micros();
    backgroundLayer.fillRect(cx-i2, cy-i2, i, i, color1);
    if(swapAfterEveryDraw) backgroundLayer.swapBuffers();
    t    += micros() - start;
    // Outlines are not included in timing results
    backgroundLayer.drawRect(cx-i2, cy-i2, i, i, color2);
    if(swapAfterEveryDraw) backgroundLayer.swapBuffers();
  }

  return t;
}

unsigned long testFilledCircles(uint8_t radius, uint16_t color) {
  unsigned long start;
  int x, y, w = backgroundLayer.width(), h = backgroundLayer.height(), r2 = radius * 2;

  backgroundLayer.fillScreen(BLACK);
  start = micros();
  for(x=radius; x<w; x+=r2) {
    for(y=radius; y<h; y+=r2) {
      backgroundLayer.fillCircle(x, y, radius, color);
      if(swapAfterEveryDraw) backgroundLayer.swapBuffers();
    }
  }

  return micros() - start;
}

unsigned long testCircles(uint8_t radius, uint16_t color) {
  unsigned long start;
  int           x, y, r2 = radius * 2,
                w = backgroundLayer.width()  + radius,
                h = backgroundLayer.height() + radius;

  // Screen is not cleared for this one -- this is
  // intentional and does not affect the reported time.
  start = micros();
  for(x=0; x<w; x+=r2) {
    for(y=0; y<h; y+=r2) {
      backgroundLayer.drawCircle(x, y, radius, color);
      if(swapAfterEveryDraw) backgroundLayer.swapBuffers();
    }
  }

  return micros() - start;
}

unsigned long testTriangles() {
  unsigned long start;
  int           n, i, cx = backgroundLayer.width()  / 2 - 1,
                      cy = backgroundLayer.height() / 2 - 1;

  backgroundLayer.fillScreen(BLACK);
  n     = min(cx, cy);
  start = micros();
  for(i=0; i<n; i+=5) {
    backgroundLayer.drawTriangle(
      cx    , cy - i, // peak
      cx - i, cy + i, // bottom left
      cx + i, cy + i, // bottom right
      backgroundLayer.color565(0, 0, i));
    if(swapAfterEveryDraw) backgroundLayer.swapBuffers();
  }

  return micros() - start;
}

unsigned long testFilledTriangles() {
  unsigned long start, t = 0;
  int           i, cx = backgroundLayer.width()  / 2 - 1,
                   cy = backgroundLayer.height() / 2 - 1;

  backgroundLayer.fillScreen(BLACK);
  start = micros();
  for(i=min(cx,cy); i>10; i-=5) {
    start = micros();
    backgroundLayer.fillTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,
      backgroundLayer.color565(0, i, i));
    t += micros() - start;
    if(swapAfterEveryDraw) backgroundLayer.swapBuffers();
    backgroundLayer.drawTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,
      backgroundLayer.color565(i, i, 0));
    if(swapAfterEveryDraw) backgroundLayer.swapBuffers();
  }

  return t;
}

unsigned long testRoundRects() {
  unsigned long start;
  int           w, i, i2,
                cx = backgroundLayer.width()  / 2 - 1,
                cy = backgroundLayer.height() / 2 - 1;

  backgroundLayer.fillScreen(BLACK);
  w     = min(backgroundLayer.width(), backgroundLayer.height());
  start = micros();
  for(i=0; i<w; i+=6) {
    i2 = i / 2;
    backgroundLayer.drawRoundRect(cx-i2, cy-i2, i, i, i/8, backgroundLayer.color565(i, 0, 0));
    if(swapAfterEveryDraw) backgroundLayer.swapBuffers();
  }

  return micros() - start;
}

unsigned long testFilledRoundRects() {
  unsigned long start;
  int           i, i2,
                cx = backgroundLayer.width()  / 2 - 1,
                cy = backgroundLayer.height() / 2 - 1;

  backgroundLayer.fillScreen(BLACK);
  start = micros();
  for(i=min(backgroundLayer.width(), backgroundLayer.height()); i>20; i-=6) {
    i2 = i / 2;
    backgroundLayer.fillRoundRect(cx-i2, cy-i2, i, i, i/8, backgroundLayer.color565(0, i, 0));
    if(swapAfterEveryDraw) backgroundLayer.swapBuffers();
  }

  return micros() - start;
}

void setup() {
  Serial.begin(115200);
  matrix.addLayer(&backgroundLayer); 
  matrix.begin();

  // wait for Serial to be ready
  delay(1000);

  matrix.setBrightness(128);

  Serial.println(F("Benchmark                Time (microseconds)"));

  Serial.print(F("Screen fill              "));
  Serial.println(testFillScreen());
  backgroundLayer.swapBuffers();
  delay(500);

  Serial.print(F("Text                     "));
  Serial.println(testText());
  backgroundLayer.swapBuffers();
  delay(3000);

  Serial.print(F("Lines                    "));
  Serial.println(testLines(CYAN));
  backgroundLayer.swapBuffers();
  delay(500);

  Serial.print(F("Horiz/Vert Lines         "));
  Serial.println(testFastLines(RED, BLUE));
  backgroundLayer.swapBuffers();
  delay(500);

  Serial.print(F("Rectangles (outline)     "));
  Serial.println(testRects(GREEN));
  backgroundLayer.swapBuffers();
  delay(500);

  Serial.print(F("Rectangles (filled)      "));
  Serial.println(testFilledRects(YELLOW, MAGENTA));
  backgroundLayer.swapBuffers();
  delay(500);

  Serial.print(F("Circles (filled)         "));
  Serial.println(testFilledCircles(10, MAGENTA));
  backgroundLayer.swapBuffers();
  delay(500);

  Serial.print(F("Circles (outline)        "));
  Serial.println(testCircles(10, WHITE));
  backgroundLayer.swapBuffers();
  delay(500);

  Serial.print(F("Triangles (outline)      "));
  Serial.println(testTriangles());
  backgroundLayer.swapBuffers();
  delay(500);

  Serial.print(F("Triangles (filled)       "));
  Serial.println(testFilledTriangles());
  backgroundLayer.swapBuffers();
  delay(500);

  Serial.print(F("Rounded rects (outline)  "));
  Serial.println(testRoundRects());
  backgroundLayer.swapBuffers();
  delay(500);

  Serial.print(F("Rounded rects (filled)   "));
  Serial.println(testFilledRoundRects());
  backgroundLayer.swapBuffers();
  delay(500);

  Serial.println(F("Done!"));
}

void loop() {
  for(uint8_t rotation=0; rotation<4; rotation++) {
    backgroundLayer.setRotation(rotation);
    testText();
    backgroundLayer.swapBuffers();
    delay(1000);
  }
}


Did you ever figure this out? I am getting these same errors when compiling the SmartMatrix example programs
 
Did you ever figure this out? I am getting these same errors when compiling the SmartMatrix example programs

Nope, but I didn't look into it, since at least for me, those are warnings, and the animated gifs program that I was using did run.

I did post it on the SmartMatrix forum with no responses. There are now at least 2 other threads talking about the errors (and in fact, unlike my example, those examples do not link).

I did try various options, and if I select 'smallest code' instead of my normal 'faster' it won't build.
 
Back
Top