Udisplay finegrain delay (#11894)

* uDisplay add 10ms delay and log

* Silly bug

Co-authored-by: Stephan Hadinger <stephan.hadinger@gmail.com>
This commit is contained in:
s-hadinger 2021-04-26 13:49:42 +02:00 committed by GitHub
parent 04bbbc34d0
commit 61cecdef2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 5 deletions

View File

@ -514,9 +514,20 @@ Renderer *uDisplay::Init(void) {
#ifdef UDSP_DEBUG
Serial.printf("\n");
#endif
if (args & 0x80) {
if (args&0x60) delay(500);
else delay(150);
if (args & 0x80) { // delay after the command
uint32_t delay_ms = 0;
switch (args & 0xE0) {
case 0x80: delay_ms = 150; break;
case 0xA0: delay_ms = 10; break;
case 0xE0: delay_ms = 500; break;
}
if (delay_ms > 0) {
delay(delay_ms);
#ifdef UDSP_DEBUG
Serial.printf("delay %d ms\n", delay_ms);
#endif
}
}
if (index >= dsp_ncmds) break;
}

View File

@ -1,4 +1,3 @@
:H,ST7789,240,240,16,SPI,1,*,*,*,*,*,*,*,40
:S,2,1,3,0,80,30
:I
@ -17,6 +16,6 @@
:1,A0,50,00,01
:2,00,00,00,02
:3,60,00,00,03
i:20,21
:i,20,21
:TI2,38,32,23
#