summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/lcd-16bit.c20
-rw-r--r--firmware/drivers/lcd-h100-remote.c21
-rw-r--r--firmware/drivers/lcd-h100.c23
-rw-r--r--firmware/drivers/lcd-recorder.c19
4 files changed, 23 insertions, 60 deletions
diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c
index 4a6348f9db..2153b692f3 100644
--- a/firmware/drivers/lcd-16bit.c
+++ b/firmware/drivers/lcd-16bit.c
@@ -675,15 +675,11 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style, in
675 lcd_getstringsize(str, &w, &h); 675 lcd_getstringsize(str, &w, &h);
676 xpos = xmargin + x*w / utf8length(str); 676 xpos = xmargin + x*w / utf8length(str);
677 ypos = ymargin + y*h; 677 ypos = ymargin + y*h;
678 drawmode = (style & STYLE_INVERT) ?
679 (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
678 lcd_putsxyofs(xpos, ypos, offset, str); 680 lcd_putsxyofs(xpos, ypos, offset, str);
679 drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID); 681 drawmode ^= DRMODE_INVERSEVID;
680 (void)style;
681 lcd_fillrect(xpos + w, ypos, LCD_WIDTH - (xpos + w), h); 682 lcd_fillrect(xpos + w, ypos, LCD_WIDTH - (xpos + w), h);
682 if (style & STYLE_INVERT)
683 {
684 drawmode = DRMODE_COMPLEMENT;
685 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, h);
686 }
687 drawmode = lastmode; 683 drawmode = lastmode;
688} 684}
689 685
@@ -854,15 +850,9 @@ static void scroll_thread(void)
854 } 850 }
855 851
856 lastmode = drawmode; 852 lastmode = drawmode;
857 drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID); 853 drawmode = s->invert ?
858 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height); 854 (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
859 drawmode = DRMODE_SOLID;
860 lcd_putsxyofs(xpos, ypos, s->offset, s->line); 855 lcd_putsxyofs(xpos, ypos, s->offset, s->line);
861 if (s->invert)
862 {
863 drawmode = DRMODE_COMPLEMENT;
864 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
865 }
866 drawmode = lastmode; 856 drawmode = lastmode;
867 lcd_update_rect(xpos, ypos, LCD_WIDTH - xpos, pf->height); 857 lcd_update_rect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
868 } 858 }
diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c
index 3be907a574..5d6e0441a2 100644
--- a/firmware/drivers/lcd-h100-remote.c
+++ b/firmware/drivers/lcd-h100-remote.c
@@ -1167,14 +1167,11 @@ void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int st
1167 lcd_remote_getstringsize(str, &w, &h); 1167 lcd_remote_getstringsize(str, &w, &h);
1168 xpos = xmargin + x*w / utf8length((char *)str); 1168 xpos = xmargin + x*w / utf8length((char *)str);
1169 ypos = ymargin + y*h; 1169 ypos = ymargin + y*h;
1170 drawmode = (style & STYLE_INVERT) ?
1171 (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
1170 lcd_remote_putsxyofs(xpos, ypos, offset, str); 1172 lcd_remote_putsxyofs(xpos, ypos, offset, str);
1171 drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID); 1173 drawmode ^= DRMODE_INVERSEVID;
1172 lcd_remote_fillrect(xpos + w, ypos, LCD_REMOTE_WIDTH - (xpos + w), h); 1174 lcd_remote_fillrect(xpos + w, ypos, LCD_REMOTE_WIDTH - (xpos + w), h);
1173 if (style & STYLE_INVERT)
1174 {
1175 drawmode = DRMODE_COMPLEMENT;
1176 lcd_remote_fillrect(xpos, ypos, LCD_REMOTE_WIDTH - xpos, h);
1177 }
1178 drawmode = lastmode; 1175 drawmode = lastmode;
1179} 1176}
1180 1177
@@ -1354,15 +1351,9 @@ static void scroll_thread(void)
1354 } 1351 }
1355 1352
1356 lastmode = drawmode; 1353 lastmode = drawmode;
1357 drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID); 1354 drawmode = s->invert ?
1358 lcd_remote_fillrect(xpos, ypos, LCD_REMOTE_WIDTH - xpos, pf->height); 1355 (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
1359 drawmode = DRMODE_SOLID; 1356 lcd_remote_putsxyofs(xpos, ypos, s->offset, s->line);
1360 lcd_remote_putsxyofs(xpos, ypos, s->offset, (unsigned char *)s->line);
1361 if (s->invert)
1362 {
1363 drawmode = DRMODE_COMPLEMENT;
1364 lcd_remote_fillrect(xpos, ypos, LCD_REMOTE_WIDTH - xpos, pf->height);
1365 }
1366 drawmode = lastmode; 1357 drawmode = lastmode;
1367 lcd_remote_update_rect(xpos, ypos, LCD_REMOTE_WIDTH - xpos, pf->height); 1358 lcd_remote_update_rect(xpos, ypos, LCD_REMOTE_WIDTH - xpos, pf->height);
1368 } 1359 }
diff --git a/firmware/drivers/lcd-h100.c b/firmware/drivers/lcd-h100.c
index 685984522d..ef32078afb 100644
--- a/firmware/drivers/lcd-h100.c
+++ b/firmware/drivers/lcd-h100.c
@@ -845,7 +845,7 @@ void lcd_mono_bitmap_part(const unsigned char *src, int src_x, int src_y,
845 unsigned mask_col = mask; 845 unsigned mask_col = mask;
846 unsigned data = 0; 846 unsigned data = 0;
847 847
848 for (y = ny; y >= 8; y -= 8) 848 for (y = ny; y >= 8; y -= 8)
849 { 849 {
850 data |= *src_col << shift; 850 data |= *src_col << shift;
851 851
@@ -1090,14 +1090,11 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str,
1090 lcd_getstringsize(str, &w, &h); 1090 lcd_getstringsize(str, &w, &h);
1091 xpos = xmargin + x*w / utf8length((char *)str); 1091 xpos = xmargin + x*w / utf8length((char *)str);
1092 ypos = ymargin + y*h; 1092 ypos = ymargin + y*h;
1093 drawmode = (style & STYLE_INVERT) ?
1094 (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
1093 lcd_putsxyofs(xpos, ypos, offset, str); 1095 lcd_putsxyofs(xpos, ypos, offset, str);
1094 drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID); 1096 drawmode ^= DRMODE_INVERSEVID;
1095 lcd_fillrect(xpos + w, ypos, LCD_WIDTH - (xpos + w), h); 1097 lcd_fillrect(xpos + w, ypos, LCD_WIDTH - (xpos + w), h);
1096 if (style & STYLE_INVERT)
1097 {
1098 drawmode = DRMODE_COMPLEMENT;
1099 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, h);
1100 }
1101 drawmode = lastmode; 1098 drawmode = lastmode;
1102} 1099}
1103 1100
@@ -1266,15 +1263,9 @@ static void scroll_thread(void)
1266 } 1263 }
1267 1264
1268 lastmode = drawmode; 1265 lastmode = drawmode;
1269 drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID); 1266 drawmode = s->invert ?
1270 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height); 1267 (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
1271 drawmode = DRMODE_SOLID; 1268 lcd_putsxyofs(xpos, ypos, s->offset, s->line);
1272 lcd_putsxyofs(xpos, ypos, s->offset, (unsigned char *)s->line);
1273 if (s->invert)
1274 {
1275 drawmode = DRMODE_COMPLEMENT;
1276 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
1277 }
1278 drawmode = lastmode; 1269 drawmode = lastmode;
1279 lcd_update_rect(xpos, ypos, LCD_WIDTH - xpos, pf->height); 1270 lcd_update_rect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
1280 } 1271 }
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c
index b7bcd02cec..f69bf21fd5 100644
--- a/firmware/drivers/lcd-recorder.c
+++ b/firmware/drivers/lcd-recorder.c
@@ -950,14 +950,11 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str,
950 lcd_getstringsize(str, &w, &h); 950 lcd_getstringsize(str, &w, &h);
951 xpos = xmargin + x*w / utf8length(str); 951 xpos = xmargin + x*w / utf8length(str);
952 ypos = ymargin + y*h; 952 ypos = ymargin + y*h;
953 drawmode = (style & STYLE_INVERT) ?
954 (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
953 lcd_putsxyofs(xpos, ypos, offset, str); 955 lcd_putsxyofs(xpos, ypos, offset, str);
954 drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID); 956 drawmode ^= DRMODE_INVERSEVID;
955 lcd_fillrect(xpos + w, ypos, LCD_WIDTH - (xpos + w), h); 957 lcd_fillrect(xpos + w, ypos, LCD_WIDTH - (xpos + w), h);
956 if (style & STYLE_INVERT)
957 {
958 drawmode = DRMODE_COMPLEMENT;
959 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, h);
960 }
961 drawmode = lastmode; 958 drawmode = lastmode;
962} 959}
963 960
@@ -1127,15 +1124,9 @@ static void scroll_thread(void)
1127 } 1124 }
1128 1125
1129 lastmode = drawmode; 1126 lastmode = drawmode;
1130 drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID); 1127 drawmode = s->invert ?
1131 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height); 1128 (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
1132 drawmode = DRMODE_SOLID;
1133 lcd_putsxyofs(xpos, ypos, s->offset, s->line); 1129 lcd_putsxyofs(xpos, ypos, s->offset, s->line);
1134 if (s->invert)
1135 {
1136 drawmode = DRMODE_COMPLEMENT;
1137 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
1138 }
1139 drawmode = lastmode; 1130 drawmode = lastmode;
1140 lcd_update_rect(xpos, ypos, LCD_WIDTH - xpos, pf->height); 1131 lcd_update_rect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
1141 } 1132 }