mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 09:04:24 +01:00
support for direct-to-epd-fb-draw 1.54"
This commit is contained in:
@@ -334,7 +334,24 @@ void ByteDecode(uint8_t byte) {
|
||||
epdSend(prev);
|
||||
}
|
||||
}
|
||||
|
||||
#if (SCREEN_WIDTH == 152)
|
||||
void drawImageFromBuffer(uint8_t* buffer, const uint8_t lut) {
|
||||
pr("Doing raw 1bpp\n");
|
||||
epdSetup();
|
||||
if (lut) selectLUT(lut);
|
||||
beginFullscreenImage();
|
||||
clearScreen();
|
||||
beginWriteFramebuffer(EPD_COLOR_BLACK);
|
||||
epdSelect();
|
||||
for (uint16_t c = 0; c < (SCREEN_HEIGHT * (SCREEN_WIDTH / 8)); c++) {
|
||||
epdSend(buffer[c]);
|
||||
}
|
||||
epdDeselect();
|
||||
endWriteFramebuffer();
|
||||
addOverlay();
|
||||
drawWithSleep();
|
||||
}
|
||||
#endif
|
||||
void drawImageAtAddress(uint32_t addr, uint8_t lut) {
|
||||
struct EepromImageHeader* __xdata eih = (struct EepromImageHeader*)mClutMap;
|
||||
eepromRead(addr, mClutMap, sizeof(struct EepromImageHeader));
|
||||
|
||||
@@ -8,6 +8,6 @@
|
||||
void set_offline(__bit state);
|
||||
#pragma callee_saves drawImageAtAddress
|
||||
void drawImageAtAddress(uint32_t addr, uint8_t lut);
|
||||
|
||||
void drawImageFromBuffer(uint8_t* buffer, const uint8_t lut);
|
||||
|
||||
#endif
|
||||
|
||||
BIN
tag_fw/fw154.bin
BIN
tag_fw/fw154.bin
Binary file not shown.
@@ -23,6 +23,7 @@
|
||||
#include "timer.h"
|
||||
#include "userinterface.h"
|
||||
#include "wdt.h"
|
||||
#include "screen.h"
|
||||
|
||||
// download-stuff
|
||||
uint8_t __xdata blockXferBuffer[BLOCK_XFER_BUFFER_SIZE] = {0};
|
||||
@@ -681,8 +682,38 @@ static bool downloadImageDataToEEPROM(const struct AvailDataInfo *__xdata avail)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool processAvailDataInfo(const struct AvailDataInfo *__xdata avail) {
|
||||
bool processAvailDataInfo(struct AvailDataInfo *__xdata avail) {
|
||||
switch (avail->dataType) {
|
||||
#if (SCREEN_WIDTH == 152)
|
||||
// the 1.54" screen is pretty small, we can write an entire 1bpp image from the block transfer buffer directly to the EPD buffer
|
||||
case DATATYPE_IMG_RAW_1BPP_DIRECT:
|
||||
pr("Direct draw image received\n");
|
||||
if (curDataInfo.dataSize == 0 && xMemEqual((const void *__xdata) & avail->dataVer, (const void *__xdata) & curDataInfo.dataVer, 8)) {
|
||||
// we've downloaded this already, we're guessing it's already displayed
|
||||
pr("currently shown image, send xfc\n");
|
||||
powerUp(INIT_RADIO);
|
||||
sendXferComplete();
|
||||
powerDown(INIT_RADIO);
|
||||
return true;
|
||||
}
|
||||
xMemCopyShort(&curDataInfo, (void *)avail, sizeof(struct AvailDataInfo));
|
||||
if (avail->dataSize > 4096) avail->dataSize = 4096;
|
||||
|
||||
if (getDataBlock(avail->dataSize)) {
|
||||
powerUp(INIT_RADIO);
|
||||
sendXferComplete();
|
||||
powerDown(INIT_RADIO);
|
||||
|
||||
curDataInfo.dataSize = 0; // mark as transfer not pending
|
||||
powerUp(INIT_EPD);
|
||||
drawImageFromBuffer(blockXferBuffer, drawWithLut);
|
||||
powerDown(INIT_EPD);
|
||||
drawWithLut = 0; // default back to the regular ol' stock/OTP LUT
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
#endif
|
||||
case DATATYPE_IMG_BMP:
|
||||
case DATATYPE_IMG_DIFF:
|
||||
case DATATYPE_IMG_RAW_1BPP:
|
||||
|
||||
@@ -17,7 +17,7 @@ extern void killRadio(void);
|
||||
extern struct AvailDataInfo *__xdata getAvailDataInfo();
|
||||
extern struct AvailDataInfo *__xdata getShortAvailDataInfo();
|
||||
extern void drawImageFromEeprom(const uint8_t imgSlot);
|
||||
extern bool processAvailDataInfo(const struct AvailDataInfo *__xdata avail);
|
||||
extern bool processAvailDataInfo(struct AvailDataInfo *__xdata avail);
|
||||
extern void initializeProto();
|
||||
extern uint8_t detectAP(const uint8_t channel);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user