diff --git a/tag_fw/drawing.c b/tag_fw/drawing.c index 4ed967b9..5462ee58 100644 --- a/tag_fw/drawing.c +++ b/tag_fw/drawing.c @@ -333,7 +333,7 @@ void ByteDecode(uint8_t byte) { } } -void drawImageAtAddress(uint32_t addr) { +void drawImageAtAddress(uint32_t addr, uint8_t lut) { uint32_t __xdata clutAddr; pr("sending to EPD - "); clutAddr = drawPrvParseHeader(addr); @@ -342,6 +342,7 @@ void drawImageAtAddress(uint32_t addr) { drawPrvLoadAndMapClut(clutAddr); epdSetup(); + if(lut)selectLUT(lut); mPassNo = 0; beginFullscreenImage(); beginWriteFramebuffer(EPD_COLOR_BLACK); diff --git a/tag_fw/drawing.h b/tag_fw/drawing.h index 4e216e9e..cdd1c939 100644 --- a/tag_fw/drawing.h +++ b/tag_fw/drawing.h @@ -7,7 +7,7 @@ void set_offline(__bit state); #pragma callee_saves drawImageAtAddress -void drawImageAtAddress(uint32_t addr); +void drawImageAtAddress(uint32_t addr, uint8_t lut); #endif diff --git a/tag_fw/fw154.bin b/tag_fw/fw154.bin index 3f06a828..087570fb 100644 Binary files a/tag_fw/fw154.bin and b/tag_fw/fw154.bin differ diff --git a/tag_fw/fw29.bin b/tag_fw/fw29.bin index 211ef15d..4d8d72c5 100644 Binary files a/tag_fw/fw29.bin and b/tag_fw/fw29.bin differ diff --git a/tag_fw/fw42.bin b/tag_fw/fw42.bin index 3fbc023d..30a13fba 100644 Binary files a/tag_fw/fw42.bin and b/tag_fw/fw42.bin differ diff --git a/tag_fw/syncedproto.c b/tag_fw/syncedproto.c index b023e372..6b11b324 100644 --- a/tag_fw/syncedproto.c +++ b/tag_fw/syncedproto.c @@ -38,6 +38,7 @@ uint8_t __xdata curImgSlot = 0; uint32_t __xdata curHighSlotId = 0; uint8_t __xdata nextImgSlot = 0; uint8_t __xdata imgSlots = 0; +uint8_t __xdata drawWithLut = 0; // doDownload persistent variables bool __xdata lastBlock = false; @@ -456,7 +457,9 @@ void drawImageFromEeprom() { // enable WDT, to make sure de tag resets if it's for some reason unable to draw the image wdtSetResetVal(0xFFFFFFFF - 0x38C340); wdtOn(); - drawImageAtAddress(getAddressForSlot(curImgSlot)); + + drawImageAtAddress(getAddressForSlot(curImgSlot), drawWithLut); + drawWithLut = 0; // default back to the regular ol' stock/OTP LUT powerDown(INIT_EPD); } uint32_t getHighSlotId() { @@ -519,7 +522,7 @@ bool doDataDownload(struct AvailDataInfo *__xdata avail) { // mark as completed and draw from EEPROM curXferComplete = true; xMemCopyShort(&curDataInfo, (void *)avail, sizeof(struct AvailDataInfo)); - + drawWithLut = avail->dataTypeArgument; drawImageFromEeprom(); return true; } else { @@ -528,7 +531,7 @@ bool doDataDownload(struct AvailDataInfo *__xdata avail) { nextImgSlot++; if (nextImgSlot >= imgSlots) nextImgSlot = 0; curImgSlot = nextImgSlot; - + drawWithLut = avail->dataTypeArgument; eepromErase(getAddressForSlot(curImgSlot), EEPROM_IMG_EACH / EEPROM_ERZ_SECTOR_SZ); pr("new download, writing to slot %d\n", curImgSlot); // continue!