Macro arduboy_rust::arduino_system::progmem::progmem
source · macro_rules! progmem { ( $( #[$attr:meta] )* $v:vis $id:ident $name:ident: [$ty:ty; _] = $value:expr; $($rest:tt)* ) => { ... }; ( $( #[$attr:meta] )* $v:vis $id:ident mut $name:ident: [$ty:ty; _] = $value:expr; $($rest:tt)* ) => { ... }; ( $( #[$attr:meta] )* $v:vis $id:ident $name:ident: $ty:ty = $value:expr; $($rest:tt)* ) => { ... }; ( $( #[$attr:meta] )* $v:vis $id:ident mut $name:ident: $ty:ty = $value:expr; $($rest:tt)* ) => { ... }; () => { ... }; }
Expand description
Create a space for Progmem variable
Example
use arduboy_rust::prelude::*;
//for text
progmem!(
static text: [u8; _] = *b"I'm a PROGMEM Text\0";
);
//for tone sequence
progmem!(
static tone: [u16; _] = [
NOTE_E4, 400, NOTE_D4, 200, NOTE_C4, 400, NOTE_D4, 200, NOTE_C4, 300, NOTE_REST,
];
);
//for for bitmap
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();
);