Macros for memory location (T4/4.1) ?

vindar

Well-known member
Hi,

Is there available macros to check whether a given address resides in DTCM, DMAMEM, EXTRAM, FLASH, ... ? I checked a bit but I did not find anything conclusive except a macro IS_EXTRAM() in cores/teensy4/extmem.c.
And by the way, this macro contains a typo: 'ptr' should be replaced by 'addr' in line 11 (which won't change anything since the macro is always called with 'ptr' as argument in the code anyway).

For the time being, I am using hard-coded values to check memory regions but it might be nice to have macros defined in teensyduino to make the code a little more portable. For example a macro IS_PROGMEM() could be useful to check if a variable is located in flash (and it could be implemented for all Teensy models).
 
Back
Top