diff options
author | trsaunders <trsaunders@gmail.com> | 2012-06-27 16:45:23 +0100 |
---|---|---|
committer | trsaunders <trsaunders@gmail.com> | 2012-06-27 16:45:23 +0100 |
commit | e4ec0e943270f3c249182e02210f1f78dfa7522b (patch) | |
tree | 2a3a6aea9bbb95e431d7118757a656b378e17188 | |
parent | 1d09786fa445371c4b4898a8c35be1257e56d89d (diff) | |
download | uGFX-e4ec0e943270f3c249182e02210f1f78dfa7522b.tar.gz uGFX-e4ec0e943270f3c249182e02210f1f78dfa7522b.tar.bz2 uGFX-e4ec0e943270f3c249182e02210f1f78dfa7522b.zip |
use max(height,width) to calculate buffer size
-rw-r--r-- | drivers/lcd/s6d1121_lld.c | 2 | ||||
-rw-r--r-- | drivers/lcd/ssd1289_lld.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/lcd/s6d1121_lld.c b/drivers/lcd/s6d1121_lld.c index da8878e2..2a591ee2 100644 --- a/drivers/lcd/s6d1121_lld.c +++ b/drivers/lcd/s6d1121_lld.c @@ -2,6 +2,8 @@ #ifdef LCD_USE_S6D1121 +static uint16_t buf[((SCREEN_HEIGHT > SCREEN_WIDTH ) ? SCREEN_HEIGHT : SCREEN_WIDTH)]; + #define LCD_RST_LOW palClearPad(LCD_RST_GPIO, LCD_RST_PIN) #define LCD_RST_HIGH palSetPad(LCD_RST_GPIO, LCD_RST_PIN) diff --git a/drivers/lcd/ssd1289_lld.c b/drivers/lcd/ssd1289_lld.c index ffcbb167..c2dfc1f3 100644 --- a/drivers/lcd/ssd1289_lld.c +++ b/drivers/lcd/ssd1289_lld.c @@ -6,8 +6,7 @@ uint8_t orientation; uint16_t DeviceCode; extern uint16_t lcd_width, lcd_height; -/* TODO: use max(height, width) */ -static uint16_t buf[SCREEN_HEIGHT]; +static uint16_t buf[((SCREEN_HEIGHT > SCREEN_WIDTH ) ? SCREEN_HEIGHT : SCREEN_WIDTH)]; #ifdef LCD_USE_GPIO static __inline void lld_lcdWriteIndex(uint16_t index) { |