diff options
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/lcd-remote.h | 17 | ||||
-rw-r--r-- | firmware/export/lcd.h | 27 |
2 files changed, 30 insertions, 14 deletions
diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h index e4fffedac0..7ed52bd188 100644 --- a/firmware/export/lcd-remote.h +++ b/firmware/export/lcd-remote.h | |||
@@ -82,14 +82,25 @@ extern unsigned lcd_remote_color_to_native(unsigned color); | |||
82 | #define LCD_REMOTE_DEFAULT_BG LCD_REMOTE_WHITE | 82 | #define LCD_REMOTE_DEFAULT_BG LCD_REMOTE_WHITE |
83 | #endif | 83 | #endif |
84 | 84 | ||
85 | /* Memory copy of display bitmap */ | 85 | /* Frame buffer dimensions (format checks only cover existing targets!) */ |
86 | #if LCD_REMOTE_DEPTH == 1 | 86 | #if LCD_REMOTE_DEPTH == 1 |
87 | extern fb_remote_data lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH]; | 87 | #define LCD_REMOTE_FBHEIGHT ((LCD_REMOTE_HEIGHT+7)/8) |
88 | #elif LCD_REMOTE_DEPTH == 2 | 88 | #elif LCD_REMOTE_DEPTH == 2 |
89 | #if LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED | 89 | #if LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED |
90 | extern fb_remote_data lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH]; | 90 | #define LCD_REMOTE_FBHEIGHT ((LCD_REMOTE_HEIGHT+7)/8) |
91 | #endif | 91 | #endif |
92 | #endif /* LCD_REMOTE_DEPTH */ | ||
93 | /* Set defaults if not defined different yet. The defaults apply to both | ||
94 | * dimensions for LCD_REMOTE_DEPTH >= 8 */ | ||
95 | #ifndef LCD_REMOTE_FBWIDTH | ||
96 | #define LCD_REMOTE_FBWIDTH LCD_REMOTE_WIDTH | ||
92 | #endif | 97 | #endif |
98 | #ifndef LCD_REMOTE_FBHEIGHT | ||
99 | #define LCD_REMOTE_FBHEIGHT LCD_REMOTE_HEIGHT | ||
100 | #endif | ||
101 | /* The actual framebuffer */ | ||
102 | extern fb_remote_data lcd_remote_framebuffer[LCD_REMOTE_FBHEIGHT][LCD_REMOTE_FBWIDTH]; | ||
103 | |||
93 | 104 | ||
94 | extern void lcd_remote_init(void); | 105 | extern void lcd_remote_init(void); |
95 | extern int lcd_remote_default_contrast(void); | 106 | extern int lcd_remote_default_contrast(void); |
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index fecf3f5426..c4edc478de 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h | |||
@@ -237,25 +237,30 @@ static inline unsigned lcd_color_to_native(unsigned color) | |||
237 | #define LCD_DEFAULT_BG LCD_WHITE | 237 | #define LCD_DEFAULT_BG LCD_WHITE |
238 | #endif | 238 | #endif |
239 | 239 | ||
240 | /* Memory copy of display bitmap */ | 240 | /* Frame buffer dimensions */ |
241 | #if LCD_DEPTH == 1 | 241 | #if LCD_DEPTH == 1 |
242 | extern fb_data lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; | 242 | #if LCD_PIXELFORMAT == HORIZONTAL_PACKING |
243 | #define LCD_FBWIDTH ((LCD_WIDTH+7)/8) | ||
244 | #else /* LCD_PIXELFORMAT == VERTICAL_PACKING */ | ||
245 | #define LCD_FBHEIGHT ((LCD_HEIGHT+7)/8) | ||
246 | #endif | ||
243 | #elif LCD_DEPTH == 2 | 247 | #elif LCD_DEPTH == 2 |
244 | #if LCD_PIXELFORMAT == HORIZONTAL_PACKING | 248 | #if LCD_PIXELFORMAT == HORIZONTAL_PACKING |
245 | #define LCD_FBWIDTH ((LCD_WIDTH+3)/4) | 249 | #define LCD_FBWIDTH ((LCD_WIDTH+3)/4) |
246 | extern fb_data lcd_framebuffer[LCD_HEIGHT][LCD_FBWIDTH]; | 250 | #else /* LCD_PIXELFORMAT == VERTICAL_PACKING */ |
247 | #else | 251 | #define LCD_FBHEIGHT ((LCD_HEIGHT+3)/4) |
248 | extern fb_data lcd_framebuffer[LCD_HEIGHT/4][LCD_WIDTH]; | ||
249 | #endif | 252 | #endif |
250 | #elif LCD_DEPTH == 16 | 253 | #endif /* LCD_DEPTH */ |
251 | extern fb_data lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH]; | 254 | /* Set defaults if not defined different yet. The defaults apply to both |
252 | #elif LCD_DEPTH == 18 | 255 | * dimensions for LCD_DEPTH >= 8 */ |
253 | extern fb_data lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH]; | ||
254 | #endif | ||
255 | |||
256 | #ifndef LCD_FBWIDTH | 256 | #ifndef LCD_FBWIDTH |
257 | #define LCD_FBWIDTH LCD_WIDTH | 257 | #define LCD_FBWIDTH LCD_WIDTH |
258 | #endif | 258 | #endif |
259 | #ifndef LCD_FBHEIGHT | ||
260 | #define LCD_FBHEIGHT LCD_HEIGHT | ||
261 | #endif | ||
262 | /* The actual framebuffer */ | ||
263 | extern fb_data lcd_framebuffer[LCD_FBHEIGHT][LCD_FBWIDTH]; | ||
259 | 264 | ||
260 | /** Port-specific functions. Enable in port config file. **/ | 265 | /** Port-specific functions. Enable in port config file. **/ |
261 | #ifdef HAVE_LCD_ENABLE | 266 | #ifdef HAVE_LCD_ENABLE |