aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
authorSelene ToyKeeper2017-12-03 17:22:01 -0700
committerSelene ToyKeeper2017-12-03 17:22:01 -0700
commit9fbfa14e63a6b7f8e495ca4cf1f7b82c2e638215 (patch)
tree9c02e7debdf4d8143c37283a8090a16d4aa63ae4 /spaghetti-monster
parentAdded a candle flicker mode to Anduril. Easy to enable/disable at compile time. (diff)
downloadanduril-9fbfa14e63a6b7f8e495ca4cf1f7b82c2e638215.tar.gz
anduril-9fbfa14e63a6b7f8e495ca4cf1f7b82c2e638215.tar.bz2
anduril-9fbfa14e63a6b7f8e495ca4cf1f7b82c2e638215.zip
Made it possible to override address of eeprom array in RAM.
(useful when trying to use a single large data structure without wasting twice its size in RAM)
Diffstat (limited to 'spaghetti-monster')
-rw-r--r--spaghetti-monster/fsm-eeprom.c4
-rw-r--r--spaghetti-monster/fsm-eeprom.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/spaghetti-monster/fsm-eeprom.c b/spaghetti-monster/fsm-eeprom.c
index 012e088..bb63c7e 100644
--- a/spaghetti-monster/fsm-eeprom.c
+++ b/spaghetti-monster/fsm-eeprom.c
@@ -23,7 +23,11 @@
#include "fsm-eeprom.h"
#if EEPROM_BYTES > 0
+#ifdef EEPROM_OVERRIDE
+uint8_t *eeprom;
+#else
uint8_t eeprom[EEPROM_BYTES];
+#endif
uint8_t load_eeprom() {
cli();
diff --git a/spaghetti-monster/fsm-eeprom.h b/spaghetti-monster/fsm-eeprom.h
index b6e1aea..a668588 100644
--- a/spaghetti-monster/fsm-eeprom.h
+++ b/spaghetti-monster/fsm-eeprom.h
@@ -36,7 +36,11 @@
#if EEPROM_BYTES >= (EEPSIZE/2)
#error Requested EEPROM_BYTES too big.
#endif
+#ifdef EEPROM_OVERRIDE
+uint8_t *eeprom;
+#else
uint8_t eeprom[EEPROM_BYTES];
+#endif
uint8_t load_eeprom(); // returns 1 for success, 0 for no data found
void save_eeprom();
#define EEP_START (EEPSIZE/2)
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.