Skip to content

Commit

Permalink
fixup! feat(core): add basic support for efficient frame buffer graphics
Browse files Browse the repository at this point in the history
  • Loading branch information
TychoVrahe committed Sep 25, 2023
1 parent 7d64269 commit 648e1b5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/embed/rust/src/trezorhal/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ pub fn pixeldata(c: u16) {
pub fn pixel(fb: u32, x: i16, y: i16, c: u16) {
unsafe {
let addr = fb
+ ((y as u32 + DISPLAY_FRAMEBUFFER_OFFSET_Y) as u32 * DISPLAY_FRAMEBUFFER_WIDTH
+ (x as u32 + DISPLAY_FRAMEBUFFER_OFFSET_X) as u32)
+ ((y as u32 + DISPLAY_FRAMEBUFFER_OFFSET_Y) * DISPLAY_FRAMEBUFFER_WIDTH
+ (x as u32 + DISPLAY_FRAMEBUFFER_OFFSET_X))
* 2;
let ptr = addr as *mut u16;
ptr.write_volatile(c);
Expand All @@ -120,8 +120,8 @@ pub fn pixel(fb: u32, x: i16, y: i16, c: u16) {
pub fn pixel(fb: u32, x: i16, y: i16, c: u32) {
unsafe {
let addr = fb
+ ((y as u32 + DISPLAY_FRAMEBUFFER_OFFSET_Y) as u32 * DISPLAY_FRAMEBUFFER_WIDTH
+ (x as u32 + DISPLAY_FRAMEBUFFER_OFFSET_X) as u32)
+ ((y as u32 + DISPLAY_FRAMEBUFFER_OFFSET_Y) * DISPLAY_FRAMEBUFFER_WIDTH
+ (x as u32 + DISPLAY_FRAMEBUFFER_OFFSET_X))
* 4;
let ptr = addr as *mut u32;
ptr.write_volatile(c);
Expand Down

0 comments on commit 648e1b5

Please sign in to comment.