added the f!() macro to the library to make shure that all random text can be written to the progmem to save the important ram
This commit is contained in:
parent
b00ee76ef1
commit
990ae0c03c
11 changed files with 71 additions and 97 deletions
|
@ -1,4 +1,5 @@
|
||||||
#![no_std]
|
#![no_std]
|
||||||
|
#![allow(non_upper_case_globals)]
|
||||||
//Include the Arduboy Library
|
//Include the Arduboy Library
|
||||||
//Initialize the arduboy object
|
//Initialize the arduboy object
|
||||||
use arduboy_rust::prelude::*;
|
use arduboy_rust::prelude::*;
|
||||||
|
@ -8,7 +9,7 @@ pub unsafe extern "C" fn setup() {
|
||||||
// put your setup code here, to run once:
|
// put your setup code here, to run once:
|
||||||
arduboy.begin();
|
arduboy.begin();
|
||||||
arduboy.clear();
|
arduboy.clear();
|
||||||
arduboy.print("Holmes is cool!\0");
|
arduboy.print(f!(b"Holmes is cool!\0"));
|
||||||
arduboy.display();
|
arduboy.display();
|
||||||
}
|
}
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
|
|
@ -43,7 +43,7 @@ pub unsafe extern "C" fn loop_() {
|
||||||
//Move the cursor to the position 30, 30 of the screen
|
//Move the cursor to the position 30, 30 of the screen
|
||||||
arduboy.set_cursor(30, 30);
|
arduboy.set_cursor(30, 30);
|
||||||
//Printing the yay (important always put the \0 at the end for &str)
|
//Printing the yay (important always put the \0 at the end for &str)
|
||||||
arduboy.print("Yay!\0");
|
arduboy.print(f!(b"Yay!\0"));
|
||||||
}
|
}
|
||||||
//Move the cursor back to the top-left of the screen
|
//Move the cursor back to the top-left of the screen
|
||||||
arduboy.set_cursor(0, 0);
|
arduboy.set_cursor(0, 0);
|
||||||
|
|
|
@ -33,9 +33,9 @@ pub unsafe extern "C" fn loop_() {
|
||||||
if attempts == 7 {
|
if attempts == 7 {
|
||||||
//Game Over screen
|
//Game Over screen
|
||||||
arduboy.set_cursor(0, 0);
|
arduboy.set_cursor(0, 0);
|
||||||
arduboy.print("You lost!\0");
|
arduboy.print(f!(b"You lost!\0"));
|
||||||
arduboy.print("\n\0");
|
arduboy.print(f!(b"\n\0"));
|
||||||
arduboy.print("Correct Number: \0");
|
arduboy.print(f!(b"Correct Number: \0"));
|
||||||
arduboy.print(randomnumber);
|
arduboy.print(randomnumber);
|
||||||
if A.just_pressed() {
|
if A.just_pressed() {
|
||||||
randomnumber = random_between(1, 101) as i16;
|
randomnumber = random_between(1, 101) as i16;
|
||||||
|
@ -59,30 +59,30 @@ pub unsafe extern "C" fn loop_() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
arduboy.set_cursor(0, 0);
|
arduboy.set_cursor(0, 0);
|
||||||
arduboy.print("Attempt: \0");
|
arduboy.print(f!(b"Attempt: \0"));
|
||||||
arduboy.print(attempts);
|
arduboy.print(attempts);
|
||||||
arduboy.print("\n\0");
|
arduboy.print(f!(b"\n\0"));
|
||||||
arduboy.print("Number to guess: \0");
|
arduboy.print(f!(b"Number to guess: \0"));
|
||||||
arduboy.print(guessednumber);
|
arduboy.print(guessednumber);
|
||||||
arduboy.print("\n\0");
|
arduboy.print(f!(b"\n\0"));
|
||||||
if attempts == 0 {
|
if attempts == 0 {
|
||||||
arduboy.print("Good luck!\0");
|
arduboy.print(f!(b"Good luck!\0"));
|
||||||
} else {
|
} else {
|
||||||
arduboy.print(lastguess);
|
arduboy.print(lastguess);
|
||||||
if lastguess > randomnumber {
|
if lastguess > randomnumber {
|
||||||
arduboy.print(" is too high!\0");
|
arduboy.print(f!(b" is too high!\0"));
|
||||||
}
|
}
|
||||||
if lastguess < randomnumber {
|
if lastguess < randomnumber {
|
||||||
arduboy.print(" is too low!\0");
|
arduboy.print(f!(b" is too low!\0"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Tell the player that they won!
|
//Tell the player that they won!
|
||||||
arduboy.set_cursor(0, 0);
|
arduboy.set_cursor(0, 0);
|
||||||
arduboy.print("You won!\0");
|
arduboy.print(f!(b"You won!\0"));
|
||||||
arduboy.print("\n\0");
|
arduboy.print(f!(b"\n\0"));
|
||||||
arduboy.print("Correct Number: \0");
|
arduboy.print(f!(b"Correct Number: \0"));
|
||||||
arduboy.print(randomnumber);
|
arduboy.print(randomnumber);
|
||||||
|
|
||||||
if A.just_pressed() {
|
if A.just_pressed() {
|
||||||
|
|
|
@ -48,10 +48,10 @@ pub unsafe extern "C" fn loop_() {
|
||||||
arduboy.print(count as u16);
|
arduboy.print(count as u16);
|
||||||
|
|
||||||
arduboy.set_cursor(0, 30);
|
arduboy.set_cursor(0, 30);
|
||||||
arduboy.print("Memory:\0");
|
arduboy.print(f!(b"Memory:\0"));
|
||||||
arduboy.print(MEM as u16);
|
arduboy.print(MEM as u16);
|
||||||
arduboy.set_cursor(0, 40);
|
arduboy.set_cursor(0, 40);
|
||||||
arduboy.print("eeprom:\0");
|
arduboy.print(f!(b"eeprom:\0"));
|
||||||
|
|
||||||
arduboy.print(eeprom.read() as u16);
|
arduboy.print(eeprom.read() as u16);
|
||||||
|
|
||||||
|
|
|
@ -62,58 +62,6 @@ progmem!(
|
||||||
TONES_REPEAT,
|
TONES_REPEAT,
|
||||||
];
|
];
|
||||||
);
|
);
|
||||||
//#[link_section = ".progmem.data"]
|
|
||||||
//static player_sprite1: [u8; 34] = [
|
|
||||||
// 16, 16, 0xfe, 0x01, 0x3d, 0x25, 0x25, 0x3d, 0x01, 0x01, 0xc1, 0x01, 0x3d, 0x25, 0x25, 0x3d,
|
|
||||||
// 0x01, 0xfe, 0x7f, 0x80, 0x9c, 0xbc, 0xb0, 0xb0, 0xb2, 0xb2, 0xb3, 0xb0, 0xb0, 0xb0, 0xbc, 0x9c,
|
|
||||||
// 0x80, 0x7f,
|
|
||||||
//];
|
|
||||||
// #[link_section = ".progmem.data"]
|
|
||||||
// static tones: [u16; 43] = [
|
|
||||||
// NOTE_E4,
|
|
||||||
// 400,
|
|
||||||
// NOTE_D4,
|
|
||||||
// 200,
|
|
||||||
// NOTE_C4,
|
|
||||||
// 400,
|
|
||||||
// NOTE_REST,
|
|
||||||
// 200,
|
|
||||||
// NOTE_D4,
|
|
||||||
// 200,
|
|
||||||
// NOTE_C4,
|
|
||||||
// 300,
|
|
||||||
// NOTE_REST,
|
|
||||||
// 100,
|
|
||||||
// NOTE_C4,
|
|
||||||
// 300,
|
|
||||||
// NOTE_REST,
|
|
||||||
// 100,
|
|
||||||
// NOTE_E4,
|
|
||||||
// 300,
|
|
||||||
// NOTE_REST,
|
|
||||||
// 100,
|
|
||||||
// NOTE_G4,
|
|
||||||
// 300,
|
|
||||||
// NOTE_REST,
|
|
||||||
// 100,
|
|
||||||
// NOTE_F4,
|
|
||||||
// 300,
|
|
||||||
// NOTE_REST,
|
|
||||||
// 100,
|
|
||||||
// NOTE_A4,
|
|
||||||
// 300,
|
|
||||||
// NOTE_REST,
|
|
||||||
// 100,
|
|
||||||
// NOTE_D5H,
|
|
||||||
// 200,
|
|
||||||
// NOTE_REST,
|
|
||||||
// 200,
|
|
||||||
// NOTE_D5H,
|
|
||||||
// 200,
|
|
||||||
// NOTE_REST,
|
|
||||||
// 1500,
|
|
||||||
// TONES_REPEAT,
|
|
||||||
// ];
|
|
||||||
|
|
||||||
// dynamic ram variables
|
// dynamic ram variables
|
||||||
static mut playerx: c_int = 5;
|
static mut playerx: c_int = 5;
|
||||||
|
|
|
@ -341,7 +341,7 @@ pub unsafe extern "C" fn loop_() {
|
||||||
|
|
||||||
sound.tone(1000, 0);
|
sound.tone(1000, 0);
|
||||||
arduboy.clear();
|
arduboy.clear();
|
||||||
arduboy.print("tone(1000)\n\nB: no_tone()\n delay(1000)\n break\0");
|
arduboy.print(f!(b"tone(1000)\n\nB: no_tone()\n delay(1000)\n break\0"));
|
||||||
while sound.playing() {
|
while sound.playing() {
|
||||||
move_circle();
|
move_circle();
|
||||||
if arduboy.pressed(B_BUTTON) {
|
if arduboy.pressed(B_BUTTON) {
|
||||||
|
@ -353,7 +353,7 @@ pub unsafe extern "C" fn loop_() {
|
||||||
|
|
||||||
sound.tone(500, 4000);
|
sound.tone(500, 4000);
|
||||||
arduboy.clear();
|
arduboy.clear();
|
||||||
arduboy.print("tone(500, 4000)\n\nB: break\0");
|
arduboy.print(f!(b"tone(500, 4000)\n\nB: break\0"));
|
||||||
while sound.playing() {
|
while sound.playing() {
|
||||||
move_circle();
|
move_circle();
|
||||||
if arduboy.pressed(B_BUTTON) {
|
if arduboy.pressed(B_BUTTON) {
|
||||||
|
@ -364,7 +364,7 @@ pub unsafe extern "C" fn loop_() {
|
||||||
|
|
||||||
sound.tone2(NOTE_C4, 500, NOTE_C5H, 5000);
|
sound.tone2(NOTE_C4, 500, NOTE_C5H, 5000);
|
||||||
arduboy.clear();
|
arduboy.clear();
|
||||||
arduboy.print("tone(C4,500,C5H,5000)\n\nB: no_tone(), break\0");
|
arduboy.print(f!(b"tone(C4,500,C5H,5000)\n\nB: no_tone(), break\0"));
|
||||||
while sound.playing() {
|
while sound.playing() {
|
||||||
move_circle();
|
move_circle();
|
||||||
if arduboy.pressed(B_BUTTON) {
|
if arduboy.pressed(B_BUTTON) {
|
||||||
|
@ -376,7 +376,7 @@ pub unsafe extern "C" fn loop_() {
|
||||||
|
|
||||||
sound.tone3(NOTE_C7H, 500, NOTE_REST, 1000, NOTE_C6, 5000);
|
sound.tone3(NOTE_C7H, 500, NOTE_REST, 1000, NOTE_C6, 5000);
|
||||||
arduboy.clear();
|
arduboy.clear();
|
||||||
arduboy.print("tone(C7H,500,\n REST,1000,\n C6,6000)\n\nB: no_tone(), break\0");
|
arduboy.print(f!(b"tone(C7H,500,\n REST,1000,\n C6,6000)\n\nB: no_tone(), break\0"));
|
||||||
while sound.playing() {
|
while sound.playing() {
|
||||||
move_circle();
|
move_circle();
|
||||||
if arduboy.pressed(B_BUTTON) {
|
if arduboy.pressed(B_BUTTON) {
|
||||||
|
@ -388,7 +388,7 @@ pub unsafe extern "C" fn loop_() {
|
||||||
|
|
||||||
sound.tones(get_tones_addr!(allNotes));
|
sound.tones(get_tones_addr!(allNotes));
|
||||||
arduboy.clear();
|
arduboy.clear();
|
||||||
arduboy.print("tones(allNotes)\n\nA: no_tone(), again\nUP: again\nB: break\0");
|
arduboy.print(f!(b"tones(allNotes)\n\nA: no_tone(), again\nUP: again\nB: break\0"));
|
||||||
while sound.playing() {
|
while sound.playing() {
|
||||||
move_circle();
|
move_circle();
|
||||||
if arduboy.pressed(A_BUTTON) {
|
if arduboy.pressed(A_BUTTON) {
|
||||||
|
@ -407,7 +407,7 @@ pub unsafe extern "C" fn loop_() {
|
||||||
new_notes = false;
|
new_notes = false;
|
||||||
sound.tones_in_ram(get_tones_addr!(in_ram) as *mut u32);
|
sound.tones_in_ram(get_tones_addr!(in_ram) as *mut u32);
|
||||||
arduboy.clear();
|
arduboy.clear();
|
||||||
arduboy.print("tonesInRAM(inRAM)\n\nA: change notes\nB: break\0");
|
arduboy.print(f!(b"tonesInRAM(inRAM)\n\nA: change notes\nB: break\0"));
|
||||||
while sound.playing() {
|
while sound.playing() {
|
||||||
move_circle();
|
move_circle();
|
||||||
if arduboy.pressed(A_BUTTON) {
|
if arduboy.pressed(A_BUTTON) {
|
||||||
|
@ -429,7 +429,7 @@ pub unsafe extern "C" fn loop_() {
|
||||||
|
|
||||||
sound.tones(get_tones_addr!(sound1));
|
sound.tones(get_tones_addr!(sound1));
|
||||||
arduboy.clear();
|
arduboy.clear();
|
||||||
arduboy.print("volume_mode(IN_TONES)\ntones(sound1)\n\nB: break\0");
|
arduboy.print(f!(b"volume_mode(IN_TONES)\ntones(sound1)\n\nB: break\0"));
|
||||||
while sound.playing() {
|
while sound.playing() {
|
||||||
move_circle();
|
move_circle();
|
||||||
if arduboy.pressed(B) {
|
if arduboy.pressed(B) {
|
||||||
|
@ -441,7 +441,7 @@ pub unsafe extern "C" fn loop_() {
|
||||||
sound.volume_mode(VOLUME_ALWAYS_NORMAL);
|
sound.volume_mode(VOLUME_ALWAYS_NORMAL);
|
||||||
sound.tones(get_tones_addr!(sound1));
|
sound.tones(get_tones_addr!(sound1));
|
||||||
arduboy.clear();
|
arduboy.clear();
|
||||||
arduboy.print("volume_mode(NORMAL)\ntones(sound1)\n\nB: no_tone(), break\0");
|
arduboy.print(f!(b"volume_mode(NORMAL)\ntones(sound1)\n\nB: no_tone(), break\0"));
|
||||||
while sound.playing() {
|
while sound.playing() {
|
||||||
move_circle();
|
move_circle();
|
||||||
if arduboy.pressed(B) {
|
if arduboy.pressed(B) {
|
||||||
|
@ -454,7 +454,7 @@ pub unsafe extern "C" fn loop_() {
|
||||||
sound.volume_mode(VOLUME_ALWAYS_HIGH);
|
sound.volume_mode(VOLUME_ALWAYS_HIGH);
|
||||||
sound.tones(get_tones_addr!(sound1));
|
sound.tones(get_tones_addr!(sound1));
|
||||||
arduboy.clear();
|
arduboy.clear();
|
||||||
arduboy.print("volume_mode(HIGH)\ntones(sound1)\n\nB: break\0");
|
arduboy.print(f!(b"volume_mode(HIGH)\ntones(sound1)\n\nB: break\0"));
|
||||||
while sound.playing() {
|
while sound.playing() {
|
||||||
move_circle();
|
move_circle();
|
||||||
if arduboy.pressed(B) {
|
if arduboy.pressed(B) {
|
||||||
|
@ -480,13 +480,13 @@ fn move_circle() {
|
||||||
|
|
||||||
fn display_audio() {
|
fn display_audio() {
|
||||||
arduboy.clear();
|
arduboy.clear();
|
||||||
arduboy.print("Audio enabled: \0");
|
arduboy.print(f!(b"Audio enabled: \0"));
|
||||||
if arduboy.audio_enabled() {
|
if arduboy.audio_enabled() {
|
||||||
arduboy.print("YES\0");
|
arduboy.print(f!(b"YES\0"));
|
||||||
} else {
|
} else {
|
||||||
arduboy.print("NO\0")
|
arduboy.print(f!(b"NO\0"))
|
||||||
}
|
}
|
||||||
|
|
||||||
arduboy.print("\n\nUP: enable\nDOWN: disable\nB: break\0");
|
arduboy.print(f!(b"\n\nUP: enable\nDOWN: disable\nB: break\0"));
|
||||||
arduboy.invert(!arduboy.audio_enabled());
|
arduboy.invert(!arduboy.audio_enabled());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#![no_std]
|
#![no_std]
|
||||||
|
#![allow(non_upper_case_globals)]
|
||||||
|
|
||||||
use arduboy_rust::prelude::*;
|
use arduboy_rust::prelude::*;
|
||||||
|
|
||||||
|
@ -91,9 +92,9 @@ pub unsafe extern "C" fn loop_() {
|
||||||
match G.game_state {
|
match G.game_state {
|
||||||
GameState::Title => {
|
GameState::Title => {
|
||||||
arduboy.set_cursor(52, 10);
|
arduboy.set_cursor(52, 10);
|
||||||
arduboy.print(&b"PONG\0"[..]);
|
arduboy.print(f!(b"PONG\0"));
|
||||||
arduboy.set_cursor(16, 22);
|
arduboy.set_cursor(16, 22);
|
||||||
arduboy.print(&b"Press A to start\0"[..]);
|
arduboy.print(f!(b"Press A to start\0"));
|
||||||
if A.just_pressed() {
|
if A.just_pressed() {
|
||||||
G.game_state = GameState::Gameplay;
|
G.game_state = GameState::Gameplay;
|
||||||
}
|
}
|
||||||
|
@ -106,14 +107,14 @@ pub unsafe extern "C" fn loop_() {
|
||||||
}
|
}
|
||||||
GameState::Win => {
|
GameState::Win => {
|
||||||
arduboy.set_cursor(40, 10);
|
arduboy.set_cursor(40, 10);
|
||||||
arduboy.print(&b"You Win!\0"[..]);
|
arduboy.print(f!(b"You Win!\0"));
|
||||||
if A.just_pressed() {
|
if A.just_pressed() {
|
||||||
reset_game();
|
reset_game();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GameState::Lose => {
|
GameState::Lose => {
|
||||||
arduboy.set_cursor(37, 10);
|
arduboy.set_cursor(37, 10);
|
||||||
arduboy.print(&b"Game Over\0"[..]);
|
arduboy.print(f!(b"Game Over\0"));
|
||||||
if A.just_pressed() {
|
if A.just_pressed() {
|
||||||
reset_game();
|
reset_game();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#![no_std]
|
#![no_std]
|
||||||
|
#![allow(non_upper_case_globals)]
|
||||||
use arduboy_rust::prelude::*;
|
use arduboy_rust::prelude::*;
|
||||||
|
|
||||||
static mut MEM: u8 = 0;
|
static mut MEM: u8 = 0;
|
||||||
|
@ -201,10 +202,10 @@ pub unsafe extern "C" fn loop_() {
|
||||||
State::Title => {
|
State::Title => {
|
||||||
arduboy.set_cursor(0, 0);
|
arduboy.set_cursor(0, 0);
|
||||||
arduboy.set_text_size(2);
|
arduboy.set_text_size(2);
|
||||||
arduboy.print(&b"RustySnake\n\0"[..]);
|
arduboy.print(f!(b"RustySnake\n\0"));
|
||||||
arduboy.set_text_size(1);
|
arduboy.set_text_size(1);
|
||||||
arduboy.print(&b"\nControls: \nB for Pause\nA&B for reset\n\0"[..]);
|
arduboy.print(f!(b"\nControls: \nB for Pause\nA&B for reset\n\0"));
|
||||||
arduboy.print(&b"\nZennDev 2023\n\0"[..]);
|
arduboy.print(f!(b"\nZennDev 2023\n\0"));
|
||||||
if A.just_pressed() {
|
if A.just_pressed() {
|
||||||
snake.game_state = State::Game;
|
snake.game_state = State::Game;
|
||||||
}
|
}
|
||||||
|
@ -224,7 +225,7 @@ pub unsafe extern "C" fn loop_() {
|
||||||
}
|
}
|
||||||
State::Win => (),
|
State::Win => (),
|
||||||
State::Pause => {
|
State::Pause => {
|
||||||
let msg = &b"[ Break ]\0"[..];
|
let msg = "[ Break ]\0";
|
||||||
let l = msg.len() as u8 * FONT_SIZE / 2;
|
let l = msg.len() as u8 * FONT_SIZE / 2;
|
||||||
arduboy.set_cursor(
|
arduboy.set_cursor(
|
||||||
((WIDTH / 2) as u16 - l as u16).try_into().unwrap(),
|
((WIDTH / 2) as u16 - l as u16).try_into().unwrap(),
|
||||||
|
@ -248,14 +249,14 @@ pub unsafe extern "C" fn loop_() {
|
||||||
}
|
}
|
||||||
|
|
||||||
arduboy.set_cursor(0, 0);
|
arduboy.set_cursor(0, 0);
|
||||||
arduboy.print(&b"Game Over!\0"[..]);
|
arduboy.print(f!(b"Game Over!\0"));
|
||||||
arduboy.print(&b"\n\n\0"[..]);
|
arduboy.print(f!(b"\n\n\0"));
|
||||||
arduboy.print(&b"Score: \0"[..]);
|
arduboy.print(f!(b"Score: \0"));
|
||||||
arduboy.print(snake.points as u16);
|
arduboy.print(snake.points as u16);
|
||||||
arduboy.print(&b"\nHigh Score: \0"[..]);
|
arduboy.print(f!(b"\nHigh Score: \0"));
|
||||||
arduboy.print(MEM as u16);
|
arduboy.print(MEM as u16);
|
||||||
arduboy.print(&b"\n\n\0"[..]);
|
arduboy.print(f!(b"\n\n\0"));
|
||||||
arduboy.print(&b"Press A to Play Again\0"[..]);
|
arduboy.print(f!(b"Press A to Play Again\0"));
|
||||||
|
|
||||||
if A.just_pressed() {
|
if A.just_pressed() {
|
||||||
snake.game_state = State::Reset;
|
snake.game_state = State::Reset;
|
||||||
|
|
|
@ -14,6 +14,10 @@ use arduboy_rust::prelude::*;
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub unsafe extern "C" fn setup() {
|
pub unsafe extern "C" fn setup() {
|
||||||
// put your setup code here, to run once:
|
// put your setup code here, to run once:
|
||||||
|
arduboy.begin();
|
||||||
|
arduboy.clear();
|
||||||
|
arduboy.print(f!(b"hello boys\0"));
|
||||||
|
arduboy.display();
|
||||||
}
|
}
|
||||||
|
|
||||||
// The loop() function repeats forever after setup() is done
|
// The loop() function repeats forever after setup() is done
|
||||||
|
|
|
@ -63,3 +63,22 @@ macro_rules! get_string_addr {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
pub(super) use get_string_addr;
|
pub(super) use get_string_addr;
|
||||||
|
///This is the way to go if you want print some random text
|
||||||
|
///
|
||||||
|
/// This doesn't waste the 2kb ram it saves to progmem (28kb)
|
||||||
|
/// This automatically saves the given text to the Progmem.
|
||||||
|
/// ## Example
|
||||||
|
/// ```
|
||||||
|
/// arduboy.print(f!(b"Random text to print"))
|
||||||
|
/// ```
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! f {
|
||||||
|
($string_literal:literal) => {{
|
||||||
|
progmem!(
|
||||||
|
static local: [u8; _] = *$string_literal;
|
||||||
|
);
|
||||||
|
|
||||||
|
get_string_addr!(local)
|
||||||
|
}};
|
||||||
|
}
|
||||||
|
pub(super) use f;
|
||||||
|
|
|
@ -19,7 +19,7 @@ pub use crate::library::c::*;
|
||||||
pub use crate::library::eeprom::EEPROM;
|
pub use crate::library::eeprom::EEPROM;
|
||||||
pub use crate::library::sprites;
|
pub use crate::library::sprites;
|
||||||
pub use crate::print::*;
|
pub use crate::print::*;
|
||||||
pub use crate::{get_sprite_addr, get_string_addr, get_tones_addr, progmem};
|
pub use crate::{f, get_sprite_addr, get_string_addr, get_tones_addr, progmem};
|
||||||
use core::cmp;
|
use core::cmp;
|
||||||
|
|
||||||
pub fn constrain<T: Ord>(x: T, a: T, b: T) -> T {
|
pub fn constrain<T: Ord>(x: T, a: T, b: T) -> T {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue