diff --git a/Wrapper-Project/src/library/arduboy/arduboy_tones_export.h b/Wrapper-Project/src/library/arduboy/arduboy_tones_export.h index 9d63dc6..68b34f7 100644 --- a/Wrapper-Project/src/library/arduboy/arduboy_tones_export.h +++ b/Wrapper-Project/src/library/arduboy/arduboy_tones_export.h @@ -2,9 +2,9 @@ #include #include -extern ArduboyTones sound; -extern Arduboy2 arduboy; +extern Arduboy2 arduboy; +ArduboyTones sound(arduboy.audio.enabled); extern "C" { void arduboy_audio_on() diff --git a/Wrapper-Project/src/main.cpp b/Wrapper-Project/src/main.cpp index 60404c0..46015fa 100644 --- a/Wrapper-Project/src/main.cpp +++ b/Wrapper-Project/src/main.cpp @@ -1,4 +1 @@ #include "main.h" - -Arduboy2 arduboy; -ArduboyTones sound(arduboy.audio.enabled); \ No newline at end of file diff --git a/Wrapper-Project/src/main.h b/Wrapper-Project/src/main.h index fae1ad8..3d20f74 100644 --- a/Wrapper-Project/src/main.h +++ b/Wrapper-Project/src/main.h @@ -1,9 +1,33 @@ #pragma once +// Comment out the librarys you dont need. +// This saves memory but be carful if the librarys are not defined +// it will not export the given functions for the rust project. +// +// to save a good amount you can comment out +// the ArduboyTones library if you don't need it. + +#define Arduboy2_Library ; +#define ArduboyTones_Library ; +#define EEPROM_Library ; +#define Arduino_Library ; + +#if defined(Arduboy2_Library) #include -#include +Arduboy2 arduboy; #include "./library/arduboy/arduboy_export.h" #include "./library/arduboy/sprites_export.h" +#endif + +#if defined(ArduboyTones_Library) +#include #include "./library/arduboy/arduboy_tones_export.h" +#endif + +#if defined(Arduino_Library) #include "./library/arduino/arduino_export.h" +#endif + +#if defined(EEPROM_Library) #include "./library/arduino/eeprom_export.h" +#endif