added get_ardvoice macro to the crate

This commit is contained in:
Zenn 2023-09-12 19:20:12 +02:00
parent 928d1fae1c
commit 8792cc6bdd
3 changed files with 13 additions and 3 deletions

View file

@ -85,6 +85,14 @@ macro_rules! get_sprite_addr {
}
pub(super) use get_sprite_addr;
///Create a `const` raw pointer to a ardvoice tone as u8, without creating an intermediate reference.
#[macro_export]
macro_rules! get_ardvoice_tone_addr {
( $s:expr ) => {
unsafe { addr_of!($s) as *const u8 }
};
}
pub(super) use get_ardvoice_tone_addr;
///Create a `const` raw pointer to a sprite as u16, without creating an intermediate reference.
#[macro_export]
macro_rules! get_tones_addr {

View file

@ -19,7 +19,9 @@ pub use crate::library::eeprom::{EEPROM, EEPROMBYTE, EEPROMBYTECHECKLESS};
pub use crate::library::progmem::Pstring;
pub use crate::library::sprites;
pub use crate::print::*;
pub use crate::{f, get_sprite_addr, get_string_addr, get_tones_addr, progmem};
pub use crate::{
f, get_ardvoice_tone_addr, get_sprite_addr, get_string_addr, get_tones_addr, progmem,
};
use core::cmp;
pub use core::ffi::{
c_char, c_double, c_float, c_int, c_long, c_longlong, c_size_t, c_uchar, c_uint, c_ulong,