Merge pull request #657 from betrusted-io/console-flags-part-deux

add build flags to bao-console
This commit is contained in:
bunnie 2025-06-09 18:46:46 +08:00 committed by GitHub
commit 5108239cff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 3 deletions

View file

@ -50,7 +50,9 @@ hosted-baosec = [
"cramium-hal/hosted-baosec",
]
usb = []
pddbtest = []
battery-readout = []
with-pddb = []
pddbtest = ["with-pddb"]
test-rekey = []
autobasis = ["rand_chacha", "rand"]
modal-testing = ["ux-api", "modals/modal-testing"]

View file

@ -87,7 +87,9 @@ use trng_cmd::*;
mod usb;
#[cfg(feature = "usb")]
use usb::*;
#[cfg(feature = "with-pddb")]
mod pddb;
#[cfg(feature = "with-pddb")]
use pddb::*;
pub struct CmdEnv {
@ -97,6 +99,7 @@ pub struct CmdEnv {
trng_cmd: TrngCmd,
#[cfg(feature = "usb")]
usb: Usb,
#[cfg(feature = "with-pddb")]
pddb_cmd: PddbCmd,
}
impl CmdEnv {
@ -120,6 +123,7 @@ impl CmdEnv {
},
#[cfg(feature = "usb")]
usb: Usb::new(),
#[cfg(feature = "with-pddb")]
pddb_cmd: PddbCmd::new(),
}
}
@ -142,6 +146,7 @@ impl CmdEnv {
&mut console_cmd,
#[cfg(feature = "usb")]
&mut self.usb,
#[cfg(feature = "with-pddb")]
&mut self.pddb_cmd,
];

View file

@ -108,7 +108,7 @@ fn main() {
modals::tests::spawn_test();
}
#[cfg(not(feature = "hosted-baosec"))]
#[cfg(feature = "battery-readout")]
{
use cramium_api::I2cApi;
let mut i2c = cram_hal_service::I2c::new();
@ -126,7 +126,7 @@ fn main() {
}
}
}
#[cfg(feature = "hosted-baosec")]
#[cfg(any(feature = "hosted-baosec", not(feature = "battery-readout")))]
loop {
tt.sleep_ms(2_000).ok();
}