mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 13:06:23 +01:00
ESP: Added feature to preload images
This commit is contained in:
Binary file not shown.
@@ -28,6 +28,10 @@ struct imgParam {
|
||||
|
||||
uint8_t lut;
|
||||
uint8_t shortlut;
|
||||
|
||||
bool preload;
|
||||
uint8_t preloadtype;
|
||||
uint8_t preloadlut;
|
||||
};
|
||||
|
||||
void spr2buffer(TFT_eSprite &spr, String &fileout, imgParam &imageParams);
|
||||
|
||||
@@ -230,6 +230,11 @@ void drawNew(const uint8_t mac[8], const bool buttonPressed, tagRecord *&taginfo
|
||||
}
|
||||
if (contentFS->exists(configFilename)) {
|
||||
imageParams.dither = cfgobj["dither"] && cfgobj["dither"] == "1";
|
||||
|
||||
imageParams.preload = cfgobj["preload"] && cfgobj["preload"] == "1";
|
||||
imageParams.preloadlut = cfgobj["preload_lut"];
|
||||
imageParams.preloadtype = cfgobj["preload_type"];
|
||||
|
||||
jpg2buffer(configFilename, filename, imageParams);
|
||||
} else {
|
||||
filename = "/current/" + String(hexmac) + ".raw";
|
||||
@@ -246,7 +251,18 @@ void drawNew(const uint8_t mac[8], const bool buttonPressed, tagRecord *&taginfo
|
||||
imageParams.dataType = DATATYPE_IMG_RAW_2BPP;
|
||||
if (imageParams.lut = EPD_LUT_NO_REPEATS && imageParams.shortlut == SHORTLUT_ONLY_BLACK) imageParams.lut = EPD_LUT_DEFAULT;
|
||||
}
|
||||
if (prepareDataAvail(filename, imageParams.dataType, imageParams.lut, mac, cfgobj["timetolive"].as<int>())) {
|
||||
|
||||
struct imageDataTypeArgStruct arg = {0};
|
||||
// load parameters in case we do need to preload an image
|
||||
if (imageParams.preload) {
|
||||
arg.preloadImage = 1;
|
||||
arg.specialType = imageParams.preloadtype;
|
||||
arg.lut = imageParams.preloadlut;
|
||||
} else {
|
||||
arg.lut = imageParams.lut & 0x03;
|
||||
}
|
||||
|
||||
if (prepareDataAvail(filename, imageParams.dataType, *((uint8_t *)&arg), mac, cfgobj["timetolive"].as<int>())) {
|
||||
if (cfgobj["delete"].as<String>() == "1") {
|
||||
contentFS->remove("/" + configFilename);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,47 @@
|
||||
"0": "off",
|
||||
"1": "on"
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "preload",
|
||||
"name": "Display or Preload",
|
||||
"desc": "Display now or preload for later use",
|
||||
"type": "select",
|
||||
"options": {
|
||||
"0": "Display",
|
||||
"1": "Preload"
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "preload_lut",
|
||||
"name": "Preload LUT",
|
||||
"desc": "Triggered preload images will display with this LUT",
|
||||
"type": "select",
|
||||
"options": {
|
||||
"0": "Default",
|
||||
"1": "No Repeats",
|
||||
"2": "Fast No Reds",
|
||||
"3": "Fast"
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "preload_type",
|
||||
"name": "Preload Image type",
|
||||
"desc": "Preload type to send to tag, for later recall, or special use",
|
||||
"type": "select",
|
||||
"options": {
|
||||
"0": "Normal",
|
||||
"1": "UI: Splash Screen",
|
||||
"2": "UI: Lost connection",
|
||||
"3": "UI: AP Found",
|
||||
"4": "UI: No AP Found",
|
||||
"5": "UI: Long Term Sleep",
|
||||
"15": "Slideshow image",
|
||||
"16": "Wake: Button 1",
|
||||
"17": "Wake: Button 2",
|
||||
"29": "Wake: GPIO",
|
||||
"30": "Wake: NFC"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -649,6 +690,9 @@
|
||||
"id": 21,
|
||||
"name": "Access point info",
|
||||
"desc": "Displays information about the currently connected access point",
|
||||
"hwtype": [0, 1]
|
||||
"hwtype": [
|
||||
0,
|
||||
1
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
Reference in New Issue
Block a user