This commit is contained in:
Steven Tracey 2024-11-20 13:26:59 -05:00
parent 9ed97db2ca
commit b7220df584

View File

@ -15,6 +15,17 @@
void Handler(int sigNum) { void Handler(int sigNum) {
printf("Caught signal %d\n", sigNum); printf("Caught signal %d\n", sigNum);
EPD_2in13_V4_Init();
EPD_2in13_V4_Clear();
Debug("Goto Sleep...\r\n");
EPD_2in13_V4_Sleep();
free(BlackImage);
BlackImage = NULL;
DEV_Delay_ms(2000);//important, at least 2s
Debug("close 5V, Module enters 0 power consumption ...\r\n");
DEV_Module_Exit(); DEV_Module_Exit();
exit(0); exit(0);
} }
@ -36,7 +47,7 @@ int draw() {
Paint_Clear(WHITE); Paint_Clear(WHITE);
Paint_SelectImage(BlackImage); Paint_SelectImage(BlackImage);
Paint_DrawString(32, 10, "Hello, World!", &Font16, WHITE, BLACK); Paint_DrawString(10, 40, "Hello, World!", &Font16, WHITE, BLACK);
const char *confName = "default"; const char *confName = "default";
GoString confStr = {confName, strlen(confName)}; GoString confStr = {confName, strlen(confName)};
@ -50,6 +61,7 @@ int draw() {
uint64_t timeLeft = getTimeRemainingMS(30); uint64_t timeLeft = getTimeRemainingMS(30);
for (int j = 0; j < 3; ++j) { for (int j = 0; j < 3; ++j) {
for (int i = getTimeRemainingMS(30); i > 200; i = getTimeRemainingMS(30)) { for (int i = getTimeRemainingMS(30); i > 200; i = getTimeRemainingMS(30)) {
Debug("Time Left: %dms", getTimeRemainingMS(30));
Paint_DrawRectangle(10, 112, (timeLeft / (30 * 1000)) * 240, 92, BLACK, DOT_PIXEL_1X1, DRAW_FILL_FULL); Paint_DrawRectangle(10, 112, (timeLeft / (30 * 1000)) * 240, 92, BLACK, DOT_PIXEL_1X1, DRAW_FILL_FULL);
EPD_2in13_V4_Display_Partial(BlackImage); EPD_2in13_V4_Display_Partial(BlackImage);
DEV_Delay_ms(100); DEV_Delay_ms(100);