Skip to content

Commit d83b374

Browse files
authored
fix: gate tick_inc function by feature custom_timer (#170)
lv_tick_inc function is available only when default (non-custom) timer implementation is used.
1 parent bdc49f7 commit d83b374

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

lvgl-sys/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ bindgen = "0.65.1"
3535
use-vendored-config = []
3636
drivers = []
3737
rust_timer = []
38+
# if LV_TICK_CUSTOM = 1, then lv_tick_inc function is unavailable
39+
custom_timer = []

lvgl/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ use-vendored-config = ["lvgl-sys/use-vendored-config"]
5252
# on the timer module for usage notes.
5353
rust_timer = ["lvgl-sys/rust_timer"]
5454

55+
# Enables using a custom tick function supplied in lv_conf.h
56+
custom_timer = ["lvgl-sys/custom_timer"]
57+
5558
# Enables some unstable features. Currently, #![feature(cfg_accessible)] and
5659
# #![feature(error_in_core)] are used.
5760
# This feature will currently allow:

lvgl/src/functions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub(crate) fn get_str_act(disp: Option<&Display>) -> Result<Obj> {
5454
/// Runs an LVGL tick lasting a given `core::time::Duration`. This function
5555
/// should be called periodically.
5656
#[inline]
57-
#[cfg(not(feature = "rust_timer"))]
57+
#[cfg(not(any(feature = "rust_timer", feature = "custom_timer")))]
5858
pub fn tick_inc(tick_period: Duration) {
5959
unsafe {
6060
lvgl_sys::lv_tick_inc(tick_period.as_millis() as u32);

0 commit comments

Comments
 (0)