mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
fix blit_screen routine
This commit is contained in:
parent
a9c9d8d67b
commit
ffceea0389
1 changed files with 17 additions and 4 deletions
|
|
@ -420,17 +420,30 @@ impl<'a> Oled128x128<'a> {
|
||||||
|
|
||||||
pub fn screen_size(&self) -> Point { Point::new(WIDTH, LINES) }
|
pub fn screen_size(&self) -> Point { Point::new(WIDTH, LINES) }
|
||||||
|
|
||||||
pub fn redraw(&mut self) { self.draw(); }
|
pub fn redraw(&mut self) {
|
||||||
|
self.buffer_swap();
|
||||||
|
self.draw();
|
||||||
|
}
|
||||||
|
|
||||||
pub fn blit_screen(&mut self, bmp: &[u32]) {
|
pub fn blit_screen(&mut self, bmp: &[u32]) {
|
||||||
let buf = self.buffer_mut();
|
|
||||||
|
|
||||||
for (i, &word) in bmp.iter().enumerate() {
|
for (i, &word) in bmp.iter().enumerate() {
|
||||||
let bytes = word.to_ne_bytes();
|
for bit in 0..32 {
|
||||||
|
if (word & (1 << (31 - bit))) != 0 {
|
||||||
|
self.put_pixel(
|
||||||
|
Point::new((i as isize % 4) * 32 + bit, i as isize / 4),
|
||||||
|
Mono::White.into(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
for (i, &word) in bmp.iter().enumerate() {
|
||||||
|
let bytes = word.to_le_bytes();
|
||||||
let start = i * core::mem::size_of::<u32>();
|
let start = i * core::mem::size_of::<u32>();
|
||||||
let end = start + core::mem::size_of::<u32>();
|
let end = start + core::mem::size_of::<u32>();
|
||||||
buf[start..end].copy_from_slice(&bytes);
|
buf[start..end].copy_from_slice(&bytes);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_devboot(&mut self, _ena: bool) {
|
pub fn set_devboot(&mut self, _ena: bool) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue