From 15d5b2cbe807029c7493691a1877a1898d100455 Mon Sep 17 00:00:00 2001
From: Selene ToyKeeper
Date: Wed, 30 Aug 2017 23:07:55 -0600
Subject: Replaced FSM_*_LAYOUT with FSM_*_DRIVER because I think it makes more
sense. Made momentary.c compile again. Updated fsm-main to use whichever
delay function is available.
---
spaghetti-monster/anduril.c | 2 +-
spaghetti-monster/baton.c | 2 +-
spaghetti-monster/darkhorse.c | 2 +-
spaghetti-monster/fsm-main.c | 4 ++++
spaghetti-monster/momentary.c | 3 ++-
spaghetti-monster/ramping-ui.c | 2 +-
tk-attiny.h | 22 +++++++++++-----------
7 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/spaghetti-monster/anduril.c b/spaghetti-monster/anduril.c
index 6c21bf3..998c0c5 100644
--- a/spaghetti-monster/anduril.c
+++ b/spaghetti-monster/anduril.c
@@ -18,7 +18,7 @@
* along with this program. If not, see .
*/
-#define FSM_EMISAR_D4_LAYOUT
+#define FSM_EMISAR_D4_DRIVER
#define USE_LVP
#define USE_THERMAL_REGULATION
#define DEFAULT_THERM_CEIL 45
diff --git a/spaghetti-monster/baton.c b/spaghetti-monster/baton.c
index 2489f4e..4ba329e 100644
--- a/spaghetti-monster/baton.c
+++ b/spaghetti-monster/baton.c
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-#define FSM_EMISAR_D4_LAYOUT
+#define FSM_EMISAR_D4_DRIVER
#define USE_LVP
#define USE_THERMAL_REGULATION
#define DEFAULT_THERM_CEIL 45
diff --git a/spaghetti-monster/darkhorse.c b/spaghetti-monster/darkhorse.c
index 2aa1b7b..2aa3e90 100644
--- a/spaghetti-monster/darkhorse.c
+++ b/spaghetti-monster/darkhorse.c
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-#define FSM_EMISAR_D4_LAYOUT
+#define FSM_EMISAR_D4_DRIVER
#define USE_LVP
#define USE_THERMAL_REGULATION
#define DEFAULT_THERM_CEIL 45
diff --git a/spaghetti-monster/fsm-main.c b/spaghetti-monster/fsm-main.c
index ae63126..9505322 100644
--- a/spaghetti-monster/fsm-main.c
+++ b/spaghetti-monster/fsm-main.c
@@ -89,7 +89,11 @@ int main() {
push_state(default_state, 0);
// in case any spurious button presses were detected at boot
+ #ifdef USE_DELAY_MS
delay_ms(1);
+ #else
+ delay_4ms(1);
+ #endif
empty_event_sequence();
// call recipe's setup
diff --git a/spaghetti-monster/momentary.c b/spaghetti-monster/momentary.c
index fc26db3..6b049f4 100644
--- a/spaghetti-monster/momentary.c
+++ b/spaghetti-monster/momentary.c
@@ -19,9 +19,10 @@
* along with this program. If not, see .
*/
-#define FSM_EMISAR_D4_LAYOUT
+#define FSM_EMISAR_D4_DRIVER
#define USE_LVP
#define USE_DEBUG_BLINK
+#define USE_DELAY_4MS
#include "spaghetti-monster.h"
volatile uint8_t brightness;
diff --git a/spaghetti-monster/ramping-ui.c b/spaghetti-monster/ramping-ui.c
index 2369686..527a824 100644
--- a/spaghetti-monster/ramping-ui.c
+++ b/spaghetti-monster/ramping-ui.c
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-#define FSM_EMISAR_D4_LAYOUT
+#define FSM_EMISAR_D4_DRIVER
#define USE_LVP
#define USE_THERMAL_REGULATION
#define DEFAULT_THERM_CEIL 32
diff --git a/tk-attiny.h b/tk-attiny.h
index 2cfe4fd..7939ccc 100644
--- a/tk-attiny.h
+++ b/tk-attiny.h
@@ -59,7 +59,7 @@
/******************** I/O pin and register layout ************************/
#ifdef FET_7135_LAYOUT
-#define LAYOUT_DEFINED
+#define DRIVER_TYPE_DEFINED
/*
* ----
* Reset -|1 8|- VCC
@@ -95,7 +95,7 @@
#endif // FET_7135_LAYOUT
#ifdef TRIPLEDOWN_LAYOUT
-#define LAYOUT_DEFINED
+#define DRIVER_TYPE_DEFINED
/*
* ----
* Reset -|1 8|- VCC
@@ -132,7 +132,7 @@
#endif // TRIPLEDOWN_LAYOUT
#ifdef FERRERO_ROCHER_LAYOUT
-#define LAYOUT_DEFINED
+#define DRIVER_TYPE_DEFINED
/*
* ----
* Reset -|1 8|- VCC
@@ -147,7 +147,7 @@
#endif // FERRERO_ROCHER_LAYOUT
#ifdef NANJG_LAYOUT
-#define LAYOUT_DEFINED
+#define DRIVER_TYPE_DEFINED
#define STAR2_PIN PB0
#define STAR3_PIN PB4
#define STAR4_PIN PB3
@@ -165,8 +165,8 @@
#endif // NANJG_LAYOUT
-#ifdef FSM_EMISAR_D4_LAYOUT
-#define LAYOUT_DEFINED
+#ifdef FSM_EMISAR_D4_DRIVER
+#define DRIVER_TYPE_DEFINED
/*
* ----
* Reset -|1 8|- VCC
@@ -199,11 +199,11 @@
#define FAST 0xA3 // fast PWM both channels
#define PHASE 0xA1 // phase-correct PWM both channels
-#endif
+#endif // ifdef FSM_EMISAR_D4_DRIVER
-#ifdef FSM_TKSABER_LAYOUT
-#define LAYOUT_DEFINED
+#ifdef FSM_TKSABER_DRIVER
+#define DRIVER_TYPE_DEFINED
/*
* ----
* Reset -|1 8|- VCC
@@ -233,10 +233,10 @@
#define FAST 0xA3 // fast PWM both channels
#define PHASE 0xA1 // phase-correct PWM both channels
-#endif // TKSABER_LAYOUT
+#endif // TKSABER_DRIVER
-#ifndef LAYOUT_DEFINED
+#ifndef DRIVER_TYPE_DEFINED
#error Hey, you need to define an I/O pin layout.
#endif
--
cgit v1.2.3