From faa3a192156b8b93d59c11a06a25edc4e3e54ce6 Mon Sep 17 00:00:00 2001 From: Jay Jackson Date: Mon, 16 May 2022 21:54:24 -0400 Subject: [PATCH] bump versions --- lvgl-sys/Cargo.toml | 2 +- lvgl/Cargo.toml | 6 +++--- lvgl/src/ui.rs | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lvgl-sys/Cargo.toml b/lvgl-sys/Cargo.toml index ba7b648..46b07b2 100644 --- a/lvgl-sys/Cargo.toml +++ b/lvgl-sys/Cargo.toml @@ -21,4 +21,4 @@ cty = "0.2.1" [build-dependencies] cc = "1.0.68" -bindgen = "0.58.1" +bindgen = "0.59.2" diff --git a/lvgl/Cargo.toml b/lvgl/Cargo.toml index dfa8971..3ad7700 100644 --- a/lvgl/Cargo.toml +++ b/lvgl/Cargo.toml @@ -14,7 +14,7 @@ build = "build.rs" [dependencies] lvgl-sys = { version = "0.5.2", path = "../lvgl-sys" } cty = "0.2.1" -embedded-graphics = "0.6.2" +embedded-graphics = "0.7.1" cstr_core = "0.2.3" bitflags = "1.2.1" @@ -29,8 +29,8 @@ lvgl-codegen = { version = "0.5.2", path = "../lvgl-codegen" } lvgl-sys = { version = "0.5.2", path = "../lvgl-sys" } [dev-dependencies] -embedded-graphics-simulator = "0.2.1" -heapless = "0.5.5" +embedded-graphics-simulator = "0.3.0" +heapless = "0.7.13" [[example]] name = "demo" diff --git a/lvgl/src/ui.rs b/lvgl/src/ui.rs index 9bd908c..2a5789a 100644 --- a/lvgl/src/ui.rs +++ b/lvgl/src/ui.rs @@ -6,9 +6,9 @@ use core::ptr; use core::ptr::NonNull; use core::sync::atomic::{AtomicBool, Ordering}; use core::time::Duration; -use embedded_graphics::pixelcolor::PixelColor; +use embedded_graphics::draw_target::DrawTarget; use embedded_graphics::prelude::*; -use embedded_graphics::{drawable, DrawTarget}; +use embedded_graphics::{pixelcolor::PixelColor, Pixel}; // There can only be a single reference to LVGL library. static LVGL_IN_USE: AtomicBool = AtomicBool::new(false); @@ -20,7 +20,7 @@ pub(crate) const BUF_SIZE: usize = lvgl_sys::LV_HOR_RES_MAX as usize * REFRESH_B pub struct UI where - T: DrawTarget, + T: DrawTarget, C: PixelColor + From, { // LVGL is not thread-safe by default. @@ -32,14 +32,14 @@ where // LVGL does not use thread locals. unsafe impl Send for UI where - T: DrawTarget, + T: DrawTarget, C: PixelColor + From, { } impl UI where - T: DrawTarget, + T: DrawTarget, C: PixelColor + From, { pub fn init() -> LvResult { @@ -135,7 +135,7 @@ where pub(crate) struct DisplayUserData where - T: DrawTarget, + T: DrawTarget, C: PixelColor + From, { display: T, @@ -147,7 +147,7 @@ unsafe extern "C" fn display_callback_wrapper( area: *const lvgl_sys::lv_area_t, color_p: *mut lvgl_sys::lv_color_t, ) where - T: DrawTarget, + T: DrawTarget, C: PixelColor + From, { // In the `std` world we would make sure to capture panics here and make them not escape across @@ -178,7 +178,7 @@ fn display_flush( color_p: *mut lvgl_sys::lv_color_t, ) -> Result<(), T::Error> where - T: DrawTarget, + T: DrawTarget, C: PixelColor + From, { let ys = y1..=y2; @@ -192,7 +192,7 @@ where let color_len = x_len * iy + ix; let lv_color = unsafe { *color_p.add(color_len) }; let raw_color = Color::from_raw(lv_color); - drawable::Pixel(Point::new(x as i32, y as i32), raw_color.into()) + Pixel(Point::new(x as i32, y as i32), raw_color.into()) }) });