remove screen tearing

This commit is contained in:
2025-09-18 19:20:20 -06:00
parent 9468ceab51
commit e628c47e4b
8 changed files with 53 additions and 25 deletions

View File

@@ -21,12 +21,13 @@ pub static mut CALL_ABI_TABLE: [usize; CallAbiTable::COUNT] = [0; CallAbiTable::
pub enum CallAbiTable {
Print = 0,
Sleep = 1,
DrawIter = 2,
GetKey = 3,
LockDisplay = 2,
DrawIter = 3,
GetKey = 4,
}
impl CallAbiTable {
pub const COUNT: usize = 4;
pub const COUNT: usize = 5;
}
pub type PrintAbi = extern "Rust" fn(msg: &str);
@@ -51,6 +52,17 @@ pub fn sleep(ms: u64) {
}
}
pub type LockDisplay = extern "Rust" fn(lock: bool);
#[allow(unused)]
pub fn lock_display(lock: bool) {
unsafe {
let ptr = CALL_ABI_TABLE[CallAbiTable::LockDisplay as usize];
let f: LockDisplay = core::mem::transmute(ptr);
f(lock);
}
}
pub type DrawIterAbi = extern "Rust" fn(pixels: &[Pixel<Rgb565>]);
#[allow(unused)]