mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-21 09:14:34 +00:00
add code to render sleep screen bitmap
This commit is contained in:
parent
e414c87414
commit
49db984000
2 changed files with 59 additions and 38 deletions
|
|
@ -25,7 +25,7 @@ impl XousDisplay {
|
||||||
((FB_WIDTH_WORDS * FB_LINES * 4) + 4096) & !4095,
|
((FB_WIDTH_WORDS * FB_LINES * 4) + 4096) & !4095,
|
||||||
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
||||||
)
|
)
|
||||||
.expect("couldn't map control port");
|
.expect("couldn't map frame buffer");
|
||||||
|
|
||||||
let control = xous::syscall::map_memory(
|
let control = xous::syscall::map_memory(
|
||||||
xous::MemoryAddress::new(utra::HW_MEMLCD_BASE),
|
xous::MemoryAddress::new(utra::HW_MEMLCD_BASE),
|
||||||
|
|
@ -49,6 +49,19 @@ impl XousDisplay {
|
||||||
|
|
||||||
pub fn update(&mut self) {}
|
pub fn update(&mut self) {}
|
||||||
|
|
||||||
|
pub fn force_bitmap(&mut self, bmp: [u32; FB_SIZE]) {
|
||||||
|
let framebuffer = self.fb.as_mut_ptr() as *mut u32;
|
||||||
|
|
||||||
|
for words in 0..FB_SIZE {
|
||||||
|
unsafe {
|
||||||
|
framebuffer.add(words).write_volatile(bmp[words]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self.update_all();
|
||||||
|
|
||||||
|
while self.busy() {}
|
||||||
|
}
|
||||||
|
|
||||||
/// Beneath this line are pure-HAL layer, and should not be user-visible
|
/// Beneath this line are pure-HAL layer, and should not be user-visible
|
||||||
|
|
||||||
///
|
///
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,14 @@ use embedded_graphics::{
|
||||||
|
|
||||||
use core::convert::TryFrom;
|
use core::convert::TryFrom;
|
||||||
|
|
||||||
|
mod logo;
|
||||||
|
const USE_BOOT_LOGO: bool = true;
|
||||||
|
|
||||||
fn draw_boot_logo(display: &mut XousDisplay) {
|
fn draw_boot_logo(display: &mut XousDisplay) {
|
||||||
|
|
||||||
|
if USE_BOOT_LOGO {
|
||||||
|
display.force_bitmap(logo::LOGO_MAP);
|
||||||
|
} else {
|
||||||
// Create styles used by the drawing operations.
|
// Create styles used by the drawing operations.
|
||||||
let thin_stroke = PrimitiveStyle::with_stroke(BinaryColor::On, 1);
|
let thin_stroke = PrimitiveStyle::with_stroke(BinaryColor::On, 1);
|
||||||
let thick_stroke = PrimitiveStyle::with_stroke(BinaryColor::On, 3);
|
let thick_stroke = PrimitiveStyle::with_stroke(BinaryColor::On, 3);
|
||||||
|
|
@ -62,6 +69,7 @@ fn draw_boot_logo(display: &mut XousDisplay) {
|
||||||
.into_styled(text_style)
|
.into_styled(text_style)
|
||||||
.draw(display)
|
.draw(display)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[xous::xous_main]
|
#[xous::xous_main]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue