diff options
author | Tectu <joel@unormal.org> | 2012-06-07 21:50:55 +0200 |
---|---|---|
committer | Tectu <joel@unormal.org> | 2012-06-07 21:50:55 +0200 |
commit | 3367123b0b13bdecb41abfe3163d61b229a24e72 (patch) | |
tree | 943a600f82f69a5f57333ad473d29d053a60c741 | |
parent | e2aacd374449803a10b5c7f7e54cc63c18961d45 (diff) | |
download | uGFX-3367123b0b13bdecb41abfe3163d61b229a24e72.tar.gz uGFX-3367123b0b13bdecb41abfe3163d61b229a24e72.tar.bz2 uGFX-3367123b0b13bdecb41abfe3163d61b229a24e72.zip |
cleanups
-rw-r--r-- | glcd.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -79,19 +79,19 @@ uint16_t lcdGetWidth(void) { static void lcdSetCursor(uint16_t x, uint16_t y) {
if(DeviceCode==0x8989) {
- if(orientation == portrait || orientation == portraitInv) {
+ if(PORTRAIT) {
lcdWriteReg(0x004e, x);
lcdWriteReg(0x004f, y);
- } else if(orientation == landscape || orientation == landscapeInv) {
+ } else if(LANDSCAPE) {
lcdWriteReg(0x004e, y);
lcdWriteReg(0x004f, x);
}
}
else if(DeviceCode==0x9919) {
- if(orientation == portrait || orientation == portraitInv) {
+ if(PORTRAIT) {
lcdWriteReg(0x004e, x);
lcdWriteReg(0x004f, y);
- } else if(orientation == landscape || orientation == landscapeInv) {
+ } else if(LANDSCAPE) {
lcdWriteReg(0x004e, y);
lcdWriteReg(0x004f, x);
}
@@ -146,14 +146,14 @@ uint16_t lcdGetOrientation(void) { }
void lcdSetWindow(uint16_t x, uint16_t y, uint16_t width, uint16_t height) {
- if(orientation == portrait) {
+ if(lcdGetOrientation() == portrait) {
lcdWriteReg(0x0050, x); /* Horizontal GRAM Start Address */
lcdWriteReg(0x0051, x+width-1); /* Horizontal GRAM End Address (-1) */
lcdWriteReg(0x0052, y); /* Vertical GRAM Start Address */
lcdWriteReg(0x0053, y+height-1); /* Vertical GRAM End Address (-1) */
lcdWriteReg(0x0020, x);
lcdWriteReg(0x0021, y);
- } else if(orientation == landscape) {
+ } else if(lcdGetOrientation() == landscape) {
lcdWriteReg(0x0050, y); /* Vertical GRAM Start Address */
lcdWriteReg(0x0051, y+height-1); /* Vertical GRAM End Address (-1) */
lcdWriteReg(0x0052, x); /* Horizontal GRAM Start Address */
|