mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +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 String;
|
||||||
use bao1x_api::I2cApi;
|
use bao1x_api::I2cApi;
|
||||||
use bao1x_api::I2cResult;
|
use bao1x_api::I2cResult;
|
||||||
|
#[cfg(feature = "hosted-baosec")]
|
||||||
|
use bao1x_emu::i2c::I2c;
|
||||||
|
#[cfg(not(feature = "hosted-baosec"))]
|
||||||
use bao1x_hal_service::I2c;
|
use bao1x_hal_service::I2c;
|
||||||
|
|
||||||
use crate::{CommonEnv, ShellCmdApi};
|
use crate::{CommonEnv, ShellCmdApi};
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@ impl<'a> ShellCmdApi<'a> for Test {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#[cfg(not(feature = "hosted-baosec"))]
|
||||||
"shutdown" => {
|
"shutdown" => {
|
||||||
use bao1x_api::*;
|
use bao1x_api::*;
|
||||||
use bao1x_hal_service::I2c;
|
use bao1x_hal_service::I2c;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ fn main() {
|
||||||
log::info!("my PID is {}", xous::process::id());
|
log::info!("my PID is {}", xous::process::id());
|
||||||
|
|
||||||
let xns = xous_names::XousNames::new().unwrap();
|
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
|
// start keyboard emulator service
|
||||||
keyboard::start_keyboard_service();
|
keyboard::start_keyboard_service();
|
||||||
|
|
@ -123,6 +123,7 @@ fn main() {
|
||||||
HalOpcode::InvalidCall => {
|
HalOpcode::InvalidCall => {
|
||||||
log::error!("Invalid opcode received: {:?}", msg);
|
log::error!("Invalid opcode received: {:?}", msg);
|
||||||
}
|
}
|
||||||
|
bao1x_api::HalOpcode::ConfigureBio => todo!(),
|
||||||
HalOpcode::Quit => {
|
HalOpcode::Quit => {
|
||||||
log::info!("Received quit opcode, exiting.");
|
log::info!("Received quit opcode, exiting.");
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -18,20 +18,19 @@ impl Trng {
|
||||||
|
|
||||||
/// This is copied out of the 0.5 API for rand_core
|
/// This is copied out of the 0.5 API for rand_core
|
||||||
pub fn fill_bytes_via_next(&mut self, dest: &mut [u8]) {
|
pub fn fill_bytes_via_next(&mut self, dest: &mut [u8]) {
|
||||||
use core::mem::transmute;
|
|
||||||
let mut left = dest;
|
let mut left = dest;
|
||||||
while left.len() >= 8 {
|
while left.len() >= 8 {
|
||||||
let (l, r) = { left }.split_at_mut(8);
|
let (l, r) = { left }.split_at_mut(8);
|
||||||
left = r;
|
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);
|
l.copy_from_slice(&chunk);
|
||||||
}
|
}
|
||||||
let n = left.len();
|
let n = left.len();
|
||||||
if n > 4 {
|
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]);
|
left.copy_from_slice(&chunk[..n]);
|
||||||
} else if n > 0 {
|
} 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]);
|
left.copy_from_slice(&chunk[..n]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,7 @@ test-baosec = ["ux-api/loader-baosec"]
|
||||||
hosted-baosec = [
|
hosted-baosec = [
|
||||||
"keystore-api/gen2",
|
"keystore-api/gen2",
|
||||||
"modals/no-gam",
|
"modals/no-gam",
|
||||||
|
"aes",
|
||||||
] # emulated hardware on x86 platform
|
] # emulated hardware on x86 platform
|
||||||
board-baosor = [
|
board-baosor = [
|
||||||
"utralib/bao1x",
|
"utralib/bao1x",
|
||||||
|
|
@ -94,10 +95,7 @@ board-baosor = [
|
||||||
"modals/bao1x",
|
"modals/bao1x",
|
||||||
] # Precursor form factor
|
] # Precursor form factor
|
||||||
loader-baosor = []
|
loader-baosor = []
|
||||||
board-dabao = [
|
board-dabao = ["utralib/bao1x", "keystore-api/gen2"] # Dev board form factor
|
||||||
"utralib/bao1x",
|
|
||||||
"keystore-api/gen2",
|
|
||||||
] # Dev board form factor
|
|
||||||
loader-dabao = []
|
loader-dabao = []
|
||||||
|
|
||||||
policy-menu = [
|
policy-menu = [
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue