From dcf4ddf3c26ccb83ff5f30e9f368105e081231d7 Mon Sep 17 00:00:00 2001 From: Msq001 <760675063@qq.com> Date: Mon, 25 May 2020 17:28:13 +0800 Subject: [PATCH] fix st7920 bug (#714) fix st7920 bugs after #705 --- TFT/src/User/API/UI/ST7920_Simulator.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/TFT/src/User/API/UI/ST7920_Simulator.c b/TFT/src/User/API/UI/ST7920_Simulator.c index 7a4f9d7077..05c351a416 100644 --- a/TFT/src/User/API/UI/ST7920_Simulator.c +++ b/TFT/src/User/API/UI/ST7920_Simulator.c @@ -558,8 +558,10 @@ void ST7920_ParseRecv(u8 val) { st7920_reg.ctrl_status = (ST7920_CTRL_STATUS)val; rcvIndex = 0; - st7920.address_is_y = 1; - st7920_reg.cgram = 0; + if (st7920_reg.ctrl_status == ST7920_WDATA) { + st7920.address_is_y = 1; + st7920_reg.cgram = 0; + } } else {