added support for structs inside of eeprom memory
This commit is contained in:
parent
d382da0300
commit
c21aa97915
27 changed files with 605 additions and 414 deletions
|
@ -1,131 +0,0 @@
|
|||
#include "arduboy.h"
|
||||
extern Arduboy2 arduboy;
|
||||
|
||||
void arduboy_begin(void)
|
||||
{
|
||||
arduboy.begin();
|
||||
}
|
||||
void arduboy_clear(void)
|
||||
{
|
||||
arduboy.clear();
|
||||
}
|
||||
void arduboy_display(void)
|
||||
{
|
||||
arduboy.display();
|
||||
}
|
||||
void arduboy_display_and_clear_buffer(void)
|
||||
{
|
||||
arduboy.display(CLEAR_BUFFER);
|
||||
}
|
||||
void arduboy_draw_fast_hline(int16_t x, int16_t y, uint8_t w, uint8_t color)
|
||||
{
|
||||
arduboy.drawFastHLine(x, y, w, color);
|
||||
}
|
||||
void arduboy_draw_fast_vline(int16_t x, int16_t y, uint8_t h, uint8_t color)
|
||||
{
|
||||
arduboy.drawFastVLine(x, y, h, color);
|
||||
}
|
||||
void arduboy_draw_pixel(int16_t x, int16_t y, uint8_t color)
|
||||
{
|
||||
arduboy.drawPixel(x, y, color);
|
||||
}
|
||||
void arduboy_draw_circle(int16_t x, int16_t y, uint8_t r, uint8_t color)
|
||||
{
|
||||
arduboy.drawCircle(x, y, r, color);
|
||||
}
|
||||
void arduboy_fill_circle(int16_t x, int16_t y, uint8_t r, uint8_t color)
|
||||
{
|
||||
arduboy.fillCircle(x, y, r, color);
|
||||
}
|
||||
void arduboy_fill_rect(int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t color)
|
||||
{
|
||||
arduboy.fillRect(x, y, w, h, color);
|
||||
}
|
||||
void arduboy_draw_rect(int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t color)
|
||||
{
|
||||
arduboy.drawRect(x, y, w, h, color);
|
||||
}
|
||||
unsigned long arduboy_generate_random_seed()
|
||||
{
|
||||
return arduboy.generateRandomSeed();
|
||||
}
|
||||
uint8_t arduboy_get_pixel(uint8_t x, uint8_t y)
|
||||
{
|
||||
return arduboy.getPixel(x, y);
|
||||
}
|
||||
void arduboy_init_random_seed(void)
|
||||
{
|
||||
arduboy.initRandomSeed();
|
||||
}
|
||||
bool arduboy_just_pressed(uint8_t button)
|
||||
{
|
||||
return arduboy.justPressed(button);
|
||||
}
|
||||
bool arduboy_just_released(uint8_t button)
|
||||
{
|
||||
return arduboy.justReleased(button);
|
||||
}
|
||||
bool arduboy_next_frame(void)
|
||||
{
|
||||
return arduboy.nextFrame();
|
||||
}
|
||||
void arduboy_poll_buttons()
|
||||
{
|
||||
arduboy.pollButtons();
|
||||
}
|
||||
bool arduboy_pressed(uint8_t buttons)
|
||||
{
|
||||
return arduboy.pressed(buttons);
|
||||
}
|
||||
void arduboy_print_chars(const char *cstr)
|
||||
{
|
||||
arduboy.print(cstr);
|
||||
}
|
||||
size_t arduboy_print_chars_progmem(const char *cstr)
|
||||
{
|
||||
return arduboy.print(reinterpret_cast<const __FlashStringHelper *>(cstr));
|
||||
}
|
||||
size_t arduboy_print_char(char c)
|
||||
{
|
||||
return arduboy.print(c);
|
||||
}
|
||||
size_t arduboy_print_int(int n, int base)
|
||||
{
|
||||
return arduboy.print(n, base);
|
||||
}
|
||||
size_t arduboy_print_long(long n, int base)
|
||||
{
|
||||
return arduboy.print(n, base);
|
||||
}
|
||||
size_t arduboy_print_unsigned_char(unsigned char n, int base)
|
||||
{
|
||||
return arduboy.print(n, base);
|
||||
}
|
||||
size_t arduboy_print_unsigned_int(unsigned int n, int base)
|
||||
{
|
||||
return arduboy.print(n, base);
|
||||
}
|
||||
size_t arduboy_print_unsigned_long(unsigned long n, int base)
|
||||
{
|
||||
return arduboy.print(n, base);
|
||||
}
|
||||
void arduboy_set_cursor(int16_t x, int16_t y)
|
||||
{
|
||||
arduboy.setCursor(x, y);
|
||||
}
|
||||
void arduboy_set_frame_rate(uint8_t rate)
|
||||
{
|
||||
arduboy.setFrameRate(rate);
|
||||
}
|
||||
bool arduboy_not_pressed(uint8_t button)
|
||||
{
|
||||
arduboy.notPressed(button);
|
||||
}
|
||||
void arduboy_set_text_size(uint8_t s)
|
||||
{
|
||||
arduboy.setTextSize(s);
|
||||
}
|
||||
void arduboy_invert(bool inverse)
|
||||
{
|
||||
arduboy.invert(inverse);
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
#pragma once
|
||||
#include <Arduboy2.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void arduboy_begin(void);
|
||||
void arduboy_clear(void);
|
||||
void arduboy_display(void);
|
||||
void arduboy_display_and_clear_buffer(void);
|
||||
void arduboy_draw_fast_hline(int16_t x, int16_t y, uint8_t w, uint8_t color);
|
||||
void arduboy_draw_fast_vline(int16_t x, int16_t y, uint8_t h, uint8_t color);
|
||||
void arduboy_draw_pixel(int16_t x, int16_t y, uint8_t color);
|
||||
void arduboy_draw_circle(int16_t x, int16_t y, uint8_t r, uint8_t color);
|
||||
void arduboy_fill_circle(int16_t x, int16_t y, uint8_t r, uint8_t color);
|
||||
void arduboy_draw_rect(int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t color);
|
||||
void arduboy_fill_rect(int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t color);
|
||||
unsigned long arduboy_generate_random_seed();
|
||||
uint8_t arduboy_get_pixel(uint8_t x, uint8_t y);
|
||||
void arduboy_init_random_seed(void);
|
||||
bool arduboy_just_pressed(uint8_t button);
|
||||
bool arduboy_just_released(uint8_t button);
|
||||
bool arduboy_next_frame(void);
|
||||
void arduboy_poll_buttons();
|
||||
bool arduboy_pressed(uint8_t buttons);
|
||||
void arduboy_print_chars(const char *cstr);
|
||||
size_t arduboy_print_char(char c);
|
||||
size_t arduboy_print_chars_progmem(const char *);
|
||||
size_t arduboy_print_int(int n, int base);
|
||||
size_t arduboy_print_long(long n, int base);
|
||||
size_t arduboy_print_unsigned_char(unsigned char n, int base);
|
||||
size_t arduboy_print_unsigned_int(unsigned int n, int base);
|
||||
size_t arduboy_print_unsigned_long(unsigned long n, int base);
|
||||
void arduboy_set_cursor(int16_t x, int16_t y);
|
||||
void arduboy_set_frame_rate(uint8_t rate);
|
||||
bool arduboy_not_pressed(uint8_t button);
|
||||
void arduboy_set_text_size(uint8_t s);
|
||||
void arduboy_invert(bool inverse);
|
||||
}
|
134
Wrapper-Project/src/library/arduboy/arduboy_export.h
Normal file
134
Wrapper-Project/src/library/arduboy/arduboy_export.h
Normal file
|
@ -0,0 +1,134 @@
|
|||
#pragma once
|
||||
#include <Arduboy2.h>
|
||||
extern Arduboy2 arduboy;
|
||||
extern "C"
|
||||
{
|
||||
void arduboy_begin(void)
|
||||
{
|
||||
arduboy.begin();
|
||||
}
|
||||
void arduboy_clear(void)
|
||||
{
|
||||
arduboy.clear();
|
||||
}
|
||||
void arduboy_display(void)
|
||||
{
|
||||
arduboy.display();
|
||||
}
|
||||
void arduboy_display_and_clear_buffer(void)
|
||||
{
|
||||
arduboy.display(CLEAR_BUFFER);
|
||||
}
|
||||
void arduboy_draw_fast_hline(int16_t x, int16_t y, uint8_t w, uint8_t color)
|
||||
{
|
||||
arduboy.drawFastHLine(x, y, w, color);
|
||||
}
|
||||
void arduboy_draw_fast_vline(int16_t x, int16_t y, uint8_t h, uint8_t color)
|
||||
{
|
||||
arduboy.drawFastVLine(x, y, h, color);
|
||||
}
|
||||
void arduboy_draw_pixel(int16_t x, int16_t y, uint8_t color)
|
||||
{
|
||||
arduboy.drawPixel(x, y, color);
|
||||
}
|
||||
void arduboy_draw_circle(int16_t x, int16_t y, uint8_t r, uint8_t color)
|
||||
{
|
||||
arduboy.drawCircle(x, y, r, color);
|
||||
}
|
||||
void arduboy_fill_circle(int16_t x, int16_t y, uint8_t r, uint8_t color)
|
||||
{
|
||||
arduboy.fillCircle(x, y, r, color);
|
||||
}
|
||||
void arduboy_fill_rect(int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t color)
|
||||
{
|
||||
arduboy.fillRect(x, y, w, h, color);
|
||||
}
|
||||
void arduboy_draw_rect(int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t color)
|
||||
{
|
||||
arduboy.drawRect(x, y, w, h, color);
|
||||
}
|
||||
unsigned long arduboy_generate_random_seed()
|
||||
{
|
||||
return arduboy.generateRandomSeed();
|
||||
}
|
||||
uint8_t arduboy_get_pixel(uint8_t x, uint8_t y)
|
||||
{
|
||||
return arduboy.getPixel(x, y);
|
||||
}
|
||||
void arduboy_init_random_seed(void)
|
||||
{
|
||||
arduboy.initRandomSeed();
|
||||
}
|
||||
bool arduboy_just_pressed(uint8_t button)
|
||||
{
|
||||
return arduboy.justPressed(button);
|
||||
}
|
||||
bool arduboy_just_released(uint8_t button)
|
||||
{
|
||||
return arduboy.justReleased(button);
|
||||
}
|
||||
bool arduboy_next_frame(void)
|
||||
{
|
||||
return arduboy.nextFrame();
|
||||
}
|
||||
void arduboy_poll_buttons()
|
||||
{
|
||||
arduboy.pollButtons();
|
||||
}
|
||||
bool arduboy_pressed(uint8_t buttons)
|
||||
{
|
||||
return arduboy.pressed(buttons);
|
||||
}
|
||||
void arduboy_print_chars(const char *cstr)
|
||||
{
|
||||
arduboy.print(cstr);
|
||||
}
|
||||
size_t arduboy_print_chars_progmem(const char *cstr)
|
||||
{
|
||||
return arduboy.print(reinterpret_cast<const __FlashStringHelper *>(cstr));
|
||||
}
|
||||
size_t arduboy_print_char(char c)
|
||||
{
|
||||
return arduboy.print(c);
|
||||
}
|
||||
size_t arduboy_print_int(int n, int base)
|
||||
{
|
||||
return arduboy.print(n, base);
|
||||
}
|
||||
size_t arduboy_print_long(long n, int base)
|
||||
{
|
||||
return arduboy.print(n, base);
|
||||
}
|
||||
size_t arduboy_print_unsigned_char(unsigned char n, int base)
|
||||
{
|
||||
return arduboy.print(n, base);
|
||||
}
|
||||
size_t arduboy_print_unsigned_int(unsigned int n, int base)
|
||||
{
|
||||
return arduboy.print(n, base);
|
||||
}
|
||||
size_t arduboy_print_unsigned_long(unsigned long n, int base)
|
||||
{
|
||||
return arduboy.print(n, base);
|
||||
}
|
||||
void arduboy_set_cursor(int16_t x, int16_t y)
|
||||
{
|
||||
arduboy.setCursor(x, y);
|
||||
}
|
||||
void arduboy_set_frame_rate(uint8_t rate)
|
||||
{
|
||||
arduboy.setFrameRate(rate);
|
||||
}
|
||||
bool arduboy_not_pressed(uint8_t button)
|
||||
{
|
||||
arduboy.notPressed(button);
|
||||
}
|
||||
void arduboy_set_text_size(uint8_t s)
|
||||
{
|
||||
arduboy.setTextSize(s);
|
||||
}
|
||||
void arduboy_invert(bool inverse)
|
||||
{
|
||||
arduboy.invert(inverse);
|
||||
}
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
#include "arduboy_tones.h"
|
||||
|
||||
void arduboy_audio_on()
|
||||
{
|
||||
arduboy.audio.on();
|
||||
}
|
||||
void arduboy_audio_off()
|
||||
{
|
||||
arduboy.audio.off();
|
||||
}
|
||||
void arduboy_audio_toggle()
|
||||
{
|
||||
arduboy.audio.toggle();
|
||||
}
|
||||
void arduboy_audio_save_on_off()
|
||||
{
|
||||
arduboy.audio.saveOnOff();
|
||||
}
|
||||
bool arduboy_audio_enabled()
|
||||
{
|
||||
return arduboy.audio.enabled();
|
||||
}
|
||||
void sound_tone(unsigned int frequency, unsigned long duration)
|
||||
{
|
||||
sound.tone(frequency, duration);
|
||||
}
|
||||
void sound_tone2(unsigned int frequency1, unsigned long duration1, unsigned int frequency2, unsigned long duration2)
|
||||
{
|
||||
sound.tone(frequency1, duration1, frequency2, duration2);
|
||||
}
|
||||
void sound_tone3(unsigned int frequency1, unsigned long duration1, unsigned int frequency2, unsigned long duration2, unsigned int frequency3, unsigned long duration3)
|
||||
{
|
||||
sound.tone(frequency1, duration1, frequency2, duration2, frequency3, duration3);
|
||||
}
|
||||
void sound_tones(const uint16_t *tones)
|
||||
{
|
||||
sound.tones(tones);
|
||||
}
|
||||
void sound_no_tone()
|
||||
{
|
||||
sound.noTone();
|
||||
}
|
||||
bool sound_playing()
|
||||
{
|
||||
sound.playing();
|
||||
}
|
||||
void sound_tones_in_ram(uint16_t *tones)
|
||||
{
|
||||
sound.tonesInRAM(tones);
|
||||
}
|
||||
void sound_volume_mode(uint8_t mode)
|
||||
{
|
||||
sound.volumeMode(mode);
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <ArduboyTones.h>
|
||||
#include <Arduboy2.h>
|
||||
extern ArduboyTones sound;
|
||||
extern Arduboy2 arduboy;
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void arduboy_audio_on();
|
||||
void arduboy_audio_off();
|
||||
bool arduboy_audio_enabled();
|
||||
void arduboy_audio_toggle();
|
||||
void arduboy_audio_save_on_off();
|
||||
void sound_tone(unsigned int frequency, unsigned long duration);
|
||||
void sound_tone2(unsigned int frequency1, unsigned long duration1, unsigned int frequency2, unsigned long duration2);
|
||||
void sound_tone3(unsigned int frequency1, unsigned long duration1, unsigned int frequency2, unsigned long duration2, unsigned int frequency3, unsigned long duration3);
|
||||
void sound_tones(const uint16_t *tones);
|
||||
void sound_no_tone();
|
||||
bool sound_playing();
|
||||
void sound_tones_in_ram(uint16_t *tones);
|
||||
void sound_volume_mode(uint8_t mode);
|
||||
}
|
62
Wrapper-Project/src/library/arduboy/arduboy_tones_export.h
Normal file
62
Wrapper-Project/src/library/arduboy/arduboy_tones_export.h
Normal file
|
@ -0,0 +1,62 @@
|
|||
#pragma once
|
||||
|
||||
#include <ArduboyTones.h>
|
||||
#include <Arduboy2.h>
|
||||
extern ArduboyTones sound;
|
||||
extern Arduboy2 arduboy;
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void arduboy_audio_on()
|
||||
{
|
||||
arduboy.audio.on();
|
||||
}
|
||||
void arduboy_audio_off()
|
||||
{
|
||||
arduboy.audio.off();
|
||||
}
|
||||
void arduboy_audio_toggle()
|
||||
{
|
||||
arduboy.audio.toggle();
|
||||
}
|
||||
void arduboy_audio_save_on_off()
|
||||
{
|
||||
arduboy.audio.saveOnOff();
|
||||
}
|
||||
bool arduboy_audio_enabled()
|
||||
{
|
||||
return arduboy.audio.enabled();
|
||||
}
|
||||
void sound_tone(unsigned int frequency, unsigned long duration)
|
||||
{
|
||||
sound.tone(frequency, duration);
|
||||
}
|
||||
void sound_tone2(unsigned int frequency1, unsigned long duration1, unsigned int frequency2, unsigned long duration2)
|
||||
{
|
||||
sound.tone(frequency1, duration1, frequency2, duration2);
|
||||
}
|
||||
void sound_tone3(unsigned int frequency1, unsigned long duration1, unsigned int frequency2, unsigned long duration2, unsigned int frequency3, unsigned long duration3)
|
||||
{
|
||||
sound.tone(frequency1, duration1, frequency2, duration2, frequency3, duration3);
|
||||
}
|
||||
void sound_tones(const uint16_t *tones)
|
||||
{
|
||||
sound.tones(tones);
|
||||
}
|
||||
void sound_no_tone()
|
||||
{
|
||||
sound.noTone();
|
||||
}
|
||||
bool sound_playing()
|
||||
{
|
||||
sound.playing();
|
||||
}
|
||||
void sound_tones_in_ram(uint16_t *tones)
|
||||
{
|
||||
sound.tonesInRAM(tones);
|
||||
}
|
||||
void sound_volume_mode(uint8_t mode)
|
||||
{
|
||||
sound.volumeMode(mode);
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
#include "sprites.h"
|
||||
|
||||
void arduino_draw_override(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame)
|
||||
{
|
||||
Sprites::drawOverwrite(x, y, bitmap, frame);
|
||||
}
|
||||
void arduino_draw_external_mask(int16_t x, int16_t y, const uint8_t *bitmap,
|
||||
const uint8_t *mask, uint8_t frame, uint8_t mask_frame)
|
||||
{
|
||||
Sprites::drawExternalMask(x, y, bitmap, mask, frame, mask_frame);
|
||||
}
|
||||
void arduino_draw_plus_mask(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame)
|
||||
{
|
||||
Sprites::drawPlusMask(x, y, bitmap, frame);
|
||||
}
|
||||
void arduino_draw_erase(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame)
|
||||
{
|
||||
Sprites::drawErase(x, y, bitmap, frame);
|
||||
}
|
||||
void arduino_draw_self_masked(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame)
|
||||
{
|
||||
Sprites::drawSelfMasked(x, y, bitmap, frame);
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
#pragma once
|
||||
#include <Sprites.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void arduino_draw_override(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame);
|
||||
void arduino_draw_external_mask(int16_t x, int16_t y, const uint8_t *bitmap,
|
||||
const uint8_t *mask, uint8_t frame, uint8_t mask_frame);
|
||||
void arduino_draw_plus_mask(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame);
|
||||
void arduino_draw_erase(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame);
|
||||
void arduino_draw_self_masked(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame);
|
||||
}
|
27
Wrapper-Project/src/library/arduboy/sprites_export.h
Normal file
27
Wrapper-Project/src/library/arduboy/sprites_export.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
#pragma once
|
||||
#include <Sprites.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void arduino_draw_override(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame)
|
||||
{
|
||||
Sprites::drawOverwrite(x, y, bitmap, frame);
|
||||
}
|
||||
void arduino_draw_external_mask(int16_t x, int16_t y, const uint8_t *bitmap,
|
||||
const uint8_t *mask, uint8_t frame, uint8_t mask_frame)
|
||||
{
|
||||
Sprites::drawExternalMask(x, y, bitmap, mask, frame, mask_frame);
|
||||
}
|
||||
void arduino_draw_plus_mask(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame)
|
||||
{
|
||||
Sprites::drawPlusMask(x, y, bitmap, frame);
|
||||
}
|
||||
void arduino_draw_erase(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame)
|
||||
{
|
||||
Sprites::drawErase(x, y, bitmap, frame);
|
||||
}
|
||||
void arduino_draw_self_masked(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame)
|
||||
{
|
||||
Sprites::drawSelfMasked(x, y, bitmap, frame);
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
#include "arduino.h"
|
||||
|
||||
long arduino_random_between(long min, long max)
|
||||
{
|
||||
return random(min, max);
|
||||
}
|
||||
long arduino_random_less_than(long max)
|
||||
{
|
||||
return random(max);
|
||||
}
|
||||
void arduino_delay(unsigned long ms)
|
||||
{
|
||||
delay(ms);
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
#pragma once
|
||||
#include <Arduboy2.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
long arduino_random_between(long min, long max);
|
||||
long arduino_random_less_than(long max);
|
||||
void arduino_delay(unsigned long ms);
|
||||
}
|
18
Wrapper-Project/src/library/arduino/arduino_export.h
Normal file
18
Wrapper-Project/src/library/arduino/arduino_export.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
#pragma once
|
||||
#include <Arduboy2.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
long arduino_random_between(long min, long max)
|
||||
{
|
||||
return random(min, max);
|
||||
}
|
||||
long arduino_random_less_than(long max)
|
||||
{
|
||||
return random(max);
|
||||
}
|
||||
void arduino_delay(unsigned long ms)
|
||||
{
|
||||
delay(ms);
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
#include "eeprom.h"
|
||||
|
||||
int eeprom;
|
||||
|
||||
uint8_t arduboy_eeprom_read(int idx)
|
||||
{
|
||||
eeprom = EEPROM.read(idx);
|
||||
return eeprom;
|
||||
}
|
||||
void arduboy_eeprom_update(int idx, uint8_t val)
|
||||
{
|
||||
EEPROM.update(idx, val);
|
||||
}
|
||||
void arduboy_eeprom_write(int idx, uint8_t val)
|
||||
{
|
||||
EEPROM.write(idx, val);
|
||||
}
|
||||
uint8_t arduboy_eeprom_get(int idx)
|
||||
{
|
||||
EEPROM.get(idx, eeprom);
|
||||
return eeprom;
|
||||
}
|
||||
void arduboy_eeprom_put(int idx, uint8_t val)
|
||||
{
|
||||
EEPROM.put(idx, val);
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <EEPROM.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
uint8_t arduboy_eeprom_read(int idx);
|
||||
void arduboy_eeprom_update(int idx, uint8_t val);
|
||||
void arduboy_eeprom_write(int idx, uint8_t val);
|
||||
uint8_t arduboy_eeprom_get(int idx);
|
||||
void arduboy_eeprom_put(int idx, uint8_t val);
|
||||
}
|
26
Wrapper-Project/src/library/arduino/eeprom_export.h
Normal file
26
Wrapper-Project/src/library/arduino/eeprom_export.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
#include <avr/eeprom.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
uint8_t arduboy_eeprom_read(int idx)
|
||||
{
|
||||
return eeprom_read_byte(reinterpret_cast<const uint8_t *>(idx));
|
||||
}
|
||||
void arduboy_eeprom_update(int idx, uint8_t val)
|
||||
{
|
||||
eeprom_update_byte(reinterpret_cast<uint8_t *>(idx), val);
|
||||
}
|
||||
void arduboy_eeprom_write(int idx, uint8_t val)
|
||||
{
|
||||
eeprom_write_byte(reinterpret_cast<uint8_t *>(idx), val);
|
||||
}
|
||||
void arduboy_eeprom_get(uint16_t address, uint8_t *object, size_t size)
|
||||
{
|
||||
eeprom_read_block(object, reinterpret_cast<const uint8_t *>(address), size);
|
||||
}
|
||||
void arduboy_eeprom_put(uint16_t address, const uint8_t *object, size_t size)
|
||||
{
|
||||
eeprom_update_block(object, reinterpret_cast<uint8_t *>(address), size);
|
||||
}
|
||||
}
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
#include <Arduboy2.h>
|
||||
#include <ArduboyTones.h>
|
||||
#include "./library/arduboy/arduboy.h"
|
||||
#include "./library/arduboy/sprites.h"
|
||||
#include "./library/arduboy/arduboy_tones.h"
|
||||
#include "./library/arduino/arduino.h"
|
||||
#include "./library/arduino/eeprom.h"
|
||||
#include "./library/arduboy/arduboy_export.h"
|
||||
#include "./library/arduboy/sprites_export.h"
|
||||
#include "./library/arduboy/arduboy_tones_export.h"
|
||||
#include "./library/arduino/arduino_export.h"
|
||||
#include "./library/arduino/eeprom_export.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue