From 53d24f51c056f6f942190757becd6cb614c2832f Mon Sep 17 00:00:00 2001 From: Tectu Date: Sun, 17 Jun 2012 01:36:39 +0200 Subject: [PATCH] ssd1289 fix --- drivers/lcd/ssd1289_lld.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/lcd/ssd1289_lld.c b/drivers/lcd/ssd1289_lld.c index 12782e31..6d20aa48 100644 --- a/drivers/lcd/ssd1289_lld.c +++ b/drivers/lcd/ssd1289_lld.c @@ -115,29 +115,26 @@ void lld_lcdSetOrientation(uint8_t newOrientation) { void lld_lcdSetWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) { lld_lcdSetCursor(x0, y0); - x1 -= x0; - y1 -= y0; - switch(lcdGetOrientation()) { case portrait: - lld_lcdWriteReg(0x44, ((x0+x1-1) << 8) | x0); + lld_lcdWriteReg(0x44, ((x1-1) << 8) | x0); lld_lcdWriteReg(0x45, y0); - lld_lcdWriteReg(0x46, y0+y1-1); + lld_lcdWriteReg(0x46, y1-1); break; case landscape: - lld_lcdWriteReg(0x44, ((y0+y1-1) << 8) | y1); + lld_lcdWriteReg(0x44, ((y1-1) << 8) | y1); lld_lcdWriteReg(0x45, x0); - lld_lcdWriteReg(0x46, x0+x1-1); + lld_lcdWriteReg(0x46, x1-1); break; case portraitInv: - lld_lcdWriteReg(0x44, ((x0+x1-1) << 8) | x0); + lld_lcdWriteReg(0x44, ((x1-1) << 8) | x0); lld_lcdWriteReg(0x45, y0); - lld_lcdWriteReg(0x46, y0+y1-1); + lld_lcdWriteReg(0x46, y1-1); break; case landscapeInv: - lld_lcdWriteReg(0x44, ((y0+y1-1) << 8) | y1); + lld_lcdWriteReg(0x44, ((y1-1) << 8) | y1); lld_lcdWriteReg(0x45, x0); - lld_lcdWriteReg(0x46, x0+x1-1); + lld_lcdWriteReg(0x46, x1-1); break; } }