diff --git a/tag_fw/epd.c b/tag_fw/epd.c index 2612992b..9c93a945 100644 --- a/tag_fw/epd.c +++ b/tag_fw/epd.c @@ -1,6 +1,8 @@ #include "epd.h" + #include #include + #include "asmUtil.h" #include "board.h" #include "cpu.h" @@ -282,8 +284,8 @@ void setWindowY(uint16_t start, uint16_t end) { commandBegin(CMD_WINDOW_Y_SIZE); epdSend((start)&0xff); epdSend((start) >> 8); - epdSend((end)&0xff); // was end-1 - epdSend((end) >> 8); // was end-1 + epdSend((end-1)&0xff); + epdSend((end-1) >> 8); commandEnd(); } void setPosXY(uint16_t x, uint16_t y) { @@ -379,7 +381,7 @@ void loadRawBitmap(uint8_t* bmp, uint16_t x, uint16_t y, bool color) { uint16_t xsize = bmp[0] / 8; if (bmp[0] % 8) xsize++; uint16_t size = xsize * bmp[1]; - setWindowX(x, x+(xsize*8)); + setWindowX(x, x + (xsize * 8)); setWindowY(y, bmp[1] + y); setPosXY(x, y); shortCommand1(CMD_DATA_ENTRY_MODE, 3); @@ -395,7 +397,6 @@ void loadRawBitmap(uint8_t* bmp, uint16_t x, uint16_t y, bool color) { commandEnd(); } - // stuff for printing text static void pushXFontBytesToEPD(uint8_t byte1, uint8_t byte2) { if (epdCharSize == 1) { @@ -543,7 +544,7 @@ void epdPrintBegin(uint16_t x, uint16_t y, bool direction, bool fontsize, bool c rbuffer[1] = 0; } - setWindowY(y, 0); + setWindowY(y, 1); if (epdCharSize == 2) { setWindowX(x, x + 32 + extra); setPosXY(x, y); diff --git a/tag_fw/userinterface.c b/tag_fw/userinterface.c index 7ed389b1..bd7a1cbf 100644 --- a/tag_fw/userinterface.c +++ b/tag_fw/userinterface.c @@ -27,6 +27,7 @@ void showSplashScreen() { loadRawBitmap(solum, 0, 32, EPD_COLOR_BLACK); loadRawBitmap(hacked, 16, 44, EPD_COLOR_RED); + epdPrintBegin(0, 0, EPD_DIRECTION_X, EPD_SIZE_DOUBLE, EPD_COLOR_BLACK); pr("Starting!"); @@ -83,6 +84,12 @@ void showSplashScreen() { pr(":%02X:%02X", mSelfMac[1], mSelfMac[0]); epdPrintEnd(); + loadRawBitmap(solum, 256, 10, EPD_COLOR_BLACK); + loadRawBitmap(hacked, 264, 22, EPD_COLOR_RED); + + loadRawBitmap(solum,253, 72, EPD_COLOR_BLACK); + loadRawBitmap(hacked, 261, 82, EPD_COLOR_RED); + draw(); timerDelay(1333000); #endif