lvgl-rs/lvgl-sys/src/lib.rs

31 lines
759 B
Rust
Raw Normal View History

2020-05-30 05:40:13 +00:00
#![no_std]
2020-04-10 18:41:29 +00:00
#![allow(non_snake_case)]
#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
2020-06-02 17:59:41 +00:00
#![allow(clippy::too_many_arguments)]
#![allow(clippy::redundant_static_lifetimes)]
2020-04-10 18:41:29 +00:00
2020-05-30 14:45:58 +00:00
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
2020-04-10 18:53:41 +00:00
2020-06-14 08:02:32 +00:00
pub fn _bindgen_raw_src() -> &'static str {
include_str!(concat!(env!("OUT_DIR"), "/bindings.rs"))
}
2020-04-10 18:53:41 +00:00
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn basic_sanity_check() {
unsafe {
lv_init();
2020-04-11 11:06:16 +00:00
let horizontal_resolution = lv_disp_get_hor_res(std::ptr::null_mut());
assert_eq!(horizontal_resolution, 480);
2020-04-10 18:53:41 +00:00
2020-04-11 11:06:16 +00:00
let vertical_resolution = lv_disp_get_ver_res(std::ptr::null_mut());
assert_eq!(vertical_resolution, 320);
2020-04-10 18:53:41 +00:00
}
}
}