zbs243 tag FW 2.0 - added deepsleep

This commit is contained in:
jjwbruijn
2023-08-10 22:26:50 +02:00
parent ffd0acff72
commit e457475ea7
10 changed files with 109 additions and 7 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -6,7 +6,6 @@
#define SOLUM_SEG_EU 0xF1
#define SOLUM_NODISPLAY 0xFF
#define SOLUM_M2_BWR_16 0x20
#define SOLUM_M2_BWR_29 0x23
#define SOLUM_M2_BWR_42 0x24
@@ -55,6 +54,7 @@
#define CMD_DO_REBOOT 0
#define CMD_DO_SCAN 1
#define CMD_DO_RESET_SETTINGS 2
#define CMD_DO_DEEPSLEEP 3
#define WAKEUP_REASON_TIMED 0
#define WAKEUP_REASON_GPIO 2

View File

@@ -173,7 +173,7 @@ uint8_t getFirstWakeUpReason() {
}
void checkI2C() {
powerUp(INIT_I2C);
// i2cBusScan();
// i2cBusScan();
if (i2cCheckDevice(0x55)) {
powerDown(INIT_I2C);
// found something!
@@ -353,6 +353,14 @@ void executeCommand(uint8_t cmd) {
case CMD_DO_SCAN:
currentChannel = channelSelect();
break;
case CMD_DO_DEEPSLEEP:
powerUp(INIT_EPD);
afterFlashScreenSaver();
powerDown(INIT_EPD | INIT_UART);
while (1) {
doSleep(-1);
}
break;
}
}

View File

@@ -21,7 +21,7 @@ $version = hexdec($version);
*/
$version = 0;
exec("ls -1 $binpath | grep 'Tag_FW' | grep -v battery | grep -v Pack", $binaries);
exec("ls -1 $binpath | grep 'Tag_FW' | grep -v battery | grep -v Pack | grep -v M3", $binaries);
foreach($binaries as $file){
$file = trim($file);
$type = -1;

View File

@@ -3,8 +3,8 @@
#include <stdint.h>
#define FW_VERSION 19 // version number (max 2.5.5 :) )
#define FW_VERSION_SUFFIX "-VER" // suffix, like -RC1 or whatever.
#define FW_VERSION 20 // version number (max 2.5.5 :) )
#define FW_VERSION_SUFFIX "-DSLP" // suffix, like -RC1 or whatever.
// #define DEBUGBLOCKS // uncomment to enable extra debug information on the block transfers
// #define PRINT_LUT // uncomment if you want the tag to print the LUT for the current temperature bracket

View File

@@ -87,20 +87,114 @@ void afterFlashScreenSaver() {
setColorMode(EPD_MODE_NORMAL, EPD_MODE_INVERT);
#if (SCREEN_WIDTH == 152) // 1.54"
epdPrintBegin(2, 2, EPD_DIRECTION_X, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdPrintBegin(0, 0, EPD_DIRECTION_X, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("OpenEPaperLink");
epdPrintEnd();
epdPrintBegin(100, 32, EPD_DIRECTION_X, EPD_SIZE_SINGLE, EPD_COLOR_RED);
epdpr("v%d.%d.%d", fwVersion / 100, (fwVersion % 100) / 10, (fwVersion % 10));
epdPrintEnd();
epdPrintBegin(0, 16, EPD_DIRECTION_X, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("I'm fast asleep");
epdPrintEnd();
epdPrintBegin(0, 32, EPD_DIRECTION_X, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("UwU");
epdPrintEnd();
epdPrintBegin(0, 48, EPD_DIRECTION_X, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("To wake me:");
epdPrintEnd();
epdPrintBegin(0, 64, EPD_DIRECTION_X, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("-Remove batteries");
epdPrintEnd();
epdPrintBegin(0, 80, EPD_DIRECTION_X, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("-Short contacts");
epdPrintEnd();
epdPrintBegin(0, 96, EPD_DIRECTION_X, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("-Reinsert batteries");
epdPrintEnd();
epdPrintBegin(0, 112, EPD_DIRECTION_X, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("openepaperlink.de");
epdPrintEnd();
epdPrintBegin(0, 128, EPD_DIRECTION_X, EPD_SIZE_SINGLE, EPD_COLOR_RED);
epdpr("%02X:%02X", mSelfMac[7], mSelfMac[6]);
epdpr(":%02X:%02X", mSelfMac[5], mSelfMac[4]);
epdpr(":%02X:%02X", mSelfMac[3], mSelfMac[2]);
epdpr(":%02X:%02X", mSelfMac[1], mSelfMac[0]);
epdPrintEnd();
#endif
#if (SCREEN_WIDTH == 128) // 2.9"
epdPrintBegin(0, 295, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdPrintBegin(0, 295, EPD_DIRECTION_Y, EPD_SIZE_DOUBLE, EPD_COLOR_BLACK);
epdpr("OpenEPaperLink");
epdPrintEnd();
epdPrintBegin(8, 40, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("v%d.%d.%d", fwVersion / 100, (fwVersion % 100) / 10, (fwVersion % 10));
epdPrintEnd();
epdPrintBegin(32, 290, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("I'm fast asleep... UwU To wake me:");
epdPrintEnd();
epdPrintBegin(48, 275, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("- Remove both batteries");
epdPrintEnd();
epdPrintBegin(64, 275, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("- Short battery contacts");
epdPrintEnd();
epdPrintBegin(80, 275, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("- Reinsert batteries");
epdPrintEnd();
epdPrintBegin(112, 293, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("openepaperlink.de");
epdPrintEnd();
epdPrintBegin(110, 155, EPD_DIRECTION_Y, EPD_SIZE_SINGLE, EPD_COLOR_RED);
epdpr("%02X:%02X", mSelfMac[7], mSelfMac[6]);
epdpr(":%02X:%02X", mSelfMac[5], mSelfMac[4]);
epdpr(":%02X:%02X", mSelfMac[3], mSelfMac[2]);
epdpr(":%02X:%02X", mSelfMac[1], mSelfMac[0]);
epdPrintEnd();
#endif
#if (SCREEN_WIDTH == 400) // 4.2"
epdPrintBegin(3, 3, EPD_DIRECTION_X, EPD_SIZE_DOUBLE, EPD_COLOR_BLACK);
epdpr("OpenEPaperLink");
epdPrintEnd();
epdPrintBegin(360, 8, EPD_DIRECTION_X, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("v%d.%d.%d", fwVersion / 100, (fwVersion % 100) / 10, (fwVersion % 10));
epdPrintEnd();
epdPrintBegin(10, 48, EPD_DIRECTION_X, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("I'm fast asleep... UwU To wake me:");
epdPrintEnd();
epdPrintBegin(20, 70, EPD_DIRECTION_X, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("- Remove both batteries");
epdPrintEnd();
epdPrintBegin(20, 86, EPD_DIRECTION_X, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("- Short battery contacts");
epdPrintEnd();
epdPrintBegin(20, 102, EPD_DIRECTION_X, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("- Reinsert batteries");
epdPrintEnd();
epdPrintBegin(3, 283, EPD_DIRECTION_X, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
epdpr("openepaperlink.de");
epdPrintEnd();
epdPrintBegin(255, 283, EPD_DIRECTION_X, EPD_SIZE_SINGLE, EPD_COLOR_RED);
epdpr("%02X:%02X", mSelfMac[7], mSelfMac[6]);
epdpr(":%02X:%02X", mSelfMac[5], mSelfMac[4]);
epdpr(":%02X:%02X", mSelfMac[3], mSelfMac[2]);
epdpr(":%02X:%02X", mSelfMac[1], mSelfMac[0]);
epdPrintEnd();
#endif
drawWithSleep();
}