fix more emulated modes

This commit is contained in:
bunnie 2026-03-31 01:18:53 +08:00
parent db4d70e5ff
commit e3408f5346
4 changed files with 14 additions and 8 deletions

View file

@ -912,6 +912,9 @@ pub fn wrapped_main(main_thread_token: MainThreadToken) -> ! {
fn display_timeout_handler(udma_global: &UdmaGlobal, display: &mut Oled128x128) {
log::info!("resetting display spim block");
udma_global.reset(PeriphId::from(bao1x_hal::board::get_display_pins().0));
display.reinit_spi();
#[cfg(feature = "board-baosec")]
{
udma_global.reset(PeriphId::from(bao1x_hal::board::get_display_pins().0));
display.reinit_spi();
}
}

View file

@ -126,7 +126,7 @@ impl<'a> Oled128x128 {
pub fn screen_size(&self) -> Point { Point::new(WIDTH, LINES) }
pub fn redraw(&mut self) { self.draw(); }
pub fn redraw(&mut self) -> Result<(), xous::Error> { self.draw() }
pub fn blit_screen(&mut self, bmp: &[u32]) { self.buffer.copy_from_slice(bmp); }
@ -136,18 +136,19 @@ impl<'a> Oled128x128 {
pub fn stash(&mut self) { self.stash.copy_from_slice(&self.buffer); }
pub fn pop(&mut self) {
pub fn pop(&mut self) -> Result<(), xous::Error> {
self.buffer.copy_from_slice(&self.stash);
self.redraw();
self.redraw()
}
pub fn send_command<'b, U>(&'b mut self, _cmd: U)
pub fn send_command<'b, U>(&'b mut self, _cmd: U) -> Result<(), xous::Error>
where
U: IntoIterator<Item = u8> + 'b,
{
Ok(())
}
pub fn init(&mut self) {}
pub fn init(&mut self) -> Result<(), xous::Error> { Ok(()) }
}
impl FrameBuffer for Oled128x128 {

View file

@ -234,6 +234,7 @@ impl Keystore {
}
}
#[cfg(feature = "bao1x")]
pub fn set_ephemeral_key(&self, key: &[u8; bao1x_hal::buram::KEY_LEN]) -> Result<(), xous::Error> {
let offset = 0;
xous::send_message(
@ -262,6 +263,7 @@ impl Keystore {
.map(|_| ())
}
#[cfg(feature = "bao1x")]
pub fn get_ephemeral_key(&self) -> Result<[u8; bao1x_hal::buram::KEY_LEN], xous::Error> {
let mut key = [0u8; bao1x_hal::buram::KEY_LEN];
let offset = 0;

View file

@ -133,7 +133,7 @@ pub fn keystore(sid: SID) -> ! {
}
buffer.replace(kwp).unwrap();
}
Opcode::EphemeralOp => {
Opcode::Ephemeral => {
todo!()
}
_ => {