chore: Change LCD offset to more generic form

This commit is contained in:
Peter Feerick
2022-08-20 10:59:50 +10:00
committed by Peter Feerick
parent e1ffa373e5
commit f560805fee
2 changed files with 7 additions and 4 deletions
+4
View File
@@ -920,6 +920,10 @@ void fsLedOn(uint8_t);
#else #else
#define LCD_CONTRAST_DEFAULT 15 #define LCD_CONTRAST_DEFAULT 15
#endif #endif
#if defined(RADIO_LR3PRO)
// add offset 2px because driver (SH1106) of the 1.3 OLED is for a 132 display
#define LCD_W_OFFSET 0x02
#endif
#endif #endif
#if defined(PCBX9D) || defined(PCBX9E) || (defined(PCBX9DP) && PCBREV < 2019) #if defined(PCBX9D) || defined(PCBX9E) || (defined(PCBX9DP) && PCBREV < 2019)
+3 -4
View File
@@ -214,10 +214,9 @@ void lcdRefresh(bool wait)
#if LCD_W == 128 #if LCD_W == 128
uint8_t * p = displayBuf; uint8_t * p = displayBuf;
#if defined(RADIO_LR3PRO) #if defined(LCD_W_OFFSET)
// add offset 2px because the driver (SH1106) of the 1.3 OLED is for a 132 display lcdWriteCommand(LCD_W_OFFSET);
lcdWriteCommand(0x02); #endif
#endif
for (uint8_t y=0; y < 8; y++, p+=LCD_W) { for (uint8_t y=0; y < 8; y++, p+=LCD_W) {
lcdWriteCommand(0x10); // Column addr 0 lcdWriteCommand(0x10); // Column addr 0
lcdWriteCommand(0xB0 | y); // Page addr y lcdWriteCommand(0xB0 | y); // Page addr y