added the heapless crate and added new docs

This commit is contained in:
Zenn 2023-08-19 19:14:32 +02:00
parent a33a57bd49
commit ba5662a17e
230 changed files with 48215 additions and 40 deletions

View file

@ -16,6 +16,11 @@
/// progmem!(
/// static image: [u8; _] = [8, 8, 0x81, 0x00, 0x12, 0x40, 0x04, 0x11, 0x00, 0x04];
/// );
///
/// // for a Vector
/// progmem!(
/// static mut walls: Vec<Player, 100> = Vec::new();
/// );
/// ```
#[macro_export]
macro_rules! progmem {
@ -43,6 +48,30 @@ macro_rules! progmem {
$($rest)*
}
};
(
$( #[$attr:meta] )*
$v:vis $id:ident $name:ident: $ty:ty = $value:expr;
$($rest:tt)*
) => {
$( #[$attr] )*
#[link_section = ".progmem.data"]
$v $id $name: $ty = $value;
$crate::progmem!{
$($rest)*
}
};
(
$( #[$attr:meta] )*
$v:vis $id:ident mut $name:ident: $ty:ty = $value:expr;
$($rest:tt)*
) => {
$( #[$attr] )*
#[link_section = ".progmem.data"]
$v $id mut $name: $ty = $value;
$crate::progmem!{
$($rest)*
}
};
() => ()
}