diff options
author | Tectu <joel@unormal.org> | 2012-06-17 01:36:39 +0200 |
---|---|---|
committer | Tectu <joel@unormal.org> | 2012-06-17 01:36:39 +0200 |
commit | 53d24f51c056f6f942190757becd6cb614c2832f (patch) | |
tree | a9fc96a836d9e16fb43b8764d222183f1f9de79c /drivers | |
parent | 00646326aa70bcda62f6ad1afbd1b553eedab3ef (diff) | |
download | uGFX-53d24f51c056f6f942190757becd6cb614c2832f.tar.gz uGFX-53d24f51c056f6f942190757becd6cb614c2832f.tar.bz2 uGFX-53d24f51c056f6f942190757becd6cb614c2832f.zip |
ssd1289 fix
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/lcd/ssd1289_lld.c | 19 |
1 files 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; } } |