mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
status: enable/disable autobacklight on boot, depending on prefs
This commit is contained in:
parent
2a8ac69120
commit
412b8bdd5e
1 changed files with 17 additions and 0 deletions
|
|
@ -670,6 +670,23 @@ fn wrapped_main() -> ! {
|
||||||
|
|
||||||
wifi::start_background_thread();
|
wifi::start_background_thread();
|
||||||
|
|
||||||
|
match prefs.autobacklight_on_boot() {
|
||||||
|
Ok(value) => if let true = value {
|
||||||
|
send_message(status_cid, Message::new_scalar(
|
||||||
|
StatusOpcode::EnableAutomaticBacklight.to_usize().unwrap(), 0,0,0,0))
|
||||||
|
} else {
|
||||||
|
send_message(status_cid, Message::new_scalar(
|
||||||
|
StatusOpcode::DisableAutomaticBacklight.to_usize().unwrap(), 0,0,0,0))
|
||||||
|
},
|
||||||
|
Err(error) => {
|
||||||
|
log::error!("cannot read preference value for autobacklight_on_boot: {:?}", error);
|
||||||
|
Ok(xous::Result::Ok)
|
||||||
|
}
|
||||||
|
}.unwrap_or_else(|error| {
|
||||||
|
log::error!("cannot set autobacklight status: {:?}", error);
|
||||||
|
xous::Result::Ok
|
||||||
|
});
|
||||||
|
|
||||||
pump_run.store(true, Ordering::Relaxed); // start status thread updating
|
pump_run.store(true, Ordering::Relaxed); // start status thread updating
|
||||||
loop {
|
loop {
|
||||||
let msg = xous::receive_message(status_sid).unwrap();
|
let msg = xous::receive_message(status_sid).unwrap();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue