Worky
This commit is contained in:
parent
9ed97db2ca
commit
b7220df584
14
c/src/p2fa.c
14
c/src/p2fa.c
@ -15,6 +15,17 @@
|
||||
|
||||
void Handler(int 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();
|
||||
exit(0);
|
||||
}
|
||||
@ -36,7 +47,7 @@ int draw() {
|
||||
Paint_Clear(WHITE);
|
||||
|
||||
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";
|
||||
GoString confStr = {confName, strlen(confName)};
|
||||
@ -50,6 +61,7 @@ int draw() {
|
||||
uint64_t timeLeft = getTimeRemainingMS(30);
|
||||
for (int j = 0; j < 3; ++j) {
|
||||
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);
|
||||
EPD_2in13_V4_Display_Partial(BlackImage);
|
||||
DEV_Delay_ms(100);
|
||||
|
Loading…
Reference in New Issue
Block a user