Test example poop

This commit is contained in:
Steven Tracey 2024-11-20 15:12:12 -05:00
parent 47fbfb0fc2
commit 07d4fddbb8

View File

@ -29,6 +29,27 @@ void Handler(int sigNum) {
} }
int draw() { int draw() {
Debug("EPD_2in13_V4_test Demo\r\n");
if(DEV_Module_Init()!=0){
return -1;
}
Debug("e-Paper Init and Clear...\r\n");
EPD_2in13_V4_Init();
struct timespec start={0,0}, finish={0,0};
clock_gettime(CLOCK_REALTIME,&start);
EPD_2in13_V4_Clear();
clock_gettime(CLOCK_REALTIME,&finish);
Debug("%ld S\r\n",finish.tv_sec-start.tv_sec);
//Create a new image cache
UBYTE *BlackImage;
UWORD Imagesize = ((EPD_2in13_V4_WIDTH % 8 == 0)? (EPD_2in13_V4_WIDTH / 8 ): (EPD_2in13_V4_WIDTH / 8 + 1)) * EPD_2in13_V4_HEIGHT;
if((BlackImage = (UBYTE *)malloc(Imagesize)) == NULL) {
Debug("Failed to apply for black memory...\r\n");
return -1;
}
Paint_NewImage(BlackImage, EPD_2in13_V4_WIDTH, EPD_2in13_V4_HEIGHT, 90, WHITE); Paint_NewImage(BlackImage, EPD_2in13_V4_WIDTH, EPD_2in13_V4_HEIGHT, 90, WHITE);
Debug("Drawing\r\n"); Debug("Drawing\r\n");
//1.Select Image //1.Select Image
@ -86,12 +107,13 @@ int draw() {
Paint_DrawTime(150, 80, &sPaint_time, &Font20, WHITE, BLACK); Paint_DrawTime(150, 80, &sPaint_time, &Font20, WHITE, BLACK);
num = num - 1; num = num - 1;
if(num == 0) { if (num == 0) {
break; break;
} }
EPD_2in13_V4_Display_Partial(BlackImage); EPD_2in13_V4_Display_Partial(BlackImage);
DEV_Delay_ms(500);//Analog clock 1s DEV_Delay_ms(500);//Analog clock 1s
}
DEV_Delay_ms(5000); DEV_Delay_ms(5000);
Debug("Clear...\r\n"); Debug("Clear...\r\n");