aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
authorSelene ToyKeeper2017-09-28 16:08:27 -0600
committerSelene ToyKeeper2017-09-28 16:08:27 -0600
commit3507d67ee4499a56fb5a38723c00486b19b70c45 (patch)
tree7c1d0ad6075962665bfeabc525b560df35cf2f78 /spaghetti-monster
parentAdjusted bike flasher floor and ceiling: (diff)
downloadanduril-3507d67ee4499a56fb5a38723c00486b19b70c45.tar.gz
anduril-3507d67ee4499a56fb5a38723c00486b19b70c45.tar.bz2
anduril-3507d67ee4499a56fb5a38723c00486b19b70c45.zip
Fleshed out options to blink at floor, ceiling, and channel boundaries.
Diffstat (limited to 'spaghetti-monster')
-rw-r--r--spaghetti-monster/anduril/anduril.c50
1 files changed, 32 insertions, 18 deletions
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index 5a6b6e0..a47e284 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -28,8 +28,9 @@
#define USE_SET_LEVEL_GRADUALLY
#define RAMP_LENGTH 150
#define MAX_BIKING_LEVEL 120 // should be 127 or less
-#define BLINK_AT_RAMP_BOUNDARIES
+#define BLINK_AT_CHANNEL_BOUNDARIES
//#define BLINK_AT_RAMP_FLOOR
+#define BLINK_AT_RAMP_CEILING
#define USE_BATTCHECK
#define BATTCHECK_VpT
#define MAX_CLICKS 5
@@ -289,14 +290,22 @@ uint8_t steady_state(EventPtr event, uint16_t arg) {
#ifdef USE_THERMAL_REGULATION
target_level = memorized_level;
#endif
- #ifdef BLINK_AT_RAMP_BOUNDARIES
+ #if defined(BLINK_AT_RAMP_CEILING) || defined(BLINK_AT_CHANNEL_BOUNDARIES)
// only blink once for each threshold
- if ((memorized_level != actual_level)
- && ((memorized_level == MAX_1x7135)
- #if PWM_CHANNELS >= 3
- || (memorized_level == MAX_Nx7135)
- #endif
- || (memorized_level == mode_max))) {
+ if ((memorized_level != actual_level) && (
+ #ifdef BLINK_AT_CHANNEL_BOUNDARIES
+ (memorized_level == MAX_1x7135)
+ #if PWM_CHANNELS >= 3
+ || (memorized_level == MAX_Nx7135)
+ #endif
+ #ifdef BLINK_AT_RAMP_CEILING
+ ||
+ #endif
+ #endif
+ #ifdef BLINK_AT_RAMP_CEILING
+ (memorized_level == mode_max)
+ #endif
+ )) {
set_level(0);
delay_4ms(8/4);
}
@@ -315,17 +324,22 @@ uint8_t steady_state(EventPtr event, uint16_t arg) {
#ifdef USE_THERMAL_REGULATION
target_level = memorized_level;
#endif
- #ifdef BLINK_AT_RAMP_BOUNDARIES
+ #if defined(BLINK_AT_RAMP_FLOOR) || defined(BLINK_AT_CHANNEL_BOUNDARIES)
// only blink once for each threshold
- if ((memorized_level != actual_level)
- && ((memorized_level == MAX_1x7135)
- #if PWM_CHANNELS >= 3
- || (memorized_level == MAX_Nx7135)
- #endif
- #ifdef BLINK_AT_RAMP_FLOOR
- || (memorized_level == mode_min)
- #endif
- )) {
+ if ((memorized_level != actual_level) && (
+ #ifdef BLINK_AT_CHANNEL_BOUNDARIES
+ (memorized_level == MAX_1x7135)
+ #if PWM_CHANNELS >= 3
+ || (memorized_level == MAX_Nx7135)
+ #endif
+ #ifdef BLINK_AT_RAMP_FLOOR
+ ||
+ #endif
+ #endif
+ #ifdef BLINK_AT_RAMP_FLOOR
+ (memorized_level == mode_min)
+ #endif
+ )) {
set_level(0);
delay_4ms(8/4);
}
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.