fix: add delay to ensure command completion; shorten test time

This commit is contained in:
IOsetting 2023-03-12 02:06:17 +08:00
parent 9b6f1f6670
commit 5070ff4633
2 changed files with 5 additions and 3 deletions

View File

@ -103,7 +103,7 @@ int EPD_test(void)
sPaint_time.Hour = 12;
sPaint_time.Min = 34;
sPaint_time.Sec = 56;
UBYTE num = 20;
UBYTE num = 10;
for (;;) {
sPaint_time.Sec = sPaint_time.Sec + 1;
if (sPaint_time.Sec == 60) {

View File

@ -126,6 +126,7 @@ static void EPD_1IN54_SendCommand(UBYTE Reg)
EPD_Digital_Write(EPD_DC_PIN, 0);
EPD_Digital_Write(EPD_CS_PIN, 0);
EPD_SPI_WriteByte(Reg);
EPD_Delay_ms(1);
EPD_Digital_Write(EPD_CS_PIN, 1);
}
@ -148,11 +149,12 @@ parameter:
******************************************************************************/
void EPD_1IN54_ReadBusy(void)
{
EPD_Printf("e-Paper busy\r\n");
EPD_Printf("e-Paper check... ");
while(EPD_Digital_Read(EPD_BUSY_PIN) == 1) { //LOW: idle, HIGH: busy
EPD_Printf("busy ");
EPD_Delay_ms(100);
}
EPD_Printf("e-Paper busy release\r\n");
EPD_Printf("idle\r\n");
}
/******************************************************************************