#![cfg_attr(target_os = "none", no_std)]
extern crate alloc;
#[macro_use]
pub mod r#macro;
mod color;
mod image;
pub mod backlight;
pub mod utils;
pub mod display;
pub mod timing;
pub mod random;
pub mod battery;
pub mod input;
pub mod storage;
pub mod epsilon;
mod errors;
#[cfg(all(not(target_os = "none"), feature = "build-tools"))]
pub mod builder;
pub use utils::*;
pub use color::*;
pub use image::*;
pub use errors::*;
unsafe extern "C" {
pub static mut _heap_start: u8;
pub static mut _heap_end: u8;
}
pub static mut HEAP_START: *mut u8 = core::ptr::addr_of_mut!(_heap_start);
pub static mut HEAP_END: *mut u8 = core::ptr::addr_of_mut!(_heap_end);
pub fn heap_size() -> usize {
(unsafe { HEAP_END.offset_from(HEAP_START) }) as usize
}
#[cfg(target_os = "none")]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn __aeabi_unwind_cpp_pr0() {}
#[cfg(target_os = "none")]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn _critical_section_1_0_acquire() -> u8 {
let primask: u32;
unsafe {
core::arch::asm!(
"mrs {}, PRIMASK", "cpsid i", out(reg) primask,
options(nomem, nostack, preserves_flags)
);
}
primask as u8 }
#[cfg(target_os = "none")]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn _critical_section_1_0_release(token: u8) {
if token & 1 == 0 { unsafe {
core::arch::asm!(
"cpsie i", options(nomem, nostack, preserves_flags)
);
}
}
}