aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/werner
diff options
context:
space:
mode:
authorSelene ToyKeeper2018-12-18 14:59:40 -0700
committerSelene ToyKeeper2018-12-18 14:59:40 -0700
commitf144b83fbbd2c6a36600ed27291d0816543df34b (patch)
tree37e043ec7a083ddbfbffb35844279318afc6dddb /spaghetti-monster/werner
parentReworked the config file include system so it'll include the #defined value (diff)
downloadanduril-f144b83fbbd2c6a36600ed27291d0816543df34b.tar.gz
anduril-f144b83fbbd2c6a36600ed27291d0816543df34b.tar.bz2
anduril-f144b83fbbd2c6a36600ed27291d0816543df34b.zip
Updated the rest of the FSM interfaces to use the new config file system.
Diffstat (limited to 'spaghetti-monster/werner')
-rwxr-xr-xspaghetti-monster/werner/build-all.sh18
-rw-r--r--spaghetti-monster/werner/werner.c23
2 files changed, 12 insertions, 29 deletions
diff --git a/spaghetti-monster/werner/build-all.sh b/spaghetti-monster/werner/build-all.sh
index 43879bb..87d4f0d 100755
--- a/spaghetti-monster/werner/build-all.sh
+++ b/spaghetti-monster/werner/build-all.sh
@@ -4,16 +4,10 @@ cp -av ../anduril/cfg*.h .
UI=werner
-for TARGET in \
- BLF_GT \
- BLF_Q8 \
- EMISAR_D1 \
- EMISAR_D1S \
- EMISAR_D4 \
- EMISAR_D4S \
- FW3A \
- ; do
- echo "===== $TARGET ====="
- ../../../bin/build.sh 85 "$UI" "-DFSM_${TARGET}_DRIVER"
- mv -f "$UI".hex "$UI".$TARGET.hex
+for TARGET in cfg-*.h ; do
+ NAME=$(echo "$TARGET" | perl -ne '/cfg-(.*).h/ && print "$1\n";')
+ echo "===== $NAME ====="
+ echo ../../../bin/build.sh 85 "$UI" "-DCONFIGFILE=${TARGET}"
+ ../../../bin/build.sh 85 "$UI" "-DCONFIGFILE=${TARGET}"
+ mv -f "$UI".hex "$UI".$NAME.hex
done
diff --git a/spaghetti-monster/werner/werner.c b/spaghetti-monster/werner/werner.c
index b6cdf12..7c47cd7 100644
--- a/spaghetti-monster/werner/werner.c
+++ b/spaghetti-monster/werner/werner.c
@@ -20,10 +20,7 @@
/********* User-configurable options *********/
// Physical driver type (uncomment one of the following or define it at the gcc command line)
-//#define FSM_EMISAR_D4_DRIVER
-//#define FSM_BLF_Q8_DRIVER
-//#define FSM_FW3A_DRIVER
-//#define FSM_BLF_GT_DRIVER
+//#define CONFIGFILE cfg-emisar-d4.h
#define USE_LVP // FIXME: won't build when this option is turned off
@@ -37,21 +34,13 @@
//#define BATTCHECK_4bars // FIXME: breaks build
/***** specific settings for known driver types *****/
-#if defined(FSM_BLF_GT_DRIVER)
-#include "cfg-blf-gt.h"
-
-#elif defined(FSM_BLF_Q8_DRIVER)
-#include "cfg-blf-q8.h"
-
-#elif defined(FSM_EMISAR_D4_DRIVER)
-#include "cfg-emisar-d4.h"
-
-#elif defined(FSM_FW3A_DRIVER)
-#include "cfg-fw3a.h"
-
+#ifdef CONFIGFILE
+#include "tk.h"
+#include incfile(CONFIGFILE)
+#else
+#error You need to define CONFIGFILE
#endif
-
// thermal properties, if not defined per-driver
#ifndef MIN_THERM_STEPDOWN
#define MIN_THERM_STEPDOWN MAX_1x7135 // lowest value it'll step down to
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.