added a simple ifdef logic in the main.h file to exclude unused libraries
This commit is contained in:
parent
87e451b82b
commit
10236c7441
3 changed files with 27 additions and 6 deletions
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
#include <ArduboyTones.h>
|
#include <ArduboyTones.h>
|
||||||
#include <Arduboy2.h>
|
#include <Arduboy2.h>
|
||||||
extern ArduboyTones sound;
|
|
||||||
extern Arduboy2 arduboy;
|
|
||||||
|
|
||||||
|
extern Arduboy2 arduboy;
|
||||||
|
ArduboyTones sound(arduboy.audio.enabled);
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
void arduboy_audio_on()
|
void arduboy_audio_on()
|
||||||
|
|
|
@ -1,4 +1 @@
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
Arduboy2 arduboy;
|
|
||||||
ArduboyTones sound(arduboy.audio.enabled);
|
|
|
@ -1,9 +1,33 @@
|
||||||
#pragma once
|
#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 <Arduboy2.h>
|
||||||
#include <ArduboyTones.h>
|
Arduboy2 arduboy;
|
||||||
#include "./library/arduboy/arduboy_export.h"
|
#include "./library/arduboy/arduboy_export.h"
|
||||||
#include "./library/arduboy/sprites_export.h"
|
#include "./library/arduboy/sprites_export.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(ArduboyTones_Library)
|
||||||
|
#include <ArduboyTones.h>
|
||||||
#include "./library/arduboy/arduboy_tones_export.h"
|
#include "./library/arduboy/arduboy_tones_export.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(Arduino_Library)
|
||||||
#include "./library/arduino/arduino_export.h"
|
#include "./library/arduino/arduino_export.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(EEPROM_Library)
|
||||||
#include "./library/arduino/eeprom_export.h"
|
#include "./library/arduino/eeprom_export.h"
|
||||||
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue