aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
authorSelene ToyKeeper2018-09-13 04:49:50 -0600
committerSelene ToyKeeper2018-09-13 04:49:50 -0600
commitb6adac8b6b949f2f573f18063858a0728df39f02 (patch)
tree91f6fa574f01ba636fc1d30b53015d065ef92061 /spaghetti-monster
parentfixed tint ramp brightness being off by one level, (diff)
downloadanduril-b6adac8b6b949f2f573f18063858a0728df39f02.tar.gz
anduril-b6adac8b6b949f2f573f18063858a0728df39f02.tar.bz2
anduril-b6adac8b6b949f2f573f18063858a0728df39f02.zip
ramp tint faster, remember after battery change
also, fixed typo while setting default ramp values
Diffstat (limited to 'spaghetti-monster')
-rw-r--r--spaghetti-monster/anduril/anduril.c15
-rw-r--r--spaghetti-monster/anduril/cfg-blf-lantern.h4
2 files changed, 15 insertions, 4 deletions
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index 250e3d7..7217f87 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -158,6 +158,9 @@ typedef enum {
ramp_discrete_floor_e,
ramp_discrete_ceil_e,
ramp_discrete_steps_e,
+ #ifdef USE_TINT_RAMPING
+ tint_e,
+ #endif
#ifdef USE_STROBE_STATE
strobe_type_e,
#endif
@@ -797,7 +800,7 @@ uint8_t tint_ramping_state(EventPtr event, uint16_t arg) {
// click, click, hold: change the tint
if (event == EV_click3_hold) {
- if ((arg & 1) == 0) { // ramp slower
+ //if ((arg & 1) == 0) { // ramp slower
if ((tint_ramp_direction > 0) && (tint < 255)) {
tint += 1;
}
@@ -805,7 +808,7 @@ uint8_t tint_ramping_state(EventPtr event, uint16_t arg) {
tint -= 1;
}
set_level(actual_level);
- }
+ //}
return EVENT_HANDLED;
}
@@ -814,6 +817,8 @@ uint8_t tint_ramping_state(EventPtr event, uint16_t arg) {
tint_ramp_direction = -tint_ramp_direction;
if (tint == 0) tint_ramp_direction = 1;
else if (tint == 255) tint_ramp_direction = -1;
+ // remember tint after battery change
+ save_config();
return EVENT_HANDLED;
}
@@ -1696,6 +1701,9 @@ void load_config() {
ramp_discrete_floor = eeprom[ramp_discrete_floor_e];
ramp_discrete_ceil = eeprom[ramp_discrete_ceil_e];
ramp_discrete_steps = eeprom[ramp_discrete_steps_e];
+ #ifdef USE_TINT_RAMPING
+ tint = eeprom[tint_e];
+ #endif
#if defined(USE_PARTY_STROBE_MODE) || defined(USE_TACTICAL_STROBE_MODE)
strobe_type = eeprom[strobe_type_e]; // TODO: move this to eeprom_wl?
strobe_delays[0] = eeprom[strobe_delays_0_e];
@@ -1730,6 +1738,9 @@ void save_config() {
eeprom[ramp_discrete_floor_e] = ramp_discrete_floor;
eeprom[ramp_discrete_ceil_e] = ramp_discrete_ceil;
eeprom[ramp_discrete_steps_e] = ramp_discrete_steps;
+ #ifdef USE_TINT_RAMPING
+ eeprom[tint_e] = tint;
+ #endif
#if defined(USE_PARTY_STROBE_MODE) || defined(USE_TACTICAL_STROBE_MODE)
eeprom[strobe_type_e] = strobe_type; // TODO: move this to eeprom_wl?
eeprom[strobe_delays_0_e] = strobe_delays[0];
diff --git a/spaghetti-monster/anduril/cfg-blf-lantern.h b/spaghetti-monster/anduril/cfg-blf-lantern.h
index 05b89ca..709bca9 100644
--- a/spaghetti-monster/anduril/cfg-blf-lantern.h
+++ b/spaghetti-monster/anduril/cfg-blf-lantern.h
@@ -29,9 +29,9 @@
// set floor and ceiling as far apart as possible
// because this lantern isn't overpowered
#define RAMP_SMOOTH_FLOOR 1
-#define RAMP_SMOOTH_CEILING 150
+#define RAMP_SMOOTH_CEIL 150
#define RAMP_DISCRETE_FLOOR RAMP_SMOOTH_FLOOR
-#define RAMP_DISCRETE_CEILING RAMP_SMOOTH_CEILING
+#define RAMP_DISCRETE_CEIL RAMP_SMOOTH_CEIL
// the sensor (attiny85) is nowhere near the emitters
// so thermal regulation can't work
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.