add debug help to tokens, remove the unused RTC token entry

This commit is contained in:
bunnie 2022-01-03 19:20:31 +08:00
parent ce61d5415a
commit 77e44075a6

View file

@ -12,14 +12,13 @@ use xous_ipc::String;
*/ */
// if you add more UxContexts, and you want them authorized by the GAM, add their names here. // if you add more UxContexts, and you want them authorized by the GAM, add their names here.
const TOKEN_SLOTS: usize = 10; const TOKEN_SLOTS: usize = 9;
const EXPECTED_BOOT_CONTEXTS: [&'static str; TOKEN_SLOTS] = [ const EXPECTED_BOOT_CONTEXTS: [&'static str; TOKEN_SLOTS] = [
"shellchat", "shellchat",
"main menu", "main menu",
"status", "status",
"emoji menu", "emoji menu",
"rootkeys modal", "rootkeys modal",
"rtc modal",
"rootkeys menu", "rootkeys menu",
"test modal", "test modal",
"pddb modal", "pddb modal",
@ -50,6 +49,16 @@ impl<'a> TokenManager {
allow = false allow = false
} }
} }
// throw a bone to the dev who has to debug this error. This typically only triggers after a major
// refactor and some UX element was removed and we forgot to update it in this table here.
if !allow {
log::info!("Occupied token slots:");
for t in self.tokens.iter() {
if let Some(s) = t {
log::info!("{}", s.name);
}
}
}
allow allow
} }
pub(crate) fn claim_token(&mut self, name: &str) -> Option<[u32; 4]> { pub(crate) fn claim_token(&mut self, name: &str) -> Option<[u32; 4]> {