Update default features to empty

This commit is contained in:
Rafael Caricio 2021-06-06 10:55:42 +02:00
parent de568593ef
commit bc7c06cc8c
Signed by: rafaelcaricio
GPG key ID: 3C86DBCE8E93C947
3 changed files with 5 additions and 1 deletions

View file

@ -21,6 +21,7 @@ parking_lot = "0.11.1"
heapless = "0.7.1"
[features]
default = []
alloc = ["cstr_core/alloc"]
lvgl_alloc = ["alloc"]

View file

@ -101,6 +101,9 @@ impl<const N: usize> DrawBuffer<N> {
fn get_ptr(&self) -> Option<Box<lvgl_sys::lv_disp_buf_t>> {
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<lvgl_sys::lv_disp_buf_t> = MaybeUninit::uninit();
let primary_buffer_guard = self.refresh_buffer.lock();
let draw_buf = unsafe {

View file

@ -14,7 +14,7 @@ pub enum CoreError {
type Result<T> = result::Result<T, CoreError>;
/// Register own buffer
pub fn disp_drv_register<C: PixelColor + From<Color>, T: DrawTarget<C>>(
pub(crate) fn disp_drv_register<C: PixelColor + From<Color>, T: DrawTarget<C>>(
disp_drv: &mut DisplayDriver<T, C>,
) -> Result<Display> {
let disp_ptr = unsafe { lvgl_sys::lv_disp_drv_register(&mut disp_drv.disp_drv as *mut _) };