diff --git a/lvgl/Cargo.toml b/lvgl/Cargo.toml index 737b665..98f35b1 100644 --- a/lvgl/Cargo.toml +++ b/lvgl/Cargo.toml @@ -21,6 +21,7 @@ parking_lot = "0.11.1" heapless = "0.7.1" [features] +default = [] alloc = ["cstr_core/alloc"] lvgl_alloc = ["alloc"] diff --git a/lvgl/src/display.rs b/lvgl/src/display.rs index aa54759..b9544fd 100644 --- a/lvgl/src/display.rs +++ b/lvgl/src/display.rs @@ -101,6 +101,9 @@ impl DrawBuffer { fn get_ptr(&self) -> Option> { if self.initialized.swap_and_check() { + // TODO: needs to be 'static somehow + // Cannot be in the DrawBuffer struct because the type `lv_disp_buf_t` contains a raw + // pointer and raw pointers are not Sync and consequently cannot be in `static` variables. let mut inner: MaybeUninit = MaybeUninit::uninit(); let primary_buffer_guard = self.refresh_buffer.lock(); let draw_buf = unsafe { diff --git a/lvgl/src/functions.rs b/lvgl/src/functions.rs index 386b6c7..d250fda 100644 --- a/lvgl/src/functions.rs +++ b/lvgl/src/functions.rs @@ -14,7 +14,7 @@ pub enum CoreError { type Result = result::Result; /// Register own buffer -pub fn disp_drv_register, T: DrawTarget>( +pub(crate) fn disp_drv_register, T: DrawTarget>( disp_drv: &mut DisplayDriver, ) -> Result { let disp_ptr = unsafe { lvgl_sys::lv_disp_drv_register(&mut disp_drv.disp_drv as *mut _) };