1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 01:18:28 +00:00

feat(core/rust): direct write to display memory for better performance on TT hardware

This commit is contained in:
matejcik 2022-06-07 12:15:57 +02:00 committed by matejcik
parent 57b12c2807
commit 37d5597965
2 changed files with 12 additions and 0 deletions

View File

@ -108,6 +108,17 @@ pub fn loader(
} }
} }
#[inline(always)]
#[cfg(all(feature = "model_tt", target_arch = "arm"))]
pub fn pixeldata(c: u16) {
unsafe {
ffi::DISPLAY_DATA_ADDRESS.write_volatile((c >> 8) as u8);
ffi::DISPLAY_DATA_ADDRESS.write_volatile((c & 0xff) as u8);
}
}
#[inline(always)]
#[cfg(not(all(feature = "model_tt", target_arch = "arm")))]
pub fn pixeldata(c: u16) { pub fn pixeldata(c: u16) {
unsafe { unsafe {
ffi::display_pixeldata(c); ffi::display_pixeldata(c);

View File

@ -183,6 +183,7 @@ pub fn text_right(baseline: Point, text: &str, font: Font, fg_color: Color, bg_c
); );
} }
#[inline(always)]
pub fn pixeldata(color: Color) { pub fn pixeldata(color: Color) {
display::pixeldata(color.into()); display::pixeldata(color.into());
} }