mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
cleanup bitrot
This commit is contained in:
parent
3a18782524
commit
8fcca4f873
5 changed files with 11 additions and 9 deletions
|
|
@ -1,6 +1,9 @@
|
|||
use String;
|
||||
use bao1x_api::I2cApi;
|
||||
use bao1x_api::I2cResult;
|
||||
#[cfg(feature = "hosted-baosec")]
|
||||
use bao1x_emu::i2c::I2c;
|
||||
#[cfg(not(feature = "hosted-baosec"))]
|
||||
use bao1x_hal_service::I2c;
|
||||
|
||||
use crate::{CommonEnv, ShellCmdApi};
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ impl<'a> ShellCmdApi<'a> for Test {
|
|||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(feature = "hosted-baosec"))]
|
||||
"shutdown" => {
|
||||
use bao1x_api::*;
|
||||
use bao1x_hal_service::I2c;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ fn main() {
|
|||
log::info!("my PID is {}", xous::process::id());
|
||||
|
||||
let xns = xous_names::XousNames::new().unwrap();
|
||||
let sid = xns.register_name(bao1x_api::SERVER_NAME_bao1x_HAL, None).expect("can't register server");
|
||||
let sid = xns.register_name(bao1x_api::SERVER_NAME_BAO1X_HAL, None).expect("can't register server");
|
||||
|
||||
// start keyboard emulator service
|
||||
keyboard::start_keyboard_service();
|
||||
|
|
@ -123,6 +123,7 @@ fn main() {
|
|||
HalOpcode::InvalidCall => {
|
||||
log::error!("Invalid opcode received: {:?}", msg);
|
||||
}
|
||||
bao1x_api::HalOpcode::ConfigureBio => todo!(),
|
||||
HalOpcode::Quit => {
|
||||
log::info!("Received quit opcode, exiting.");
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -18,20 +18,19 @@ impl Trng {
|
|||
|
||||
/// This is copied out of the 0.5 API for rand_core
|
||||
pub fn fill_bytes_via_next(&mut self, dest: &mut [u8]) {
|
||||
use core::mem::transmute;
|
||||
let mut left = dest;
|
||||
while left.len() >= 8 {
|
||||
let (l, r) = { left }.split_at_mut(8);
|
||||
left = r;
|
||||
let chunk: [u8; 8] = unsafe { transmute(rand::thread_rng().next_u64().to_le()) };
|
||||
let chunk: [u8; 8] = u64::to_ne_bytes(rand::thread_rng().next_u64().to_le());
|
||||
l.copy_from_slice(&chunk);
|
||||
}
|
||||
let n = left.len();
|
||||
if n > 4 {
|
||||
let chunk: [u8; 8] = unsafe { transmute(rand::thread_rng().next_u64().to_le()) };
|
||||
let chunk: [u8; 8] = u64::to_ne_bytes(rand::thread_rng().next_u64().to_le());
|
||||
left.copy_from_slice(&chunk[..n]);
|
||||
} else if n > 0 {
|
||||
let chunk: [u8; 4] = unsafe { transmute(rand::thread_rng().next_u32().to_le()) };
|
||||
let chunk: [u8; 4] = u32::to_ne_bytes(rand::thread_rng().next_u32().to_le());
|
||||
left.copy_from_slice(&chunk[..n]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ test-baosec = ["ux-api/loader-baosec"]
|
|||
hosted-baosec = [
|
||||
"keystore-api/gen2",
|
||||
"modals/no-gam",
|
||||
"aes",
|
||||
] # emulated hardware on x86 platform
|
||||
board-baosor = [
|
||||
"utralib/bao1x",
|
||||
|
|
@ -94,10 +95,7 @@ board-baosor = [
|
|||
"modals/bao1x",
|
||||
] # Precursor form factor
|
||||
loader-baosor = []
|
||||
board-dabao = [
|
||||
"utralib/bao1x",
|
||||
"keystore-api/gen2",
|
||||
] # Dev board form factor
|
||||
board-dabao = ["utralib/bao1x", "keystore-api/gen2"] # Dev board form factor
|
||||
loader-dabao = []
|
||||
|
||||
policy-menu = [
|
||||
|
|
|
|||
Loading…
Reference in a new issue