From fa82491a0badcb1d6afb46554655deec35a4a9f3 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Tue, 27 Nov 2012 23:11:34 +0100 Subject: [PATCH] ILI9320 fix --- drivers/gdisp/ILI9320/gdisp_lld.c | 8 ++++---- drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gdisp/ILI9320/gdisp_lld.c b/drivers/gdisp/ILI9320/gdisp_lld.c index f670966c..5ca5dceb 100644 --- a/drivers/gdisp/ILI9320/gdisp_lld.c +++ b/drivers/gdisp/ILI9320/gdisp_lld.c @@ -244,10 +244,10 @@ static void lld_lcdSetCursor(uint16_t x, uint16_t y) { static void lld_lcdSetViewPort(uint16_t x, uint16_t y, uint16_t cx, uint16_t cy) { switch(GDISP.Orientation) { case GDISP_ROTATE_0: - lld_lcdWriteReg(0x0050, x - 1); - lld_lcdWriteReg(0x0051, x + cx - 2); - lld_lcdWriteReg(0x0052, y - 1); - lld_lcdWriteReg(0x0053, y + cy - 2); + lld_lcdWriteReg(0x0050, x); + lld_lcdWriteReg(0x0051, x + cx - 1); + lld_lcdWriteReg(0x0052, y); + lld_lcdWriteReg(0x0053, y + cy - 1); break; case GDISP_ROTATE_90: diff --git a/drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h b/drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h index e9b808c0..a6d9d631 100644 --- a/drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h +++ b/drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h @@ -44,8 +44,7 @@ static __inline void GDISP_LLD(init_board)(void) { palSetPadMode(GPIOE, GPIOE_TFT_RST, PAL_MODE_OUTPUT_PUSHPULL); palSetPadMode(GPIOD, GPIOD_TFT_LIGHT, PAL_MODE_OUTPUT_PUSHPULL); - /* const unsigned char FSMC_Bank = 0; */ - const unsigned char FSMC_Bank = 6; + const unsigned char FSMC_Bank = 0; /* FSMC timing */ FSMC_Bank1->BTCR[FSMC_Bank+1] = (6) | (10 << 8) | (10 << 16);