MCPcopy Create free account
hub / github.com/OpenEPaperLink/OpenEPaperLink / drawCounter

Function drawCounter

ESP32_AP-Flasher/src/contentmanager.cpp:147–157  ·  view source on GitHub ↗

@brief Draw a counter @param mac Destination mac @param taginfo Tag information @param cfgobj Tag config as json object @param filename Filename @param imageParams Image parameters @param nextupdate Next counter update @param nextCheckin Next tag checkin

Source from the content-addressed store, hash-verified

145/// @param nextupdate Next counter update
146/// @param nextCheckin Next tag checkin
147void drawCounter(const uint8_t mac[8], tagRecord *&taginfo, JsonObject &cfgobj, String &filename, imgParam &imageParams, const uint32_t nextupdate, const uint16_t nextCheckin) {
148 int32_t counter = cfgobj["counter"].as<int32_t>();
149 bool buttonPressed = false;
150 if (buttonPressed) { // fixme: button pressed
151 counter = 0;
152 }
153 drawNumber(filename, counter, (int32_t)cfgobj["thresholdred"], taginfo, imageParams);
154 taginfo->nextupdate = nextupdate;
155 updateTagImage(filename, mac, (buttonPressed ? 0 : nextCheckin), taginfo, imageParams);
156 cfgobj["counter"] = counter + 1;
157}
158
159void drawNew(const uint8_t mac[8], tagRecord *&taginfo) {
160 time_t now;

Callers 1

drawNewFunction · 0.85

Calls 2

drawNumberFunction · 0.85
updateTagImageFunction · 0.85

Tested by

no test coverage detected