From 14bfa42aec47edd927463fc69ac05a4ccaa2cadc Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 18 Feb 2025 23:21:41 +0800 Subject: [PATCH] fixup feature specifiers --- services/bao-video/Cargo.toml | 3 ++- services/bao-video/src/gfx.rs | 3 +++ services/bao-video/src/hosted.rs | 3 +++ services/bao-video/src/hw.rs | 6 ++++++ services/bao-video/src/main.rs | 5 ----- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/services/bao-video/Cargo.toml b/services/bao-video/Cargo.toml index 019f252fc..1f7984b0d 100644 --- a/services/bao-video/Cargo.toml +++ b/services/bao-video/Cargo.toml @@ -17,6 +17,7 @@ cramium-hal = { path = "../../libs/cramium-hal", features = [ ], optional = true } cram-hal-service = { path = "../cram-hal-service", optional = true } ux-api = { path = "../../libs/ux-api" } +cramium-emu = { path = "../../libs/cramium-emu", optional = true } # QR decoding libm = { version = "0.2.8" } @@ -30,7 +31,7 @@ locales = { path = "../../locales" } # (for UI development) and actual hardware targets. In UI development all camera data # is "faked" board-baosec = ["cram-hal-service"] -hosted-baosec = [] +hosted-baosec = ["cramium-emu"] cramium-soc = ["utralib/cramium-soc"] decongest-udma = [] diff --git a/services/bao-video/src/gfx.rs b/services/bao-video/src/gfx.rs index 1bcfe4c0d..b3cf20e86 100644 --- a/services/bao-video/src/gfx.rs +++ b/services/bao-video/src/gfx.rs @@ -1,3 +1,6 @@ +#[cfg(feature = "hosted-baosec")] +use cramium_emu::display::Mono; +#[cfg(feature = "board-baosec")] use cramium_hal::sh1107::Mono; use ux_api::minigfx::*; diff --git a/services/bao-video/src/hosted.rs b/services/bao-video/src/hosted.rs index 495675485..accddf1b4 100644 --- a/services/bao-video/src/hosted.rs +++ b/services/bao-video/src/hosted.rs @@ -1,3 +1,5 @@ +use crate::Opcode; + pub fn wrapped_main() -> ! { log_server::init_wait().unwrap(); log::set_max_level(log::LevelFilter::Info); @@ -7,6 +9,7 @@ pub fn wrapped_main() -> ! { let tt = ticktimer::Ticktimer::new().unwrap(); + let mut msg_opt = None; loop { xous::reply_and_receive_next(sid, &mut msg_opt).unwrap(); let msg = msg_opt.as_mut().unwrap(); diff --git a/services/bao-video/src/hw.rs b/services/bao-video/src/hw.rs index 1cbb4f095..8b0734fea 100644 --- a/services/bao-video/src/hw.rs +++ b/services/bao-video/src/hw.rs @@ -1,3 +1,9 @@ +use cramium_hal::iox::{IoxPort, IoxValue}; +use cramium_hal::sh1107::{Mono, Oled128x128}; +use cramium_hal::udma::PeriphId; +use num_traits::ToPrimitive; +use utralib::utra; + pub fn blit_to_display(sh1107: &mut Oled128x128, frame: &[u8], display_cleared: bool) { for (y, row) in frame.chunks(IMAGE_WIDTH).enumerate() { if y & 1 == 0 { diff --git a/services/bao-video/src/main.rs b/services/bao-video/src/main.rs index a112b85a9..7a50369ce 100644 --- a/services/bao-video/src/main.rs +++ b/services/bao-video/src/main.rs @@ -1,8 +1,3 @@ -use cramium_hal::iox::{IoxPort, IoxValue}; -use cramium_hal::sh1107::{Mono, Oled128x128}; -use cramium_hal::udma::PeriphId; -use num_traits::ToPrimitive; -use utralib::utra; use ux_api::minigfx::*; mod api;