summaryrefslogtreecommitdiff
path: root/firmware/export/lcd.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export/lcd.h')
-rw-r--r--firmware/export/lcd.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index f5a3b3f1f4..ffaf1a63d2 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -456,26 +456,26 @@ typedef void lcd_blockfunc_type(fb_data *address, unsigned mask, unsigned bits);
456#if LCD_PIXELFORMAT == HORIZONTAL_PACKING 456#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
457#define LCD_FBSTRIDE(w, h) ((w+7)/8) 457#define LCD_FBSTRIDE(w, h) ((w+7)/8)
458#define LCD_FBWIDTH LCD_FBSTRIDE(LCD_WIDTH, LCD_HEIGHT) 458#define LCD_FBWIDTH LCD_FBSTRIDE(LCD_WIDTH, LCD_HEIGHT)
459#define LCD_NBELEMS(w, h) (((h*LCD_FBSTRIDE(w, h)) + w) / sizeof(fb_data)) 459#define LCD_NBELEMS(w, h) ((((h-1)*LCD_FBSTRIDE(w, h)) + w) / sizeof(fb_data))
460#else /* LCD_PIXELFORMAT == VERTICAL_PACKING */ 460#else /* LCD_PIXELFORMAT == VERTICAL_PACKING */
461#define LCD_FBSTRIDE(w, h) ((h+7)/8) 461#define LCD_FBSTRIDE(w, h) ((h+7)/8)
462#define LCD_FBHEIGHT LCD_FBSTRIDE(LCD_WIDTH, LCD_HEIGHT) 462#define LCD_FBHEIGHT LCD_FBSTRIDE(LCD_WIDTH, LCD_HEIGHT)
463#define LCD_NBELEMS(w, h) (((w*LCD_FBSTRIDE(w, h)) + h) / sizeof(fb_data)) 463#define LCD_NBELEMS(w, h) ((((w-1)*LCD_FBSTRIDE(w, h)) + h) / sizeof(fb_data))
464#endif /* LCD_PIXELFORMAT */ 464#endif /* LCD_PIXELFORMAT */
465#elif LCD_DEPTH == 2 465#elif LCD_DEPTH == 2
466#if LCD_PIXELFORMAT == HORIZONTAL_PACKING 466#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
467#define LCD_FBSTRIDE(w, h) ((w+3)>>2) 467#define LCD_FBSTRIDE(w, h) ((w+3)>>2)
468#define LCD_NATIVE_STRIDE(s) LCD_FBSTRIDE(s, s) 468#define LCD_NATIVE_STRIDE(s) LCD_FBSTRIDE(s, s)
469#define LCD_FBWIDTH LCD_FBSTRIDE(LCD_WIDTH, LCD_HEIGHT) 469#define LCD_FBWIDTH LCD_FBSTRIDE(LCD_WIDTH, LCD_HEIGHT)
470#define LCD_NBELEMS(w, h) (((h*LCD_FBSTRIDE(w, h)) + w) / sizeof(fb_data)) 470#define LCD_NBELEMS(w, h) ((((h-1)*LCD_FBSTRIDE(w, h)) + w) / sizeof(fb_data))
471#elif LCD_PIXELFORMAT == VERTICAL_PACKING 471#elif LCD_PIXELFORMAT == VERTICAL_PACKING
472#define LCD_FBSTRIDE(w, h) ((h+3)/4) 472#define LCD_FBSTRIDE(w, h) ((h+3)/4)
473#define LCD_FBHEIGHT LCD_FBSTRIDE(LCD_WIDTH, LCD_HEIGHT) 473#define LCD_FBHEIGHT LCD_FBSTRIDE(LCD_WIDTH, LCD_HEIGHT)
474#define LCD_NBELEMS(w, h) (((w*LCD_FBSTRIDE(w, h)) + h) / sizeof(fb_data)) 474#define LCD_NBELEMS(w, h) ((((w-1)*LCD_FBSTRIDE(w, h)) + h) / sizeof(fb_data))
475#elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED 475#elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED
476#define LCD_FBSTRIDE(w, h) ((h+7)/8) 476#define LCD_FBSTRIDE(w, h) ((h+7)/8)
477#define LCD_FBHEIGHT LCD_FBSTRIDE(LCD_WIDTH, LCD_HEIGHT) 477#define LCD_FBHEIGHT LCD_FBSTRIDE(LCD_WIDTH, LCD_HEIGHT)
478#define LCD_NBELEMS(w, h) (((w*LCD_FBSTRIDE(w, h)) + h) / sizeof(fb_data)) 478#define LCD_NBELEMS(w, h) ((((w-1)*LCD_FBSTRIDE(w, h)) + h) / sizeof(fb_data))
479#endif /* LCD_PIXELFORMAT */ 479#endif /* LCD_PIXELFORMAT */
480#endif /* LCD_DEPTH */ 480#endif /* LCD_DEPTH */
481/* Set defaults if not defined different yet. The defaults apply to both 481/* Set defaults if not defined different yet. The defaults apply to both
@@ -494,9 +494,9 @@ typedef void lcd_blockfunc_type(fb_data *address, unsigned mask, unsigned bits);
494 494
495#ifndef LCD_NBELEMS 495#ifndef LCD_NBELEMS
496#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 496#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
497#define LCD_NBELEMS(w, h) ((w*STRIDE_MAIN(w, h)) + h) 497#define LCD_NBELEMS(w, h) (((w-1)*STRIDE_MAIN(w, h)) + h)
498#else 498#else
499#define LCD_NBELEMS(w, h) ((h*STRIDE_MAIN(w, h)) + w) 499#define LCD_NBELEMS(w, h) (((h-1)*STRIDE_MAIN(w, h)) + w)
500#endif 500#endif
501#define LCD_FBSTRIDE(w, h) STRIDE_MAIN(w, h) 501#define LCD_FBSTRIDE(w, h) STRIDE_MAIN(w, h)
502#endif 502#endif