Some changes
This commit is contained in:
26
c/src/p2fa.c
26
c/src/p2fa.c
@@ -7,6 +7,7 @@
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "../libs/go_p2fa.h"
|
||||
#include "images.h"
|
||||
#include "../libs/e-Paper/EPD_2in13_V4.h"
|
||||
#include "../libs/GUI/GUI_Paint.h"
|
||||
@@ -19,6 +20,31 @@ void Handler(int sigNum) {
|
||||
}
|
||||
|
||||
int draw() {
|
||||
if (DEV_Module_Init() != 0) {
|
||||
return -1;
|
||||
}
|
||||
EPD_2in13_V4_Init();
|
||||
|
||||
Paint_Clear(WHITE);
|
||||
const char *confName = "default";
|
||||
Paint_DrawString(5, 5, getCode(GoString{confName, strlen(confName)}).p, &Font24, WHITE, BLACK);
|
||||
|
||||
DEV_Delay_ms(5000);
|
||||
|
||||
Debug("Clear...\r\n");
|
||||
EPD_2in13_V4_Init();
|
||||
EPD_2in13_V4_Clear();
|
||||
|
||||
Debug("Goto Sleep...\r\n");
|
||||
EPD_2in13_V4_Sleep();
|
||||
DEV_Delay_ms(2000);//important, at least 2s
|
||||
// close 5V
|
||||
Debug("close 5V, Module enters 0 power consumption ...\r\n");
|
||||
DEV_Module_Exit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int drawOld() {
|
||||
Debug("EPD_2in13_V4_test Demo\r\n");
|
||||
if(DEV_Module_Init()!=0){
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user