SSD1289 setViewPort bugfix
This commit is contained in:
parent
a4a815f6f3
commit
8da73efced
2 changed files with 4 additions and 3 deletions
|
@ -299,8 +299,8 @@ static void lld_lcdSetViewPort(uint16_t x, uint16_t y, uint16_t cx, uint16_t cy)
|
|||
lld_lcdWriteReg(0x45, y & 0x01FF);
|
||||
lld_lcdWriteReg(0x46, (y+cy-1) & 0x01FF);
|
||||
break;
|
||||
case GDISP_ROTATE_90:
|
||||
lld_lcdWriteReg(0x44, (((x+cx-1) << 8) & 0xFF00) | ((y+cy) & 0x00FF));
|
||||
case GDISP_ROTATE_270:
|
||||
lld_lcdWriteReg(0x44, (((x+cx-1) << 8) & 0xFF00 ) | (y & 0x00FF));
|
||||
lld_lcdWriteReg(0x45, x & 0x01FF);
|
||||
lld_lcdWriteReg(0x46, (x+cx-1) & 0x01FF);
|
||||
break;
|
||||
|
@ -309,7 +309,7 @@ static void lld_lcdSetViewPort(uint16_t x, uint16_t y, uint16_t cx, uint16_t cy)
|
|||
lld_lcdWriteReg(0x45, (GDISP_SCREEN_HEIGHT-(y+cy)) & 0x01FF);
|
||||
lld_lcdWriteReg(0x46, (GDISP_SCREEN_HEIGHT-y-1) & 0x01FF);
|
||||
break;
|
||||
case GDISP_ROTATE_270:
|
||||
case GDISP_ROTATE_90:
|
||||
lld_lcdWriteReg(0x44, (((GDISP_SCREEN_WIDTH - y - 1) & 0x00FF) << 8) | ((GDISP_SCREEN_WIDTH - (y+cy)) & 0x00FF));
|
||||
lld_lcdWriteReg(0x45, (GDISP_SCREEN_HEIGHT - (x+cx)) & 0x01FF);
|
||||
lld_lcdWriteReg(0x46, (GDISP_SCREEN_HEIGHT - x - 1) & 0x01FF);
|
||||
|
|
|
@ -214,6 +214,7 @@ void tpCalibrate(void) {
|
|||
uint16_t points[2][2];
|
||||
uint8_t i;
|
||||
|
||||
gdispSetOrientation(GDISP_ROTATE_0);
|
||||
gdispClear(Red);
|
||||
gdispFillStringBox(0, 10, gdispGetWidth(), 30, "Calibration", &fontUI2Double, White, Red, justifyCenter);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue