Skip to content

Commit 5cbaccd

Browse files
Merge pull request #158 from EricPung/master
Update low power features in deep sleep.
2 parents b378852 + e90e02a commit 5cbaccd

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/HT_lCMEN2R13EFC1.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -377,14 +377,14 @@ class HT_ICMEN2R13EFC1 : public ScreenDisplay
377377
sendData(y); //
378378
sendData(y + h - 1); // H End 48/8=6
379379
sendData(x);
380-
sendData(x + w-1); // V End 32
380+
sendData(x + w - 1); // V End 32
381381
}
382382
void dis_img_Partial_Refresh(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const unsigned char *img)
383383
{
384384
unsigned int row, col;
385385
unsigned int pcnt;
386386
unsigned char Byte1, Byte2, Byte3;
387-
Byte1 = h*8;
387+
Byte1 = h * 8;
388388
Byte2 = y;
389389
/***************************************************Partial_Refresh image****************************************************/
390390

@@ -408,7 +408,7 @@ class HT_ICMEN2R13EFC1 : public ScreenDisplay
408408
}
409409

410410
sendCommand(0x92); // partial out
411-
WRITE_LUT_RED(); //
411+
WRITE_LUT_RED(); //
412412
// sendCommand(0x50);
413413
// sendData(0x07); // border CleaeScreep_LUT()
414414
sendCommand(0xE0);
@@ -422,14 +422,14 @@ class HT_ICMEN2R13EFC1 : public ScreenDisplay
422422
WaitUntilIdle();
423423
sendCommand(0x02);
424424
}
425-
void dis_str_Partial_Refresh(int16_t x, int16_t y, uint8_t ch,FontDef font)
425+
void dis_str_Partial_Refresh(int16_t x, int16_t y, uint8_t ch, FontDef font)
426426
{
427427
unsigned int row, col;
428428
unsigned int pcnt;
429429
unsigned char Byte1, Byte2, Byte3;
430430
// uint8_t textHeight = pgm_read_byte(fontData + HEIGHT_POS);
431431
// uint16_t textWidth = pgm_read_byte(fontData + FIRST_CHAR_POS);
432-
Byte1 = font.height ;
432+
Byte1 = font.height;
433433
Byte2 = (y / 8) * 8 + 1;
434434

435435
/***************************************************Partial_Refresh image****************************************************/
@@ -440,7 +440,7 @@ class HT_ICMEN2R13EFC1 : public ScreenDisplay
440440
sendCommand(0x90);
441441
WaitUntilIdle();
442442
// setwin(x, Byte2, w, Byte1);
443-
setwin(x, y, font.width , Byte1);
443+
setwin(x, y, font.width, Byte1);
444444
sendData(0x01);
445445
sendCommand(0x13); // DTM1 Write
446446
WaitUntilIdle();
@@ -449,7 +449,7 @@ class HT_ICMEN2R13EFC1 : public ScreenDisplay
449449

450450
for (i = 0; i < font.height; i++)
451451
{
452-
b = font.data[(ch - 32) * font.height + i];
452+
b = font.data[(ch - 32) * font.height + i];
453453
for (j = 0; j < font.width; j++)
454454
{
455455
if ((b << j) & 0x8000)
@@ -464,7 +464,7 @@ class HT_ICMEN2R13EFC1 : public ScreenDisplay
464464
}
465465
sendCommand(0x92); // partial out
466466

467-
WRITE_LUT_RED();
467+
WRITE_LUT_RED();
468468
// sendCommand(0x50);
469469
// sendData(0x07); // border CleaeScreep_LUT()
470470

@@ -492,6 +492,8 @@ class HT_ICMEN2R13EFC1 : public ScreenDisplay
492492
{ // LOW: idle, HIGH: busy
493493
// return;
494494
// Serial.println("busy");
495+
esp_sleep_enable_timer_wakeup(10 * 1000);
496+
esp_light_sleep_start();
495497
}
496498
delay(100);
497499
}

0 commit comments

Comments
 (0)