KurtE
Senior Member+
Sorry for separate thread for this, have eluded to it in a few threads.
As I have mentioned in the ILI9488_t3 thread, would like to allow the library to compile a couple of different ways, especially for the T4.1
Right now it can compile differently if you uncomment the line: //#define ENABLE_EXT_DMA_UPDATES // This is only valid for those T4.1 which have external memory.
in the header file. In which case the frame buffer compiles for 32 bits per pixel in extended memory.
BUT I can imagine you may not want this for all of your T4.1s.
So I was thinking about maybe trying to set up a sketch specific include that says, I want that option and hopefully have the library compile see that file was defined and load it and have whatever specific options the user wants for that sketch.
So I thought I would try: #if __has_include
First attempt was to define a file as part of the sketch: like user_options.h
I do a #include of it as part of my sketch and it does not find or use it...
Probably because the file gets copied to some other location.
So then thought maybe add a new header file to the library like:
And it always finds it.
One option that appears to work, is a create a new bogus library with this header file in it.
In my case I created a directory in the <sketch directory>/libraries/ILI9488_options
And create the file: ILI9488_enable_extmem.h
And then in my sketch I added that:
And the compile appears to work with it:
But was sort of wondering if there is a cleaner way?
As I have mentioned in the ILI9488_t3 thread, would like to allow the library to compile a couple of different ways, especially for the T4.1
Right now it can compile differently if you uncomment the line: //#define ENABLE_EXT_DMA_UPDATES // This is only valid for those T4.1 which have external memory.
in the header file. In which case the frame buffer compiles for 32 bits per pixel in extended memory.
BUT I can imagine you may not want this for all of your T4.1s.
So I was thinking about maybe trying to set up a sketch specific include that says, I want that option and hopefully have the library compile see that file was defined and load it and have whatever specific options the user wants for that sketch.
So I thought I would try: #if __has_include
First attempt was to define a file as part of the sketch: like user_options.h
I do a #include of it as part of my sketch and it does not find or use it...
Code:
#if __has_include(<user_options.h>)
# include <user_options.h>
#pragma message "ILI9488_t3h - included user_options.h"
#endif
So then thought maybe add a new header file to the library like:
Code:
#if __has_include(<ILI9488_enable_extmem.h>)
# include <ILI9488_enable_extmem.h>
#pragma message "ILI9488_t3h - included ILI9488_enable_extmem.h"
#endif
One option that appears to work, is a create a new bogus library with this header file in it.
In my case I created a directory in the <sketch directory>/libraries/ILI9488_options
And create the file: ILI9488_enable_extmem.h
And then in my sketch I added that:
Code:
#include "SPI.h"
# include <ILI9488_enable_extmem.h>
#include "ILI9488_t3.h"
And the compile appears to work with it:
Code:
"C:\\arduino-1.8.12\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=152 -DARDUINO=10812 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Users\\kurte\\AppData\\Local\\Temp\\arduino_build_4969/pch" "-IC:\\arduino-1.8.12\\hardware\\teensy\\avr\\cores\\teensy4" "-IC:\\Users\\kurte\\Documents\\Arduino\\libraries\\SPI" "-IC:\\Users\\kurte\\Documents\\Arduino\\libraries\\ILI9488_options" "-IC:\\Users\\kurte\\Documents\\Arduino\\libraries\\ILI9488_t3\\src" "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino_build_4969\\sketch\\Configure_test_graphicstest9488.ino.cpp" -o "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino_build_4969\\sketch\\Configure_test_graphicstest9488.ino.cpp.o"
In file included from C:\Users\kurte\Documents\Arduino\Teensy Tests\Configure_test_graphicstest9488\Configure_test_graphicstest9488.ino:17:0:
C:\Users\kurte\Documents\Arduino\libraries\ILI9488_t3\src/ILI9488_t3.h:53:17: note: #pragma message: ILI9488_t3h - included user_options.h
#pragma message "ILI9488_t3h - included user_options.h"
^