From 59c7cbd27680c2dd1f836343bbb4f89680264c5e Mon Sep 17 00:00:00 2001 From: imi415 Date: Tue, 12 Jan 2021 23:28:52 +0800 Subject: [PATCH] Check EPD sleep inside direction function. --- depg0213_epd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/depg0213_epd.c b/depg0213_epd.c index 92c9d97..1b585e9 100644 --- a/depg0213_epd.c +++ b/depg0213_epd.c @@ -177,6 +177,10 @@ depg0213_ret_t depg0213_epd_deepsleep(depg0213_epd_t *epd) { depg0213_ret_t depg0213_epd_direction(depg0213_epd_t *epd, depg0213_direction_t direction) { + if(epd->deep_sleep) { + DEPG0213_ERROR_CHECK(depg0213_epd_init(epd)); + } + // Default mode: VERTICAL, X: 0x0C->0x00, Y: 0xD3->0x00, AM-|Y-|X- uint8_t cmd_ram_x_address[] = { 0x44, 0x0C, 0x00 }; // CMD, START, END uint8_t cmd_ram_y_address[] = { 0x45, 0xD3, 0x00, 0x00, 0x00 }; // CMD, START_L, START_H, END_L, END_H