improvements to previous commit

This commit is contained in:
husky 2025-09-12 13:25:57 -07:00
parent d7b75cf462
commit 2c0be2ccd7
2 changed files with 11 additions and 9 deletions

View file

@ -90,7 +90,7 @@ impl FramebufferConsole {
self.need_screen_clear = false; self.need_screen_clear = false;
} }
if self.need_line_clear { if self.need_line_clear {
fb_clear_area(tc, 0, self.cursor.1 * 16, 320, 16); fb_clear_area(tc, 0, self.cursor.1 * 16, 320, 16, refresh_whole_screen);
self.need_line_clear = false; self.need_line_clear = false;
} }

View file

@ -107,7 +107,7 @@ pub fn fb_clearscreen(tc: &mut TrafficControl, send_refresh: bool) {
} }
} }
pub fn fb_clear_area(tc: &mut TrafficControl, x: usize, y: usize, w: usize, h: usize) { pub fn fb_clear_area(tc: &mut TrafficControl, x: usize, y: usize, w: usize, h: usize, send_refresh: bool) {
const BYTES: [u8; 3] = FB_BG_COLOR.to_bytes(); const BYTES: [u8; 3] = FB_BG_COLOR.to_bytes();
let fbaddr = FRAMEBUFFER_ADDR.load(Ordering::Relaxed); let fbaddr = FRAMEBUFFER_ADDR.load(Ordering::Relaxed);
if fbaddr == 0 { if fbaddr == 0 {
@ -124,11 +124,13 @@ pub fn fb_clear_area(tc: &mut TrafficControl, x: usize, y: usize, w: usize, h: u
} }
} }
} }
framebuffer_update( if send_refresh {
tc, framebuffer_update(
0, tc,
0, 0,
FRAMEBUFFER_WIDTH as u32, 0,
FRAMEBUFFER_HEIGHT as u32, FRAMEBUFFER_WIDTH as u32,
); FRAMEBUFFER_HEIGHT as u32,
);
}
} }