mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
integrate app name in sec notes patch, make app name update retriggered on change
This commit is contained in:
parent
b47c7b2793
commit
a9a5e5c9a9
4 changed files with 32 additions and 2 deletions
15
Cargo.lock
generated
15
Cargo.lock
generated
|
|
@ -821,6 +821,21 @@ dependencies = [
|
||||||
"termcolor",
|
"termcolor",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "espeak"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"codec",
|
||||||
|
"log",
|
||||||
|
"log-server",
|
||||||
|
"num-derive",
|
||||||
|
"num-traits",
|
||||||
|
"ticktimer-server",
|
||||||
|
"utralib",
|
||||||
|
"xous",
|
||||||
|
"xous-names",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "eyre"
|
name = "eyre"
|
||||||
version = "0.6.5"
|
version = "0.6.5"
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ default-members = [
|
||||||
"services/modals",
|
"services/modals",
|
||||||
"apps/ball",
|
"apps/ball",
|
||||||
"apps/repl",
|
"apps/repl",
|
||||||
|
"services/espeak",
|
||||||
]
|
]
|
||||||
members = [
|
members = [
|
||||||
"xous-ipc",
|
"xous-ipc",
|
||||||
|
|
@ -89,6 +90,7 @@ members = [
|
||||||
"apps/ball",
|
"apps/ball",
|
||||||
"apps/repl",
|
"apps/repl",
|
||||||
"kernel",
|
"kernel",
|
||||||
|
"services/espeak",
|
||||||
]
|
]
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -309,6 +309,7 @@ fn xmain() -> ! {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
sec_notes.lock().unwrap().insert("current_app".to_string(), format!("Running: Shellchat").to_string()); // this is the default app on boot
|
||||||
|
|
||||||
let mut stats_phase: usize = 0;
|
let mut stats_phase: usize = 0;
|
||||||
|
|
||||||
|
|
@ -728,13 +729,25 @@ fn xmain() -> ! {
|
||||||
Some(StatusOpcode::SwitchToShellchat) => {
|
Some(StatusOpcode::SwitchToShellchat) => {
|
||||||
ticktimer.sleep_ms(100).ok();
|
ticktimer.sleep_ms(100).ok();
|
||||||
sec_notes.lock().unwrap().remove(&"current_app".to_string());
|
sec_notes.lock().unwrap().remove(&"current_app".to_string());
|
||||||
|
sec_notes.lock().unwrap().insert("current_app".to_string(), format!("Running: Shellchat").to_string());
|
||||||
gam.switch_to_app(gam::APP_NAME_SHELLCHAT, security_tv.token.unwrap()).expect("couldn't raise shellchat");
|
gam.switch_to_app(gam::APP_NAME_SHELLCHAT, security_tv.token.unwrap()).expect("couldn't raise shellchat");
|
||||||
|
secnotes_force_redraw = true;
|
||||||
|
send_message(
|
||||||
|
cb_cid,
|
||||||
|
Message::new_scalar(StatusOpcode::Pump.to_usize().unwrap(), 0, 0, 0, 0),
|
||||||
|
).expect("couldn't trigger status update");
|
||||||
},
|
},
|
||||||
Some(StatusOpcode::SwitchToApp) => msg_scalar_unpack!(msg, index, _, _, _, {
|
Some(StatusOpcode::SwitchToApp) => msg_scalar_unpack!(msg, index, _, _, _, {
|
||||||
ticktimer.sleep_ms(100).ok();
|
ticktimer.sleep_ms(100).ok();
|
||||||
let app_name = app_autogen::app_index_to_name(index).expect("app index not found");
|
let app_name = app_autogen::app_index_to_name(index).expect("app index not found");
|
||||||
app_autogen::app_dispatch(&gam, security_tv.token.unwrap(), index).expect("cannot switch to app");
|
app_autogen::app_dispatch(&gam, security_tv.token.unwrap(), index).expect("cannot switch to app");
|
||||||
sec_notes.lock().unwrap().insert("current_app".to_string(), format!("Current app: {}", app_name).to_string());
|
sec_notes.lock().unwrap().remove(&"current_app".to_string());
|
||||||
|
sec_notes.lock().unwrap().insert("current_app".to_string(), format!("Running: {}", app_name).to_string());
|
||||||
|
secnotes_force_redraw = true;
|
||||||
|
send_message(
|
||||||
|
cb_cid,
|
||||||
|
Message::new_scalar(StatusOpcode::Pump.to_usize().unwrap(), 0, 0, 0, 0),
|
||||||
|
).expect("couldn't trigger status update");
|
||||||
}),
|
}),
|
||||||
Some(StatusOpcode::TrySuspend) => {
|
Some(StatusOpcode::TrySuspend) => {
|
||||||
if ((llio.adc_vbus().unwrap() as f64) * 0.005033) > 1.5 {
|
if ((llio.adc_vbus().unwrap() as f64) * 0.005033) > 1.5 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue