From ff6ff8841a4f135b0a7c96cc18659710f160eb99 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 21 Sep 2025 23:33:37 +0800 Subject: [PATCH] fix missing api in precursor target from previous PR also fixup some warnings from the new rustc. --- loader/src/platform/precursor.rs | 3 +++ services/cram-console/src/app_autogen.rs | 17 +++++++++++++---- services/trng/src/api.rs | 1 + xtask/src/app_manifest.rs | 1 + 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/loader/src/platform/precursor.rs b/loader/src/platform/precursor.rs index 47f04c042..7370f6918 100644 --- a/loader/src/platform/precursor.rs +++ b/loader/src/platform/precursor.rs @@ -11,6 +11,9 @@ pub const RAM_SIZE: usize = utralib::generated::HW_SRAM_EXT_MEM_LEN; pub const RAM_SIZE: usize = 2 * 1024 * 1024; pub const RAM_BASE: usize = utralib::generated::HW_SRAM_EXT_MEM; +// placeholder for compatibility with other targets +pub fn early_init() -> u32 { 0 } + /// Note that this memory test is "destructive" -- supend/resume will fail if it is enabled #[cfg(feature = "platform-tests")] pub fn platform_tests() { diff --git a/services/cram-console/src/app_autogen.rs b/services/cram-console/src/app_autogen.rs index 2a6459788..c26854719 100644 --- a/services/cram-console/src/app_autogen.rs +++ b/services/cram-console/src/app_autogen.rs @@ -1,9 +1,5 @@ #![cfg_attr(rustfmt, rustfmt_skip)] // This file is auto-generated by xtask/main.rs generate_app_menus() -// NO APPS SELECTED: suppressing warning messages! -#![allow(dead_code)] -#![allow(unused_imports)] -#![allow(unused_variables)] use crate::StatusOpcode; use gam::{MenuItem, MenuPayload}; use locales::t; @@ -27,16 +23,29 @@ impl fmt::Display for AppDispatchError { pub(crate) fn app_dispatch(gam: &gam::Gam, token: [u32; 4], index: usize) -> Result<(), AppDispatchError> { match index { + 0 => { + gam.switch_to_app(gam::APP_NAME_VAULT, token).expect("couldn't raise app"); + Ok(()) + }, _ => Err(AppDispatchError::IndexNotFound(index)), } } pub(crate) fn app_index_to_name(index: usize) -> Result<&'static str, AppDispatchError> { match index { + 0 => Ok(t!("appmenu.vault", locales::LANG)), _ => Err(AppDispatchError::IndexNotFound(index)), } } pub(crate) fn app_menu_items(menu_items: &mut Vec::, status_conn: u32) { + menu_items.push(MenuItem { + name: String::from(t!("appmenu.vault", locales::LANG)), + action_conn: Some(status_conn), + action_opcode: StatusOpcode::SwitchToApp.to_u32().unwrap(), + action_payload: MenuPayload::Scalar([0, 0, 0, 0]), + close_on_select: true, + }); + } diff --git a/services/trng/src/api.rs b/services/trng/src/api.rs index 4b493fcb0..0cd26c7a3 100644 --- a/services/trng/src/api.rs +++ b/services/trng/src/api.rs @@ -38,6 +38,7 @@ pub struct TrngErrors { } #[derive(Debug, flatipc::Ipc)] +#[allow(dead_code)] /// Note that this structure is mirrored in imports/getrandom/src/xous.rs #[repr(C)] pub struct TrngBuf { diff --git a/xtask/src/app_manifest.rs b/xtask/src/app_manifest.rs index 136ce7934..276b1f3f1 100644 --- a/xtask/src/app_manifest.rs +++ b/xtask/src/app_manifest.rs @@ -17,6 +17,7 @@ struct AppManifest { submenu: Option, } #[derive(Deserialize, Serialize, Debug)] +#[allow(dead_code)] struct Locales { locales: HashMap>, }