@mjs513 @wwatson will also probably play soon as well.
Sorry, I have been taking another Diversion into other boards.
Wondered about could this run on the Uno R4 Wifi...
Everyone can probably mostly ignore...
First check the WIfi Worked to get information... Now display...
First created version of ST77XX for renesas... Also tried Adafruit_ST7796...
Would not fit in Flash... First I thought Fonts... But cut down to even with Adafruit and only one Font, did not fit...
Flash is only 256KB and turns out the Weather icon images probably take 200K
Each image: 64x64x2=8192 * 22 files = 180224.
The UNO R4 WiFi's memory is larger than its predecessors,
with 256 kB flash, 32 kB SRAM and 8 kB of EEPROM
So attempt one, instead of simple bitmap image in the files, simply convert PNG files into c structures...
Worked, BUT: then PNGDEC would not fit in RAM... Looking at PNGDEC readme:
Runs on any MCU with at least 48K of free RAM
Probably not 48K free on a board with 32K
Next attempt is now to compress the image files. For those that use < 256 colors convert to palette.
Did a quick and dirty sketch that looped through all of the files and then output the contents of one compressed
...
I have not tried it on the UNO R4 version yet, but hacked up the Teensy_esp32 sketch
That for the images it includes that one generated file. For each image, there is data,
maybe Palette and structure with pointer to both. The output code looks at the structure and if NULL
Code:
void drawPNG(const char *filename, int x, int y) {
#ifdef USE_COMPRESSED_IMAGE
struct image_info *image_info = (struct image_info*)filename;
if (image_info->palette == nullptr) {
tft.writeRect(x, y, 64, 64, (const uint16_t *)image_info->image);
} else {
tft.writeRect8BPP(x, y, 64, 64, (const uint8_t *)image_info->image, image_info->palette);
}
#else
const uint16_t *image = (const uint16_t *)filename;
tft.writeRect(x, y, 64, 64, image);
#endif
};
Works here I think... May try again to convert the UnoR4 version....
Have my Doubts...
As for Fonts, especially on libraries where we have archive option turned on, I am thinking of breaking up some of the fonts.
That is for example take the Arial font, we have in one C file all of:
Code:
extern const ILI9341_t3_font_t Arial_8;
extern const ILI9341_t3_font_t Arial_9;
extern const ILI9341_t3_font_t Arial_10;
extern const ILI9341_t3_font_t Arial_11;
extern const ILI9341_t3_font_t Arial_12;
#ifdef INCLUDE_LARGER_ARIAL
extern const ILI9341_t3_font_t Arial_13;
extern const ILI9341_t3_font_t Arial_14;
extern const ILI9341_t3_font_t Arial_16;
extern const ILI9341_t3_font_t Arial_18;
extern const ILI9341_t3_font_t Arial_20;
extern const ILI9341_t3_font_t Arial_24;
extern const ILI9341_t3_font_t Arial_28;
extern const ILI9341_t3_font_t Arial_32;
extern const ILI9341_t3_font_t Arial_40;
extern const ILI9341_t3_font_t Arial_48;
extern const ILI9341_t3_font_t Arial_60;
extern const ILI9341_t3_font_t Arial_72;
extern const ILI9341_t3_font_t Arial_96;
#endif
What if instead I had a one file for each of the font sizes or at a minimum maybe break it up into
something like 4 files 8-12, 13-16, 20-40, > 40 or some such breakdown.
Then if you don't use any of those very large sizes they should not be pulled into your image...
But that is a different subject.
End Diversion...
Edit: Looks like the basics are setup now...