Skip to content

Commit

Permalink
Fixed problems in LCD detection
Browse files Browse the repository at this point in the history
  • Loading branch information
richardclli committed Dec 3, 2023
1 parent 95e6b4d commit e385f84
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions radio/src/targets/pl18/lcd_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,10 @@ unsigned char LCD_ReadByte(void) {
LCD_MOSI_AS_INPUT();
for (i = 0; i < 8; i++) {
LCD_SCK_LOW();
LCD_DELAY();
LCD_DELAY();
lcdDelay();
ReceiveData <<= 1;
LCD_SCK_HIGH();
LCD_DELAY();
LCD_DELAY();
lcdDelay();
if (LCD_READ_DATA_PIN()) {
ReceiveData |= 0x01;
}
Expand All @@ -253,8 +251,8 @@ unsigned char LCD_ReadRegister(unsigned char Register) {
unsigned char ReadData = 0;

lcdWriteByte(0, Register);
LCD_DELAY();
LCD_DELAY();
lcdDelay();
lcdDelay();
ReadData = LCD_ReadByte();
return (ReadData);
}
Expand Down Expand Up @@ -1281,11 +1279,11 @@ unsigned int LCD_ST7796S_ReadID(void) {

LCD_MOSI_AS_INPUT();
LCD_SCK_LOW();
LCD_DELAY();
LCD_DELAY();
lcdDelay();
lcdDelay();
LCD_SCK_HIGH();
LCD_DELAY();
LCD_DELAY();
lcdDelay();
lcdDelay();

LCD_ReadByte();
ID += (uint16_t)(LCD_ReadByte())<<8;
Expand Down Expand Up @@ -2842,7 +2840,7 @@ void lcdInit(void)
lcdOnFunction = LCD_HX8357D_On;
lcdPixelClock = 12000000;
} else if (LCD_ST7796S_ReadID() == LCD_ST7796S_ID ) {
TRACE("LCD INIT (default): ST7796S");
TRACE("LCD INIT: ST7796S");
boardLcdType = "ST7796S";
lcdInitFunction = LCD_ST7796S_Init;
lcdOffFunction = LCD_ST7796S_Off;
Expand All @@ -2851,7 +2849,7 @@ void lcdInit(void)
}
else{
TRACE("LCD INIT (default): ST7796S");
boardLcdType = "ST7796S";
boardLcdType = "ST7796S (Default)";
lcdInitFunction = LCD_ST7796S_Init;
lcdOffFunction = LCD_ST7796S_Off;
lcdOnFunction = LCD_ST7796S_On;
Expand Down

0 comments on commit e385f84

Please sign in to comment.