added a simple ifdef logic in the main.h file to exclude unused libraries

This commit is contained in:
ZennDev1337 2023-08-15 15:25:08 +02:00
parent 87e451b82b
commit 10236c7441
3 changed files with 27 additions and 6 deletions

View file

@ -2,9 +2,9 @@
#include <ArduboyTones.h>
#include <Arduboy2.h>
extern ArduboyTones sound;
extern Arduboy2 arduboy;
extern Arduboy2 arduboy;
ArduboyTones sound(arduboy.audio.enabled);
extern "C"
{
void arduboy_audio_on()

View file

@ -1,4 +1 @@
#include "main.h"
Arduboy2 arduboy;
ArduboyTones sound(arduboy.audio.enabled);

View file

@ -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 <Arduboy2.h>
#include <ArduboyTones.h>
Arduboy2 arduboy;
#include "./library/arduboy/arduboy_export.h"
#include "./library/arduboy/sprites_export.h"
#endif
#if defined(ArduboyTones_Library)
#include <ArduboyTones.h>
#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