diff options
Diffstat (limited to 'firmware/drivers/lcd-bitmap-common.c')
-rw-r--r-- | firmware/drivers/lcd-bitmap-common.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c index 07ed509229..a8ecbd370d 100644 --- a/firmware/drivers/lcd-bitmap-common.c +++ b/firmware/drivers/lcd-bitmap-common.c | |||
@@ -221,6 +221,34 @@ void LCDFN(fill_viewport)(void) | |||
221 | LCDFN(fillrect)(0, 0, LCDFN(current_viewport)->width, LCDFN(current_viewport)->height); | 221 | LCDFN(fillrect)(0, 0, LCDFN(current_viewport)->width, LCDFN(current_viewport)->height); |
222 | } | 222 | } |
223 | 223 | ||
224 | #if LCDM(DEPTH) < 8 | ||
225 | /* | ||
226 | * clear the current viewport - grayscale displays | ||
227 | */ | ||
228 | void LCDFN(clear_viewport)(void) | ||
229 | { | ||
230 | struct viewport *vp = LCDFN(current_viewport); | ||
231 | int oldmode; | ||
232 | |||
233 | if (vp == &default_vp && default_vp.buffer == &LCDFN(framebuffer_default)) | ||
234 | { | ||
235 | LCDFN(clear_display)(); | ||
236 | } | ||
237 | else | ||
238 | { | ||
239 | oldmode = vp->drawmode; | ||
240 | vp->drawmode &= ~DRMODE_INVERSEVID; | ||
241 | vp->drawmode |= DRMODE_SOLID; | ||
242 | |||
243 | LCDFN(fillrect)(0, 0, vp->width, vp->height); | ||
244 | |||
245 | vp->drawmode = oldmode; | ||
246 | LCDFN(scroll_stop_viewport)(vp); | ||
247 | } | ||
248 | |||
249 | vp->flags &= ~VP_FLAG_VP_SET_CLEAN; | ||
250 | } | ||
251 | #endif | ||
224 | 252 | ||
225 | /*** Viewports ***/ | 253 | /*** Viewports ***/ |
226 | /* init_viewport Notes: When a viewport is initialized | 254 | /* init_viewport Notes: When a viewport is initialized |