diff --git a/services/bao-video/Cargo.toml b/services/bao-video/Cargo.toml index 73760d73f..10bed8e67 100644 --- a/services/bao-video/Cargo.toml +++ b/services/bao-video/Cargo.toml @@ -14,6 +14,7 @@ num-derive = { version = "0.4.2", default-features = false } num-traits = { version = "0.2.14", default-features = false } cramium-hal = { path = "../../libs/cramium-hal", features = ["std"] } cram-hal-service = { path = "../cram-hal-service" } +ux-api = { path = "../../libs/ux-api" } # QR decoding libm = { version = "0.2.8" } diff --git a/services/bao-video/src/gfx.rs b/services/bao-video/src/gfx.rs index 2e3759efd..1bcfe4c0d 100644 --- a/services/bao-video/src/gfx.rs +++ b/services/bao-video/src/gfx.rs @@ -1,4 +1,5 @@ -use cramium_hal::{minigfx::*, sh1107::Mono}; +use cramium_hal::sh1107::Mono; +use ux_api::minigfx::*; // The discipline for all the APIs in this module are that they act on a FrameBuffer which is // passed to the function. This allows us to bind the drawing computation on the caller-side of diff --git a/services/bao-video/src/main.rs b/services/bao-video/src/main.rs index a04de63fe..91ccc7468 100644 --- a/services/bao-video/src/main.rs +++ b/services/bao-video/src/main.rs @@ -1,9 +1,9 @@ use cramium_hal::iox::{IoxPort, IoxValue}; -use cramium_hal::minigfx::*; use cramium_hal::sh1107::{Mono, Oled128x128}; use cramium_hal::udma::PeriphId; use num_traits::ToPrimitive; use utralib::utra; +use ux_api::minigfx::*; mod gfx; mod homography; diff --git a/services/bao-video/src/modules.rs b/services/bao-video/src/modules.rs index 26acbbaf7..580e583c5 100644 --- a/services/bao-video/src/modules.rs +++ b/services/bao-video/src/modules.rs @@ -1,4 +1,5 @@ -use crate::Point; +use ux_api::minigfx::Point; + use crate::qr::*; /// This function takes a fraction described as `m.n`, where n is a fraction out of 1024, as well diff --git a/services/bao-video/src/qr.rs b/services/bao-video/src/qr.rs index 6044b36f3..fc9307f95 100644 --- a/services/bao-video/src/qr.rs +++ b/services/bao-video/src/qr.rs @@ -2,7 +2,7 @@ use core::cell::RefCell; use core::convert::TryFrom; use core::ops::{BitXor, Not}; -use cramium_hal::minigfx::{ColorNative, FrameBuffer, Point}; +use ux_api::minigfx::{ColorNative, FrameBuffer, Point}; use crate::gfx; @@ -26,7 +26,7 @@ pub const HOMOGRAPHY_MARGIN: isize = -4; pub const CROSSHAIR_LEN: isize = 3; pub fn draw_crosshair(image: &mut dyn FrameBuffer, p: Point) { - use cramium_hal::minigfx::Line; + use ux_api::minigfx::Line; gfx::line( image, Line::new(p + Point::new(0, CROSSHAIR_LEN), p - Point::new(0, CROSSHAIR_LEN)),