SmartMatrix Library 4.0 - Changes to MatrixHardware #includes

When SmartMatrix Library 3.0 was released, there was only one processor family supported (the Teensy 3.x), and only one type of SmartMatrix Shield. Now there’s two types of shields for the Teensy 3, preliminary ESP32 support with many potential hardware configurations, and Teensy 4 support is coming with multiple possible hardware configurations as well.

With SmartMatrix Library 4.0, I’m planning to make it easier (and mandatory) to choose the hardware configuration in the sketch. It will also be possible to use a custom hardware configuration without modifying the library by adding a file into the sketch directory.

Selecting Hardware Configuration

For all projects, a MatrixHardware*.h file must be included before including <SmartMatrix4.h>

#include <MatrixHardware_KitV4.h>
//#include <MatrixHardware_KitV1.h>
#include <SmartMatrix4.h>

If there’s no MatrixHardware file included, the compiler will throw an error:

No MatrixHardware*.h file included - You must include one at the top of your sketch

If you accidentally include multiple files, a different error:

Multiple MatrixHardware*.h files included - Only include one MatrixHardware file at the top of your sketch

The MatrixHardware configuration will be printed out with a message in the compiler output, e.g.: #pragma message "MatrixHardware: SmartLED Shield V4"

Custom MatrixHardware File

If the files included with the library aren’t suitable, you can copy the closest pinout to what you need from the library to your sketch directory, tweak it to your liking, and include it in your sketch:

#include "MatrixHardware_KitV4_custom.h"
//#include <MatrixHardware_KitV4.h>
#include <SmartMatrix4.h>

To handle the case where a HUB75 panel manufacturer has used non-standard color order in their HUB75 pinout, you can swap the order in the MatrixHardware file.

Feedback?

Does this new method seem like a good improvement? Did I overlook anything that might be useful?

@marcmerlin I’m particularly interested in hearing your opinion on this, as you’ve added a number of ESP32 alt configurations, plus you added the #pragma message displaying board type, which I’ve found to be very useful

Thanks for the ping. I think that’s a better solution than having ever more ifs in a file that you maintain, and allows for someone to have their local definition in their sketch without modifying the lib.
I assume this will break ESP32 users right now, but that’s fine with me, it’s not like it was a supported platform anyway and it probably doesn’t have too many users.
While you’re at it, if you can coordinate this with a merge of teensylc back in master, maybe even merge teensylc into master first and then make your change, so teensylc keeps the old unsupported way, and master now supports ESP32 with the new way.

The plan is to migrate the teensylc branch to a new SmartMatrix Library 4 repo, where it will be released in parallel with SmartMatrix Library 3, not replacing. If I used the existing SmartMatrix Library 3 repo for SmartMatrix Library 4, someone could upgrade their library using Arduino Library Manager, and then wonder why their existing sketches don’t compile (because of the MatrixHardware headers at a minimum, and possibly other changes).

You make a good point though about introducing major changes to the teensylc branch, as enough people are using it that it would probably cause confusion if I quietly introduced these MatrixHardware header changes to that branch.

I prototyped the MatrixHardware changes, and edited the examples to show how different boards can be selected. The ESP32 file hasn’t been split out into several individual files yet. It’s in a separate branch, not teensylc, and I don’t plan on merging it into teensylc. (As of now, the plan is for this “NT” branch to be merged into “teensy4”, and “teensy4” will eventually become SmartMatrix Library 4 in a new repo)

I’ve already made some changes to allow for easier customization of the Teensy 3 MatrixHardware files to rearrange RGB pins (and made it more clear what can be tweaked by the user, and what should be left alone):

1 Like

“teensy4” will eventually become SmartMatrix Library 4 in a new repo

I’m not sure why I thought a separate repo was needed for SmartMatrix Library 4, but I don’t see a need for that now. I think SmartMatrix Library 4 will replace the main branch in the existing repo. Existing SmartMatrix sketches will need to be updated to choose a hardware configuration header, which hopefully won’t be too difficult for someone who grabbed the latest release and wasn’t aware of the change. There will be an error listed when compiling, and I’ll put a note in the README.

It sounds good!
I hope you plan to support ESP32 in 4th version?

It will be included in the release, with some possible improvements but won’t be fully supported like the Teensy ports are. Here’s the Todo list for SmartMatrix Library 4.0, with some “nice to have” improvements for ESP32:

good, i was using teensy 3.2 with the code controlling a led panel and it works well.

i bought a teensy 4.0 to try it out.

I changed the arduino program to teensy 4.0 and uploading a lot of errors.

with teensy 3.2 the code works fine, but with teensy 4.0 no longer.

would appreciate help

some of the mistakes that

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h: In constructor 'SmartMatrix3<refreshDepth, matrixWidth, matrixHeight, panelType, optionFlags>::SmartMatrix3(uint8_t, uint32_t*, uint8_t*)':

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:37:30: error: 'F_BUS' was not declared in this scope

 #define TIMER_FREQUENCY     (F_BUS/2)

                              ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:38:40: note: in expansion of macro 'TIMER_FREQUENCY'

 #define NS_TO_TICKS(X)      (uint32_t)(TIMER_FREQUENCY * ((X) / 1000000000.0))

                                        ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:43:32: note: in expansion of macro 'NS_TO_TICKS'

 #define MIN_BLOCK_PERIOD_TICKS NS_TO_TICKS(MIN_BLOCK_PERIOD_NS)

                                ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:164:35: note: in expansion of macro 'MIN_BLOCK_PERIOD_TICKS'

     timerPairIdle->timer_period = MIN_BLOCK_PERIOD_TICKS;

                                   ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h: In static member function 'static void SmartMatrix3<refreshDepth, matrixWidth, matrixHeight, panelType, optionFlags>::matrixCalculations(bool)':

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:37:30: error: 'F_BUS' was not declared in this scope

 #define TIMER_FREQUENCY     (F_BUS/2)

                              ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:47:32: note: in expansion of macro 'TIMER_FREQUENCY'

 #define MIN_REFRESH_RATE    (((TIMER_FREQUENCY/65535)/16/2) + 1)

                                ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:232:43: note: in expansion of macro 'MIN_REFRESH_RATE'

             if (!initial && refreshRate > MIN_REFRESH_RATE) {

                                           ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:37:30: error: 'F_BUS' was not declared in this scope

 #define TIMER_FREQUENCY     (F_BUS/2)

                              ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:47:32: note: in expansion of macro 'TIMER_FREQUENCY'

 #define MIN_REFRESH_RATE    (((TIMER_FREQUENCY/65535)/16/2) + 1)

                                ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:280:31: note: in expansion of macro 'MIN_REFRESH_RATE'

             if (refreshRate > MIN_REFRESH_RATE) {

                               ^

In file included from C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix.h:168:0,

                 from C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix3.h:29,

                 from C:\Users\Pedro\Desktop\Codigo teensy\RGB_DMD\RGB_DMD.ino:3:

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:288:13: error: 'FTM1_SC' was not declared in this scope

             FTM1_SC = FTM_SC_CLKS(0) | FTM_SC_PS(LATCH_TIMER_PRESCALE);

             ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:288:36: warning: there are no arguments to 'FTM_SC_CLKS' that depend on a template parameter, so a declaration of 'FTM_SC_CLKS' must be available [-fpermissive]

             FTM1_SC = FTM_SC_CLKS(0) | FTM_SC_PS(LATCH_TIMER_PRESCALE);

                                    ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:288:70: warning: there are no arguments to 'FTM_SC_PS' that depend on a template parameter, so a declaration of 'FTM_SC_PS' must be available [-fpermissive]

             FTM1_SC = FTM_SC_CLKS(0) | FTM_SC_PS(LATCH_TIMER_PRESCALE);

                                                                      ^

In file included from C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix.h:168:0,

                 from C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix3.h:29,

                 from C:\Users\Pedro\Desktop\Codigo teensy\RGB_DMD\RGB_DMD.ino:3:

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:306:36: warning: there are no arguments to 'FTM_SC_CLKS' that depend on a template parameter, so a declaration of 'FTM_SC_CLKS' must be available [-fpermissive]

             FTM1_SC = FTM_SC_CLKS(1) | FTM_SC_PS(LATCH_TIMER_PRESCALE);

                                    ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:306:70: warning: there are no arguments to 'FTM_SC_PS' that depend on a template parameter, so a declaration of 'FTM_SC_PS' must be available [-fpermissive]

             FTM1_SC = FTM_SC_CLKS(1) | FTM_SC_PS(LATCH_TIMER_PRESCALE);

                                                                      ^

In file included from C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix.h:168:0,

                 from C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix3.h:29,

                 from C:\Users\Pedro\Desktop\Codigo teensy\RGB_DMD\RGB_DMD.ino:3:

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h: In static member function 'static void SmartMatrix3<refreshDepth, matrixWidth, matrixHeight, panelType, optionFlags>::calculateTimerLut()':

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:37:30: error: 'F_BUS' was not declared in this scope

 #define TIMER_FREQUENCY     (F_BUS/2)

                              ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:40:26: note: in expansion of macro 'TIMER_FREQUENCY'

 #define TICKS_PER_ROW   (TIMER_FREQUENCY/refreshRate/matrixRowsPerFrame)

                          ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:41:36: note: in expansion of macro 'TICKS_PER_ROW'

 #define IDEAL_MSB_BLOCK_TICKS     (TICKS_PER_ROW/2)

                                    ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:317:30: note: in expansion of macro 'IDEAL_MSB_BLOCK_TICKS'

     uint16_t msbBlockTicks = IDEAL_MSB_BLOCK_TICKS + MSB_BLOCK_TICKS_ADJUSTMENT_INCREMENT;

                              ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h: In member function 'void SmartMatrix3<refreshDepth, matrixWidth, matrixHeight, panelType, optionFlags>::setRefreshRate(uint8_t)':

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:37:30: error: 'F_BUS' was not declared in this scope

 #define TIMER_FREQUENCY     (F_BUS/2)

                              ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:47:32: note: in expansion of macro 'TIMER_FREQUENCY'

 #define MIN_REFRESH_RATE    (((TIMER_FREQUENCY/65535)/16/2) + 1)

                                ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:408:26: note: in expansion of macro 'MIN_REFRESH_RATE'

     if (newRefreshRate > MIN_REFRESH_RATE)

                          ^

In file included from C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix.h:168:0,

                 from C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix3.h:29,

                 from C:\Users\Pedro\Desktop\Codigo teensy\RGB_DMD\RGB_DMD.ino:3:

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h: In member function 'void SmartMatrix3<refreshDepth, matrixWidth, matrixHeight, panelType, optionFlags>::begin()':

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:502:5: error: 'FTM1_SC' was not declared in this scope

     FTM1_SC = 0;

     ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:503:5: error: 'FTM1_CNT' was not declared in this scope

     FTM1_CNT = 0;

     ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:504:5: error: 'FTM1_MOD' was not declared in this scope

     FTM1_MOD = IDEAL_MSB_BLOCK_TICKS;

     ^

In file included from C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix.h:168:0,

                 from C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix3.h:29,

                 from C:\Users\Pedro\Desktop\Codigo teensy\RGB_DMD\RGB_DMD.ino:3:

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:37:30: error: 'F_BUS' was not declared in this scope

 #define TIMER_FREQUENCY     (F_BUS/2)

                              ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:40:26: note: in expansion of macro 'TIMER_FREQUENCY'

 #define TICKS_PER_ROW   (TIMER_FREQUENCY/refreshRate/matrixRowsPerFrame)

                          ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:41:36: note: in expansion of macro 'TICKS_PER_ROW'

 #define IDEAL_MSB_BLOCK_TICKS     (TICKS_PER_ROW/2)

                                    ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:504:16: note: in expansion of macro 'IDEAL_MSB_BLOCK_TICKS'

     FTM1_MOD = IDEAL_MSB_BLOCK_TICKS;

                ^

In file included from C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix.h:168:0,

                 from C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix3.h:29,

                 from C:\Users\Pedro\Desktop\Codigo teensy\RGB_DMD\RGB_DMD.ino:3:

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:508:5: error: 'FTM1_C0V' was not declared in this scope

     FTM1_C0V = LATCH_TIMER_PULSE_WIDTH_TICKS;

     ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:510:5: error: 'FTM1_C1V' was not declared in this scope

     FTM1_C1V = IDEAL_MSB_BLOCK_TICKS;

     ^

In file included from C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix.h:29:0,

                 from C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix3.h:29,

                 from C:\Users\Pedro\Desktop\Codigo teensy\RGB_DMD\RGB_DMD.ino:3:

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/MatrixHardware_RGB_DMD.h:95:43: warning: there are no arguments to 'PORT_PCR_MUX' that depend on a template parameter, so a declaration of 'PORT_PCR_MUX' must be available [-fpermissive]

         CORE_PIN3_CONFIG |= PORT_PCR_MUX(3) | PORT_PCR_DSE | PORT_PCR_SRE;  \

                                           ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:513:5: note: in expansion of macro 'ENABLE_LATCH_PWM_OUTPUT'

     ENABLE_LATCH_PWM_OUTPUT();

     ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/MatrixHardware_RGB_DMD.h:95:47: error: 'PORT_PCR_DSE' was not declared in this scope

         CORE_PIN3_CONFIG |= PORT_PCR_MUX(3) | PORT_PCR_DSE | PORT_PCR_SRE;  \

                                               ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:513:5: note: in expansion of macro 'ENABLE_LATCH_PWM_OUTPUT'

     ENABLE_LATCH_PWM_OUTPUT();

     ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/MatrixHardware_RGB_DMD.h:95:62: error: 'PORT_PCR_SRE' was not declared in this scope

         CORE_PIN3_CONFIG |= PORT_PCR_MUX(3) | PORT_PCR_DSE | PORT_PCR_SRE;  \

                                                              ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:513:5: note: in expansion of macro 'ENABLE_LATCH_PWM_OUTPUT'

     ENABLE_LATCH_PWM_OUTPUT();

     ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/MatrixHardware_RGB_DMD.h:99:42: warning: there are no arguments to 'PORT_PCR_MUX' that depend on a template parameter, so a declaration of 'PORT_PCR_MUX' must be available [-fpermissive]

         CORE_PIN4_CONFIG = PORT_PCR_MUX(3) | PORT_PCR_DSE | PORT_PCR_SRE;   \

                                          ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:514:5: note: in expansion of macro 'ENABLE_OE_PWM_OUTPUT'

     ENABLE_OE_PWM_OUTPUT();

     ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/MatrixHardware_RGB_DMD.h:99:46: error: 'PORT_PCR_DSE' was not declared in this scope

         CORE_PIN4_CONFIG = PORT_PCR_MUX(3) | PORT_PCR_DSE | PORT_PCR_SRE;   \

                                              ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:514:5: note: in expansion of macro 'ENABLE_OE_PWM_OUTPUT'

     ENABLE_OE_PWM_OUTPUT();

     ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/MatrixHardware_RGB_DMD.h:99:61: error: 'PORT_PCR_SRE' was not declared in this scope

         CORE_PIN4_CONFIG = PORT_PCR_MUX(3) | PORT_PCR_DSE | PORT_PCR_SRE;   \

                                                             ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:514:5: note: in expansion of macro 'ENABLE_OE_PWM_OUTPUT'

     ENABLE_OE_PWM_OUTPUT();

     ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/MatrixHardware_RGB_DMD.h:104:44: warning: there are no arguments to 'PORT_PCR_IRQC' that depend on a template parameter, so a declaration of 'PORT_PCR_IRQC' must be available [-fpermissive]

         CORE_PIN3_CONFIG |= PORT_PCR_IRQC(1);           \

                                            ^

C:\Users\Pedro\Documents\Arduino\libraries\SmartMatrix-master\src/SmartMatrix_Impl.h:517:5: note: in expansion of macro 'ENABLE_LATCH_RISING_EDGE_GPIO_INT'

     ENABLE_LATCH_RISING_EDGE_GPIO_INT();

     ^

Hi Pedro, you need to use a MatrixHardware file appropriate for the Teensy 4, e.g. https://github.com/pixelmatix/SmartMatrix/blob/teensy4/src/MatrixHardware_Teensy4_ShieldV5.h

Also, you can’t just use a bare Teensy 4, it requires an external latch chip to drive the panel. You can find hardware details here: https://github.com/pixelmatix/SmartMatrix/tree/teensy4/extras/hardware/Teensy4

Also, I can’t tell what version of the library code you’re using. Teensy 4 support is only in the teensy4 branch on GitHub right now, though that branch is nearly ready to merge into the main branch, likely tomorrow, and then you’ll be able to access it more easily, including through Arduino Library Manager.

thanks, on this link

https://we.tl/t-UdAghs7KRk this is the library I’m using

what do i have to add the library that i am using to make it work with teensy 4.0 ?

I don’t have a tool to open rar files, I can open zip files. Where did you get that version of the library? There’s instructions on how to migrate from SmartMatrix Library 3.x to 4.0 here: https://github.com/pixelmatix/SmartMatrix/blob/teensy4/MIGRATION.md

but to migrate to smartmatrix4.0 I have to copy some files from the smartmatrix 4.0 library ?

the match if you can open zip files I think you can extract the rar

I will send you another link to download in zip format

the library version is smartmatrix3.

but there are some changes to work with the code

link https://we.tl/t-w4G99EF1Fe this is the library

see if you can open or extract if you please

Looks like you have a really old version of SmartMatrix Library, based on 3.0.2 from 2016, with at least one file modified MatrixHardware_RGB_DMD.h

SmartMatrix Library 4.0 is now up on GitHub in the ‘master’ branch. You can follow the instructions in the MIGRATION doc and try to make a new MatrixHardware file appropriate for your hardware. You might want to contact whoever made those SmartMatrix Library modifications and see if they can help you update your hardware and code for the Teensy 4.

The Teensy 4 requires an external latch chip to run, see the design files in /extras/hardware, while your MatrixHardware file tells me you’re using a bare Teensy 3 with no external latch chip. Also the pinout is different between Teensy 3 and Teensy 4.

thanks, but to migrate to smartmatrix4.0 the library i have smartmatrix3 i have to copy some files from the smartmatrix4 library or not ?

what changes do i have to make on smartmatrix3 that i have to work with teensy 4.0 ?

SmartMatrix Library 4.0 replaces SmartMatrix Library 3.x

because then I have to delete the smartmatrix3 library and put the smartmatrix4 ?

the file I have on smartmatrix3 which is MatrixHardware_RGB_DMD.h, just copy that file to smartmatrix4 ?

I tried everything to get it with teensy 4.0 and I was not always able to see errors and errors when compiling.

would appreciate your help.