Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: gate tick_inc function by feature custom_timer #170

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lvgl-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ bindgen = "0.65.1"
use-vendored-config = []
drivers = []
rust_timer = []
# if LV_TICK_CUSTOM = 1, then lv_tick_inc function is unavailable
custom_timer = []
3 changes: 3 additions & 0 deletions lvgl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ use-vendored-config = ["lvgl-sys/use-vendored-config"]
# on the timer module for usage notes.
rust_timer = ["lvgl-sys/rust_timer"]

# Enables using a custom tick function supplied in lv_conf.h
custom_timer = ["lvgl-sys/custom_timer"]

# Enables some unstable features. Currently, #![feature(cfg_accessible)] and
# #![feature(error_in_core)] are used.
# This feature will currently allow:
Expand Down
2 changes: 1 addition & 1 deletion lvgl/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub(crate) fn get_str_act(disp: Option<&Display>) -> Result<Obj> {
/// Runs an LVGL tick lasting a given `core::time::Duration`. This function
/// should be called periodically.
#[inline]
#[cfg(not(feature = "rust_timer"))]
#[cfg(not(any(feature = "rust_timer", feature = "custom_timer")))]
pub fn tick_inc(tick_period: Duration) {
unsafe {
lvgl_sys::lv_tick_inc(tick_period.as_millis() as u32);
Expand Down
Loading