#![no_std]
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
use core::ffi::c_void;
#[cfg(all(feature = "heap"))]
use core::mem::MaybeUninit;
pub mod buttons;
mod infos;
pub mod seph;
pub fn exit_app(status: u8) -> ! {
unsafe { os_sched_exit(status) }
}
pub fn pic_rs<T>(x: &T) -> &T {
let ptr = unsafe { pic(x as *const T as *mut c_void) as *const T };
unsafe { &*ptr }
}
pub fn pic_rs_mut<T>(x: &mut T) -> &mut T {
let ptr = unsafe { pic(x as *mut T as *mut c_void) as *mut T };
unsafe { &mut *ptr }
}
#[cfg(all(feature = "heap"))]
use critical_section::RawRestoreState;
#[cfg(all(feature = "heap"))]
use embedded_alloc::Heap;
#[cfg(all(feature = "heap"))]
#[global_allocator]
static HEAP: Heap = Heap::empty();
#[cfg(all(feature = "heap"))]
struct CriticalSection;
#[cfg(all(feature = "heap"))]
critical_section::set_impl!(CriticalSection);
#[cfg(all(feature = "heap"))]
unsafe impl critical_section::Impl for CriticalSection {
unsafe fn acquire() -> RawRestoreState {}
unsafe fn release(_restore_state: RawRestoreState) {}
}
#[no_mangle]
#[cfg(all(feature = "heap"))]
extern "C" fn heap_init() {
static mut HEAP_MEM: [MaybeUninit<u8>; HEAP_SIZE] = [MaybeUninit::uninit(); HEAP_SIZE];
unsafe { HEAP.init(&raw mut HEAP_MEM as usize, HEAP_SIZE) }
}
#[no_mangle]
#[cfg(any(not(feature = "heap")))]
extern "C" fn heap_init() {}
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
include!(concat!(env!("OUT_DIR"), "/heap_size.rs"));