aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-11-10 21:34:40 -0700
committerSelene ToyKeeper2023-11-10 21:34:40 -0700
commit3d12b7066d27b591e0283e20ed066bc66e29fbe4 (patch)
tree08a0ed41a4b0baa7f7f5ea4eed6ee10ac250250c /ui
parentadded md5sum to build-all.sh output per target (diff)
downloadanduril-3d12b7066d27b591e0283e20ed066bc66e29fbe4.tar.gz
anduril-3d12b7066d27b591e0283e20ed066bc66e29fbe4.tar.bz2
anduril-3d12b7066d27b591e0283e20ed066bc66e29fbe4.zip
refactor checkpoint: splitting MCU-specific code into arch/$MCU.[ch]
Phew, that's a lot of changes! And there's still a lot more to do...
Diffstat (limited to '')
-rw-r--r--ui/anduril/anduril.c18
-rw-r--r--ui/anduril/config-default.h6
2 files changed, 14 insertions, 10 deletions
diff --git a/ui/anduril/anduril.c b/ui/anduril/anduril.c
index e72c3b5..c434518 100644
--- a/ui/anduril/anduril.c
+++ b/ui/anduril/anduril.c
@@ -34,16 +34,19 @@
* as possible. These are mostly "USE" flags.
*/
+/********* load up MCU info, like ROM size and such *********/
+#include "arch/mcu.h"
+
/********* User-configurable options *********/
#include "anduril/config-default.h"
/********* specific settings for known driver types *********/
-// Anduril config file name (set it here or define it at the gcc command line)
-//#define CFG_H cfg-blf-q8.h
-#include "fsm/tk.h"
#include incfile(CFG_H)
+#ifdef HWDEF_H
+#include incfile(HWDEF_H)
+#endif
/********* Include headers which need to be before FSM *********/
@@ -77,11 +80,12 @@
#include "fsm/spaghetti-monster.h"
/********* does this build target have special code to include? *********/
-#ifdef HWDEF_C_FILE
-#include incfile(HWDEF_C_FILE)
+#ifdef CFG_C
+#include incfile(CFG_C)
#endif
-#ifdef CFG_C_FILE
-#include incfile(CFG_C_FILE)
+
+#ifdef HWDEF_C
+#include incfile(HWDEF_C)
#endif
diff --git a/ui/anduril/config-default.h b/ui/anduril/config-default.h
index 899bc4a..04fc956 100644
--- a/ui/anduril/config-default.h
+++ b/ui/anduril/config-default.h
@@ -20,7 +20,7 @@
// overheat protection
#define USE_THERMAL_REGULATION
-#if (ATTINY==85) || (ATTINY==1634)
+#if (MCU==0x85) || (MCU==0x1634)
// sloppy temperature sensor needs bigger error margin
#define DEFAULT_THERM_CEIL 45 // try not to get hotter than this (in C)
#else
@@ -185,7 +185,7 @@
// if the aux LEDs oscillate between "full battery" and "empty battery"
// while in "voltage" mode, enable this to reduce the amplitude of
// those oscillations
-#if (ATTINY==1616) || (ATTINY==1634)
+#if (ROM_SIZE > 10000)
#define USE_LOWPASS_WHILE_ASLEEP
#endif
@@ -195,7 +195,7 @@
// Use "smooth steps" to soften on/off and step changes
// on MCUs with enough room for extra stuff like this
-#if (ATTINY==1616) || (ATTINY==1634)
+#if (ROM_SIZE > 10000)
#define USE_SMOOTH_STEPS
#endif
// 0 = none, 1 = smooth, 2+ = undefined
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.