mirror of
https://github.com/LegitCamper/picocalc-os-rs.git
synced 2025-12-27 07:45:28 +00:00
macros and improvements
This commit is contained in:
@@ -4,8 +4,9 @@ version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
embedded-sdmmc = { version = "0.9.0", default-features = false }
|
||||
embedded-graphics = "0.8.1"
|
||||
abi_sys = { path = "../abi_sys" }
|
||||
main_proc_macro = { path = "../main_proc_macro" }
|
||||
embedded-sdmmc = { version = "0.9", default-features = false }
|
||||
embedded-graphics = "0.8.1"
|
||||
once_cell = { version = "1", default-features = false }
|
||||
rand_core = "0.9.3"
|
||||
|
||||
@@ -5,10 +5,20 @@ extern crate alloc;
|
||||
|
||||
pub use abi_sys::{self, keyboard};
|
||||
use abi_sys::{RngRequest, alloc, dealloc, keyboard::KeyEvent};
|
||||
pub use alloc::format;
|
||||
use core::alloc::{GlobalAlloc, Layout};
|
||||
use alloc::format;
|
||||
use core::{
|
||||
alloc::{GlobalAlloc, Layout},
|
||||
panic::PanicInfo,
|
||||
};
|
||||
pub use main_proc_macro::main;
|
||||
use rand_core::RngCore;
|
||||
|
||||
#[panic_handler]
|
||||
fn panic(info: &PanicInfo) -> ! {
|
||||
print!("user panic: {} @ {:?}", info.message(), info.location(),);
|
||||
loop {}
|
||||
}
|
||||
|
||||
#[global_allocator]
|
||||
static ALLOC: Alloc = Alloc;
|
||||
|
||||
@@ -27,7 +37,7 @@ unsafe impl GlobalAlloc for Alloc {
|
||||
#[macro_export]
|
||||
macro_rules! print {
|
||||
($($arg:tt)*) => {{
|
||||
let s = $crate::format!($($arg)*);
|
||||
let s = format!($($arg)*);
|
||||
$crate::abi_sys::print(s.as_ptr(), s.len());
|
||||
}};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user