Skip to content

Commit

Permalink
Fixed side effects after turning off automatic sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Jan 12, 2024
1 parent 9ee3bd0 commit 5fa0e6f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/touch/TouchClassCST816.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ uint8_t TouchClassCST816::getPoint(int16_t *x_array, int16_t *y_array, uint8_t g
return 0;
}

// Some CST816T will return all 0xFF after turning off automatic sleep.
if (buffer[2] == 0xFF) {
return 0;
}

// Only suitable for AMOLED 1.91 inch
// RAW:00,00,01,80,78,02,58,00,00,FF,FF,FF,FF,
// if (buffer[2] == 0x01 && buffer[3] == 0x80 && buffer[4] == 0x78 && buffer[5] == 0x02 && buffer[6] == 0x58) {
Expand Down

0 comments on commit 5fa0e6f

Please sign in to comment.