From 69c2b84e4268a1386409f7ed0b3c664a1e36871f Mon Sep 17 00:00:00 2001 From: bunnie Date: Fri, 21 Feb 2025 17:51:53 +0800 Subject: [PATCH] bao-video: fix dependencies and minor API tweaks due to ux-api refactor --- services/bao-video/Cargo.toml | 4 ++-- services/bao-video/src/gfx.rs | 2 +- services/bao-video/src/main.rs | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/services/bao-video/Cargo.toml b/services/bao-video/Cargo.toml index 044c629b5..0861a7490 100644 --- a/services/bao-video/Cargo.toml +++ b/services/bao-video/Cargo.toml @@ -31,8 +31,8 @@ locales = { path = "../../locales" } # This crate is baosec specific; these flags switch between hosted mode emulation # (for UI development) and actual hardware targets. In UI development all camera data # is "faked" -board-baosec = ["cram-hal-service", "cramium-hal"] -hosted-baosec = ["cramium-emu"] +board-baosec = ["cram-hal-service", "cramium-hal", "ux-api/board-baosec"] +hosted-baosec = ["cramium-emu", "ux-api/hosted-baosec"] cramium-soc = ["utralib/cramium-soc"] decongest-udma = [] diff --git a/services/bao-video/src/gfx.rs b/services/bao-video/src/gfx.rs index b3cf20e86..49f33f417 100644 --- a/services/bao-video/src/gfx.rs +++ b/services/bao-video/src/gfx.rs @@ -99,7 +99,7 @@ pub fn msg<'a>(fb: &mut dyn FrameBuffer, text: &'a str, ll_pos: Point, fg: Color pub fn line(fb: &mut dyn FrameBuffer, l: Line, clip: Option, xor: bool) { let color: ColorNative; if l.style.stroke_color.is_some() { - color = l.style.stroke_color.unwrap(); + color = l.style.stroke_color.unwrap().into(); } else { return; } diff --git a/services/bao-video/src/main.rs b/services/bao-video/src/main.rs index e58cce9a3..f0b87e79f 100644 --- a/services/bao-video/src/main.rs +++ b/services/bao-video/src/main.rs @@ -21,6 +21,7 @@ use cramium_hal::{ ov2640::Ov2640, sh1107::{MainThreadToken, Mono, Oled128x128, claim_main_thread}, }; +use num_traits::*; #[cfg(not(feature = "hosted-baosec"))] use utralib::utra; @@ -133,6 +134,7 @@ pub fn wrapped_main(main_thread_token: MainThreadToken) -> ! { let mut sh1107 = Oled128x128::new(main_thread_token, cramium_api::PERCLK, &iox, &udma_global); sh1107.init(); + gfx::msg(&mut sh1107, "hello world", Point::new(0, 64), Mono::White.into(), Mono::Black.into()); sh1107.buffer_swap(); sh1107.draw();