cbindgen abi_sys

This commit is contained in:
2025-10-05 17:14:38 -06:00
parent f2a5801284
commit af238b2847
17 changed files with 590 additions and 305 deletions

View File

@@ -18,7 +18,6 @@ trouble = ["dep:bt-hci", "dep:cyw43", "dep:cyw43-pio", "dep:trouble-host"]
defmt = [
"dep:defmt",
"shared/defmt",
"abi_sys/defmt",
"panic-probe/print-defmt",
"embassy-executor/defmt",
"embassy-time/defmt",

View File

@@ -1,14 +1,13 @@
use abi_sys::{
DrawIterAbi, FileLen, GenRand, GetKeyAbi, ListDir, LockDisplay, Modifiers, PrintAbi, ReadFile,
RngRequest, SleepAbi,
DrawIterAbi, FileLen, GenRand, ListDir, LockDisplay, PrintAbi, ReadFile, RngRequest, SleepAbi,
keyboard::*,
};
use alloc::{string::ToString, vec::Vec};
use core::sync::atomic::Ordering;
use embassy_rp::clocks::{RoscRng, clk_sys_freq};
use embedded_graphics::{Pixel, draw_target::DrawTarget, pixelcolor::Rgb565};
use embedded_sdmmc::{DirEntry, LfnBuffer, ShortFileName};
use embedded_sdmmc::{DirEntry, LfnBuffer};
use heapless::spsc::Queue;
use shared::keyboard::{KeyEvent, KeyEventC};
use crate::{
display::{FB_PAUSED, FRAMEBUFFER},
@@ -58,8 +57,8 @@ pub extern "C" fn get_key() -> KeyEventC {
event.into()
} else {
KeyEvent {
key: abi_sys::KeyCode::Unknown(0),
state: abi_sys::KeyState::Idle,
key: KeyCode::Unknown(0),
state: KeyState::Idle,
mods: Modifiers::empty(),
}
.into()

View File

@@ -2,7 +2,8 @@ use crate::{
abi,
storage::{File, SDCARD},
};
use abi_sys::{CallAbiTable, EntryFn};
use abi_sys::CallAbiTable;
use abi_sys::EntryFn;
use alloc::{vec, vec::Vec};
use bumpalo::Bump;
use core::ptr;

View File

@@ -1,5 +1,5 @@
use crate::peripherals::PERIPHERAL_BUS;
pub use shared::keyboard::{KeyCode, KeyEvent, KeyState, Modifiers};
pub use abi_sys::keyboard::{KeyCode, KeyEvent, KeyState, Modifiers};
const REG_ID_KEY: u8 = 0x04;
const REG_ID_FIF: u8 = 0x09;

View File

@@ -5,6 +5,7 @@ use crate::{
peripherals::keyboard,
storage::FileName,
};
use abi_sys::keyboard::{KeyCode, KeyState};
use alloc::{str::FromStr, string::String, vec::Vec};
use core::sync::atomic::Ordering;
use embassy_sync::{blocking_mutex::raw::CriticalSectionRawMutex, mutex::Mutex};
@@ -22,7 +23,6 @@ use embedded_layout::{
prelude::*,
};
use embedded_text::TextBox;
use shared::keyboard::{KeyCode, KeyState};
pub static SELECTIONS: Mutex<CriticalSectionRawMutex, SelectionList> =
Mutex::new(SelectionList::new());