mirror of
https://github.com/LegitCamper/picocalc-os-rs.git
synced 2026-10-23 06:57:36 -06:00
fully c ffi compat
This commit is contained in:
1 parent
f73df7e0b8
commit
f2a5801284
4 files changed
+90
-9
No files matched your search
+3
-2
@@ -9,6 +9,7 @@ use embedded_graphics::{
|
||||
pixelcolor::{Rgb565, RgbColor},
|
||||
};
|
||||
use embedded_sdmmc::DirEntry;
|
||||
use shared::keyboard::KeyEventC;
|
||||
pub use shared::keyboard::{KeyCode, KeyEvent, KeyState, Modifiers};
|
||||
use strum::{EnumCount, EnumIter};
|
||||
|
||||
@@ -69,10 +70,10 @@ pub fn draw_iter(pixels: &[Pixel<Rgb565>]) {
|
||||
f(pixels.as_ptr(), pixels.len());
|
||||
}
|
||||
|
||||
pub type GetKeyAbi = extern "C" fn() -> KeyEvent;
|
||||
pub type GetKeyAbi = extern "C" fn() -> KeyEventC;
|
||||
|
||||
#[allow(unused)]
|
||||
pub fn get_key() -> KeyEvent {
|
||||
pub fn get_key() -> KeyEventC {
|
||||
let f: GetKeyAbi =
|
||||
unsafe { core::mem::transmute(CALL_ABI_TABLE[CallAbiTable::GetKey as usize]) };
|
||||
f()
|
||||
|
||||
Reference in new issue
Block a user