mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
add blank screen for ship mode
This commit is contained in:
parent
ca63091f98
commit
076ee3588e
3 changed files with 24 additions and 0 deletions
|
|
@ -62,6 +62,9 @@ pub(crate) enum Opcode {
|
||||||
// Requests setting the UI to the power down screen
|
// Requests setting the UI to the power down screen
|
||||||
PowerDownRequest,
|
PowerDownRequest,
|
||||||
|
|
||||||
|
// Request blank screen for ship mode
|
||||||
|
ShipModeBlankRequest,
|
||||||
|
|
||||||
/////// planned
|
/////// planned
|
||||||
|
|
||||||
// hides a canvas with a given GID
|
// hides a canvas with a given GID
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,19 @@ impl Gam {
|
||||||
panic!("GAM_API: unexpected return value: {:#?}", response);
|
panic!("GAM_API: unexpected return value: {:#?}", response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
pub fn shipmode_blank_request(&self) -> Result<bool, xous::Error> {
|
||||||
|
let response = send_message(self.conn,
|
||||||
|
Message::new_blocking_scalar(Opcode::ShipModeBlankRequest.to_usize().unwrap(), 0, 0, 0, 0))?;
|
||||||
|
if let xous::Result::Scalar1(confirmed) = response {
|
||||||
|
if confirmed != 0 {
|
||||||
|
Ok(true)
|
||||||
|
} else {
|
||||||
|
Ok(false)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
panic!("GAM_API: unexpected return value: {:#?}", response);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// this "posts" a textview -- it's not a "draw" as the update is neither guaranteed nor instantaneous
|
/// this "posts" a textview -- it's not a "draw" as the update is neither guaranteed nor instantaneous
|
||||||
/// the GAM first has to check that the textview is allowed to be updated, and then it will decide when
|
/// the GAM first has to check that the textview is allowed to be updated, and then it will decide when
|
||||||
|
|
|
||||||
|
|
@ -273,6 +273,14 @@ fn xmain() -> ! {
|
||||||
xous::return_scalar(msg.sender, 1).expect("couldn't confirm power down UI request");
|
xous::return_scalar(msg.sender, 1).expect("couldn't confirm power down UI request");
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Some(Opcode::ShipModeBlankRequest) => {
|
||||||
|
msg_blocking_scalar_unpack!(msg, _, _, _, _, {
|
||||||
|
powerdown_requested = true;
|
||||||
|
gfx.draw_rectangle(Rectangle::new_with_style(Point::new(0,0), screensize, DrawStyle::new(PixelColor::Light, PixelColor::Light, 0))).expect("couldn't clear screen");
|
||||||
|
gfx.flush().expect("couldn't refresh blank screen");
|
||||||
|
xous::return_scalar(msg.sender, 1).expect("couldn't confirm power down UI request");
|
||||||
|
})
|
||||||
|
}
|
||||||
Some(Opcode::Redraw) => {
|
Some(Opcode::Redraw) => {
|
||||||
msg_scalar_unpack!(msg, _, _, _, _, {
|
msg_scalar_unpack!(msg, _, _, _, _, {
|
||||||
log::trace!("redraw message received");
|
log::trace!("redraw message received");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue