Upgrade LVGL vendored to v7.10.1 #44
8 changed files with 35 additions and 30 deletions
|
@ -9,10 +9,10 @@ license = "MIT"
|
||||||
repository = "https://github.com/rafaelcaricio/lvgl-rs"
|
repository = "https://github.com/rafaelcaricio/lvgl-rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
regex = "1.3.9"
|
regex = "1.4.3"
|
||||||
quote = "1.0.7"
|
quote = "1.0.9"
|
||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
proc-macro2 = "1.0.18"
|
proc-macro2 = "1.0.24"
|
||||||
Inflector = "0.11.4"
|
Inflector = "0.11.4"
|
||||||
syn = { version = "1.0.31", features = ["full"]}
|
syn = { version = "1.0.62", features = ["full"]}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use inflector::cases::pascalcase::to_pascal_case;
|
use inflector::cases::pascalcase::to_pascal_case;
|
||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
use proc_macro2::{Ident, TokenStream};
|
use proc_macro2::{Ident, TokenStream};
|
||||||
use quote::{format_ident, ToTokens};
|
|
||||||
use quote::quote;
|
use quote::quote;
|
||||||
|
use quote::{format_ident, ToTokens};
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
|
|
|
@ -20,5 +20,5 @@ name = "lvgl_sys"
|
||||||
cty = "0.2.1"
|
cty = "0.2.1"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
cc = "1.0.50"
|
cc = "1.0.67"
|
||||||
bindgen = "0.54.0"
|
bindgen = "0.57.0"
|
||||||
|
|
|
@ -12,7 +12,9 @@ fn main() {
|
||||||
let vendor_src = vendor.join("lvgl").join("src");
|
let vendor_src = vendor.join("lvgl").join("src");
|
||||||
|
|
||||||
let lv_config_dir = {
|
let lv_config_dir = {
|
||||||
let conf_path = env::var(CONFIG_NAME).map(|raw_path| PathBuf::from(raw_path)).unwrap_or_else(|_| {
|
let conf_path = env::var(CONFIG_NAME)
|
||||||
|
.map(|raw_path| PathBuf::from(raw_path))
|
||||||
|
.unwrap_or_else(|_| {
|
||||||
match std::env::var("DOCS_RS") {
|
match std::env::var("DOCS_RS") {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
// We've detected that we are building for docs.rs
|
// We've detected that we are building for docs.rs
|
||||||
|
@ -22,9 +24,9 @@ fn main() {
|
||||||
Err(_) => panic!(
|
Err(_) => panic!(
|
||||||
"The environment variable {} is required to be defined",
|
"The environment variable {} is required to be defined",
|
||||||
CONFIG_NAME
|
CONFIG_NAME
|
||||||
)
|
),
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if !conf_path.exists() {
|
if !conf_path.exists() {
|
||||||
panic!(format!(
|
panic!(format!(
|
||||||
|
@ -91,11 +93,20 @@ fn main() {
|
||||||
if target.ends_with("emscripten") {
|
if target.ends_with("emscripten") {
|
||||||
if let Ok(em_path) = env::var("EMSDK") {
|
if let Ok(em_path) = env::var("EMSDK") {
|
||||||
additional_args.push("-I".to_string());
|
additional_args.push("-I".to_string());
|
||||||
additional_args.push(format!("{}/upstream/emscripten/system/include/libc", em_path));
|
additional_args.push(format!(
|
||||||
|
"{}/upstream/emscripten/system/include/libc",
|
||||||
|
em_path
|
||||||
|
));
|
||||||
additional_args.push("-I".to_string());
|
additional_args.push("-I".to_string());
|
||||||
additional_args.push(format!("{}/upstream/emscripten/system/lib/libc/musl/arch/emscripten", em_path));
|
additional_args.push(format!(
|
||||||
|
"{}/upstream/emscripten/system/lib/libc/musl/arch/emscripten",
|
||||||
|
em_path
|
||||||
|
));
|
||||||
additional_args.push("-I".to_string());
|
additional_args.push("-I".to_string());
|
||||||
additional_args.push(format!("{}/upstream/emscripten/system/include/SDL", em_path));
|
additional_args.push(format!(
|
||||||
|
"{}/upstream/emscripten/system/include/SDL",
|
||||||
|
em_path
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +123,8 @@ fn main() {
|
||||||
.generate()
|
.generate()
|
||||||
.expect("Unable to generate bindings");
|
.expect("Unable to generate bindings");
|
||||||
|
|
||||||
bindings.write_to_file(out_path.join("bindings.rs"))
|
bindings
|
||||||
|
.write_to_file(out_path.join("bindings.rs"))
|
||||||
.expect("Can't write bindings!");
|
.expect("Can't write bindings!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
lvgl-sys/vendor/lvgl
vendored
2
lvgl-sys/vendor/lvgl
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 1ca1934dbe8e826ef1ed1690005fb678fea3a1f3
|
Subproject commit 524709472757405ac0eef8d6d002632526430df3
|
|
@ -15,12 +15,12 @@ build = "build.rs"
|
||||||
lvgl-sys = { version = "0.5.2", path = "../lvgl-sys" }
|
lvgl-sys = { version = "0.5.2", path = "../lvgl-sys" }
|
||||||
cty = "0.2.1"
|
cty = "0.2.1"
|
||||||
embedded-graphics = "0.6.2"
|
embedded-graphics = "0.6.2"
|
||||||
cstr_core = "0.2.0"
|
cstr_core = "0.2.3"
|
||||||
bitflags = "1.2.1"
|
bitflags = "1.2.1"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
quote = "1.0.7"
|
quote = "1.0.9"
|
||||||
proc-macro2 = "1.0.18"
|
proc-macro2 = "1.0.24"
|
||||||
lvgl-codegen = { version = "0.5.2", path = "../lvgl-codegen" }
|
lvgl-codegen = { version = "0.5.2", path = "../lvgl-codegen" }
|
||||||
lvgl-sys = { version = "0.5.2", path = "../lvgl-sys" }
|
lvgl-sys = { version = "0.5.2", path = "../lvgl-sys" }
|
||||||
|
|
||||||
|
|
|
@ -29,21 +29,15 @@ impl Color {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn r(&self) -> u8 {
|
pub fn r(&self) -> u8 {
|
||||||
unsafe {
|
unsafe { lvgl_sys::_LV_COLOR_GET_R(self.raw) as u8 }
|
||||||
lvgl_sys::_LV_COLOR_GET_R(self.raw) as u8
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn g(&self) -> u8 {
|
pub fn g(&self) -> u8 {
|
||||||
unsafe {
|
unsafe { lvgl_sys::_LV_COLOR_GET_G(self.raw) as u8 }
|
||||||
lvgl_sys::_LV_COLOR_GET_G(self.raw) as u8
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn b(&self) -> u8 {
|
pub fn b(&self) -> u8 {
|
||||||
unsafe {
|
unsafe { lvgl_sys::_LV_COLOR_GET_B(self.raw) as u8 }
|
||||||
lvgl_sys::_LV_COLOR_GET_B(self.raw) as u8
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,7 +244,6 @@ impl From<Animation> for lvgl_sys::lv_anim_enable_t {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
|
@ -43,7 +43,7 @@ where
|
||||||
C: PixelColor + From<Color>,
|
C: PixelColor + From<Color>,
|
||||||
{
|
{
|
||||||
pub fn init() -> LvResult<Self> {
|
pub fn init() -> LvResult<Self> {
|
||||||
if !LVGL_IN_USE.compare_exchange(false, true, Ordering::SeqCst, Ordering::Relaxed) {
|
if !LVGL_IN_USE.compare_and_swap(false, true, Ordering::SeqCst) {
|
||||||
unsafe {
|
unsafe {
|
||||||
lvgl_sys::lv_init();
|
lvgl_sys::lv_init();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue