From 992627373f3e41e2b8909f459a8119f133cecbfd Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sat, 29 Sep 2018 00:52:55 -0600 Subject: Fixed ramp style toggle going to the wrong level when at moon. --- spaghetti-monster/anduril/anduril.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index c8517af..fdbc7d5 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -524,7 +524,7 @@ uint8_t steady_state(EventPtr event, uint16_t arg) { // 3 clicks: toggle smooth vs discrete ramping else if (event == EV_3clicks) { ramp_style = !ramp_style; - memorized_level = nearest_level(memorized_level); + memorized_level = nearest_level(actual_level); #ifdef USE_THERMAL_REGULATION target_level = memorized_level; #ifdef USE_SET_LEVEL_GRADUALLY -- cgit v1.2.3 From 43e6a6610f750937debcd962f36bbcc833cd0e65 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sat, 29 Sep 2018 00:55:30 -0600 Subject: Added MOON_TIMING_HINT, made stepped ramp initial timing the same as smooth ramp. (previously, smooth ramp took 2 timeouts before ramping while stepped took 3) (now both are 2) --- spaghetti-monster/anduril/anduril.c | 16 +++++++++++++++- spaghetti-monster/anduril/build-all.sh | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index fdbc7d5..5547047 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -37,6 +37,10 @@ #define USE_THERMAL_REGULATION #define DEFAULT_THERM_CEIL 45 // try not to get hotter than this +// short blip when crossing from "click" to "hold" from off +// (helps the user hit moon mode exactly, instead of holding too long +// or too short) +#define MOON_TIMING_HINT // short blips while ramping #define BLINK_AT_CHANNEL_BOUNDARIES //#define BLINK_AT_RAMP_FLOOR @@ -392,9 +396,19 @@ uint8_t off_state(EventPtr event, uint16_t arg) { } // hold: go to lowest level else if (event == EV_click1_hold) { + #ifdef MOON_TIMING_HINT + if (arg == 0) { + // let the user know they can let go now to stay at moon + uint8_t temp = actual_level; + set_level(0); + delay_4ms(2); + set_level(temp); + } else + #endif // don't start ramping immediately; // give the user time to release at moon level - if (arg >= HOLD_TIMEOUT) { + //if (arg >= HOLD_TIMEOUT) { // smaller + if (arg >= (!ramp_style) * HOLD_TIMEOUT) { // more consistent set_state(steady_state, 1); } return MISCHIEF_MANAGED; diff --git a/spaghetti-monster/anduril/build-all.sh b/spaghetti-monster/anduril/build-all.sh index 794b285..a4fe894 100755 --- a/spaghetti-monster/anduril/build-all.sh +++ b/spaghetti-monster/anduril/build-all.sh @@ -9,6 +9,7 @@ for TARGET in \ EMISAR_D1 \ EMISAR_D1S \ EMISAR_D4 \ + EMISAR_D4_219c \ EMISAR_D4S \ EMISAR_D4S_219c \ FF_ROT66 \ -- cgit v1.2.3 From 0f8411f4ae3b3161e85be335f82c9893d084bb9b Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sat, 29 Sep 2018 01:06:54 -0600 Subject: Added D4-219C build target. Cleaned up D4S definitions a little. --- spaghetti-monster/anduril/anduril.c | 8 ++++++-- spaghetti-monster/anduril/build-all.sh | 4 ++-- spaghetti-monster/anduril/cfg-emisar-d4-219c.h | 8 ++++++++ spaghetti-monster/anduril/cfg-emisar-d4s-219c.h | 5 ++--- spaghetti-monster/anduril/cfg-emisar-d4s.h | 11 ----------- 5 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 spaghetti-monster/anduril/cfg-emisar-d4-219c.h (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index 5547047..c98026f 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -26,8 +26,9 @@ //#define FSM_EMISAR_D1_DRIVER //#define FSM_EMISAR_D1S_DRIVER //#define FSM_EMISAR_D4_DRIVER +//#define FSM_EMISAR_D4_219C_DRIVER //#define FSM_EMISAR_D4S_DRIVER -//#define FSM_EMISAR_D4S_219c_DRIVER +//#define FSM_EMISAR_D4S_219C_DRIVER //#define FSM_FF_ROT66_DRIVER //#define FSM_FW3A_DRIVER @@ -88,10 +89,13 @@ #elif defined(FSM_EMISAR_D1S_DRIVER) #include "cfg-emisar-d1s.h" +#elif defined(FSM_EMISAR_D4_219C_DRIVER) +#include "cfg-emisar-d4-219c.h" + #elif defined(FSM_EMISAR_D4_DRIVER) #include "cfg-emisar-d4.h" -#elif defined(FSM_EMISAR_D4S_219c_DRIVER) +#elif defined(FSM_EMISAR_D4S_219C_DRIVER) #include "cfg-emisar-d4s-219c.h" #elif defined(FSM_EMISAR_D4S_DRIVER) diff --git a/spaghetti-monster/anduril/build-all.sh b/spaghetti-monster/anduril/build-all.sh index a4fe894..a8bb397 100755 --- a/spaghetti-monster/anduril/build-all.sh +++ b/spaghetti-monster/anduril/build-all.sh @@ -9,9 +9,9 @@ for TARGET in \ EMISAR_D1 \ EMISAR_D1S \ EMISAR_D4 \ - EMISAR_D4_219c \ + EMISAR_D4_219C \ EMISAR_D4S \ - EMISAR_D4S_219c \ + EMISAR_D4S_219C \ FF_ROT66 \ FW3A \ ; do diff --git a/spaghetti-monster/anduril/cfg-emisar-d4-219c.h b/spaghetti-monster/anduril/cfg-emisar-d4-219c.h new file mode 100644 index 0000000..55ae1eb --- /dev/null +++ b/spaghetti-monster/anduril/cfg-emisar-d4-219c.h @@ -0,0 +1,8 @@ +// Emisar D4-219C config options for Anduril +// same as D4S but with FET modes limited to 80% power +// to avoid destroying the LEDs +#define FSM_EMISAR_D4_DRIVER +#include "cfg-emisar-d4.h" + +#undef PWM2_LEVELS +#define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,4,5,6,7,8,9,11,12,13,15,16,17,19,20,21,23,24,26,28,29,31,32,34,36,38,40,41,44,45,47,49,51,53,56,57,60,62,64,67,69,72,74,76,79,81,84,87,89,92,95,97,100,103,106,109,112,115,118,121,124,128,132,135,138,141,145,148,152,156,160,164,167,171,175,179,183,187,191,195,200,204 diff --git a/spaghetti-monster/anduril/cfg-emisar-d4s-219c.h b/spaghetti-monster/anduril/cfg-emisar-d4s-219c.h index a98f123..c02274d 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d4s-219c.h +++ b/spaghetti-monster/anduril/cfg-emisar-d4s-219c.h @@ -1,9 +1,8 @@ -// Emisar D4S-219c config options for Anduril +// Emisar D4S-219C config options for Anduril // same as D4S but with FET modes limited to 80% power // to avoid destroying the LEDs #define FSM_EMISAR_D4S_DRIVER #include "cfg-emisar-d4s.h" #undef PWM2_LEVELS -#define PWM2_LEVELS PWM2_LEVELS_219c - +#define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,4,5,6,8,8,10,11,12,14,15,16,18,20,21,23,24,27,28,30,32,34,36,38,40,43,45,48,50,52,55,57,60,63,66,69,72,76,79,82,85,89,92,96,100,104,108,112,116,121,126,130,135,140,145,150,156,161,167,172,178,184,191,197,204 diff --git a/spaghetti-monster/anduril/cfg-emisar-d4s.h b/spaghetti-monster/anduril/cfg-emisar-d4s.h index df2f019..ef55668 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d4s.h +++ b/spaghetti-monster/anduril/cfg-emisar-d4s.h @@ -16,25 +16,14 @@ #define RAMP_LENGTH 150 // 3x7135 + FET -#if 0 // first attempt -// ../../bin/level_calc.py 2 150 7135 1 6 450 FET 1 10 1810 -// (because it made the ramp look better than accurate values) -#define PWM1_LEVELS 1,1,2,2,3,3,4,5,5,6,7,7,8,9,10,11,12,13,14,15,16,18,19,20,22,23,25,26,28,30,32,33,35,37,39,42,44,46,48,51,53,56,58,61,64,67,70,73,76,79,83,86,89,93,97,100,104,108,112,116,121,125,129,134,139,143,148,153,158,163,169,174,180,185,191,197,203,209,215,222,228,235,241,248,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 -#define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,4,6,9,11,14,16,19,22,24,27,30,33,36,39,42,45,48,51,54,57,61,64,67,71,74,78,82,85,89,93,96,100,104,108,112,116,121,125,129,133,138,142,147,151,156,160,165,170,175,180,185,190,195,200,205,210,216,221,227,232,238,243,249,255 -#define MAX_1x7135 85 -#define HALFSPEED_LEVEL 11 -#define QUARTERSPEED_LEVEL 5 -#else // updated, better shape // ../../bin/level_calc.py 2 150 7135 1 11.2 450 FET 1 10 4000 // (with a x**9 curve instead of x**3) // (because it made the ramp look better than accurate values) #define PWM1_LEVELS 1,1,2,2,3,3,4,4,5,5,6,6,7,8,8,9,10,10,11,12,13,14,15,16,17,18,19,21,22,23,25,26,27,29,31,32,34,36,38,40,42,44,46,49,51,54,56,59,62,65,68,71,74,78,81,85,89,93,97,101,106,110,115,120,125,130,136,141,147,153,160,166,173,180,187,195,202,210,219,227,236,245,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 #define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,4,5,7,8,10,11,13,14,16,18,19,21,23,25,27,29,31,34,36,38,41,43,46,48,51,54,57,60,63,66,69,72,76,79,83,87,91,95,99,103,107,112,116,121,126,131,136,141,146,152,158,163,169,175,182,188,195,202,209,216,223,231,239,247,255 -#define PWM2_LEVELS_219c 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,4,5,6,8,8,10,11,12,14,15,16,18,20,21,23,24,27,28,30,32,34,36,38,40,43,45,48,50,52,55,57,60,63,66,69,72,76,79,82,85,89,92,96,100,104,108,112,116,121,126,130,135,140,145,150,156,161,167,172,178,184,191,197,204 #define MAX_1x7135 83 #define HALFSPEED_LEVEL 13 #define QUARTERSPEED_LEVEL 6 -#endif // ceiling is level 120/150 #define RAMP_SMOOTH_CEIL (MAX_LEVEL*4/5) -- cgit v1.2.3 From c3b61729aad21a92b1411d7da6601a8716be5984 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sat, 29 Sep 2018 01:24:56 -0600 Subject: Added RampingIOS V3 manual from Phil Gold. --- spaghetti-monster/rampingios/rampingios-v3.html | 501 ++++++++++++++++++++++++ spaghetti-monster/rampingios/rampingios-v3.md | 262 +++++++++++++ spaghetti-monster/rampingios/rampingios-v3.txt | 324 +++++++++++++++ 3 files changed, 1087 insertions(+) create mode 100644 spaghetti-monster/rampingios/rampingios-v3.html create mode 100644 spaghetti-monster/rampingios/rampingios-v3.md create mode 100644 spaghetti-monster/rampingios/rampingios-v3.txt (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/rampingios/rampingios-v3.html b/spaghetti-monster/rampingios/rampingios-v3.html new file mode 100644 index 0000000..f72d1ec --- /dev/null +++ b/spaghetti-monster/rampingios/rampingios-v3.html @@ -0,0 +1,501 @@ + + + + + + + RampingIOS V3 Manual :: Phil! Gold + + + + + + + + + + + + + + + + + + + +
+

Tue, 28 Aug 2018

+ +
+

RampingIOS V3 Manual

+ +
+ +

+ + + + +
RampingIOS V3 UI diagram
+

+ +

The Emisar D4S flashlights use a firmware named RampingIOS +V3. (The Emisar D4, D1, and D1S +all use RampingIOS V2.) There's not really a manual; the +only thing we get is the diagram on the right. It's reasonably +comprehensive, but there's a fair amount of detail it merely summarizes, +so I thought a textual manual would be nice.

+ +

The Emisar D4S only works when the head and tailcap are tightened fully. +You can physically lock it out--prevent it from turning on +accidentally--by simply loosening the tailcap a small amount. A quarter +turn will do it.

+ +

Emisar lights are known for their ramping interfaces. Rather than have a +small number of distinct brightness levels, they can vary their brightness +anywhere between their lowest and highest levels, like a light on a +dimmer. The D4S is in ramping mode by default, but it also has a stepped +mode that can be configured to be closer to how non-ramping lights work.

+ +

Each mode--ramping and stepped--can have differently-configured brightness +floors and ceilings.

+ +

The driver for the D4S has two different chipsets. At low brightness +levels, a fairly-efficient but low-power chipset (called a 7135) is +used. These lowest brightness levels are called the "regulated levels". +Each regulated level will always be the same brightness regardless of how +much charge the battery has. Above a particular brightness level, the +light switches over to a less-efficient but high-power chipset (called a +FET). These levels are called "direct-drive". The brightness of the +direct-drive levels is directly related to the battery's charge level; the +more charged the battery, the brighter the levels. The light is at its +most efficient, in terms of power used for every lumen generated, at the +brightest regulated level. When the light is first powered by tightening +the tailcap, it will default to this level.

+ +

At higher brightness levels, the light's LEDs generate a lot of heat. If +the light exceeds its configured maximum temperature, it will begin +dimming itself automatically until the temperature drops below the allowed +maximum.

+ +

The D4S has a set of cyan-colored auxiliary LEDs that can be on when the +main LEDs are off. You can configure the behavior of the aux LEDs.

+ +

Basic Usage

+ +

The default mode for the light is ramping mode. Triple-pressing the +button (3 clicks) while the light is on will toggle between ramping +and stepped mode.

+ +

While the light is off, press and release the button (1 click) to turn +it on. It will turn on at the last-used brightness level. (This is +called "mode memory".) Immediately after loosening and tightening the +tailcap (or after changing the battery), the memorized level will be the +light's max regulated level.

+ +

When the light is on, 1 click will turn it off. The current brightness +level will be memorized for future use. There's a fraction of a second +delay between pressing the button and the light actually turning off. +That's because of the way the light processes input; it's waiting to make +sure you're only going to press the button once (since multiple presses +will trigger other actions).

+ +

When the light is on, holding the button down will brighten the light. In +ramping mode, the brightness will increase gradually ("ramping up"). In +stepped mode, the light will jump through increasing brightness levels. +If you press, release, and then hold the button, it will begin dimming. +In ramping mode, the brightness will decrease gradually ("ramping +down"). In stepped mode, the light will jump through decreasing +brightness levels. While the light is changing, if you release the button +and immediately hold it again, the direction (dimming or brightening) will +switch.

+ +

In ramping mode, while the light is ramping, it'll briefly blink off and +on again at two different brightness levels: the maximum regulated level +and the brightness ceiling.

+ +

While the light is off, double-pressing the button (2 clicks) will +immediately jump to the brightness ceiling.

+ +

While the light is on, 2 clicks will jump to the maximum brightness +level, regardless of the configured brightness ceiling. Another two +clicks will go back to the previous brightness level.

+ +

While the light is off, if you hold the button the light will turn on at +its lowest level. If you continue holding the button, the light will +begin brightening from there.

+ +
Configuration Menus
+ +

The light has several different configuration modes. Each of those modes +works more or less the same way. The mode will have a series of menu +items that it will go through. For each menu item, the light will first +blink a number of times corresponding to the item number (first, second, +etc.) After that, the light will begin fluttering on and off fairly +quickly. While the light is fluttering, you can click the button a number +of times; the light will count the number of button presses and use that +number as its new configuration for that menu item. After a short period +of time, the fluttering will stop and the light will move on to the next +menu item. After the light has gone through all of the menu items, it +will return to whatever mode it was in before entering the configuration +mode.

+ +

If you don't press the button during a particular menu item's fluttering, +that item will remain unchanged.

+ +
Configuring the Basic Modes
+ +

While the light is on, 4 clicks will enter ramping or stepped +configuration mode, depending on which mode the light was in before the 4 +clicks.

+ +

For ramping mode, there are two menu options:

+ +
    +
  1. Brightness floor (default 1/150)
  2. +
  3. Brightness ceiling (default 150/150)
  4. +
+ +

During the floor configuration, press the button equal to the number of +ramping levels (out of 150) at which the floor should be. To set the +lowest possible floor, click the button once.

+ +

The ceiling is configured similarly, but you press the button equal to the +number of steps away from maximum brightness. To set the highest possible +ceiling (at max brightness), click the button once.

+ +

For stepped mode, there are three menu options:

+ +
    +
  1. Brightness floor (default 20/150)
  2. +
  3. Brightness ceiling (default 120/150)
  4. +
  5. Number of steps (default 7)
  6. +
+ +

Other Modes

+ +

The other modes largely involve multiple clicks from off. Most of them +are not generally needed for everyday use, but they supplement the light's +basic operations.

+ +
BattCheck/TempCheck Modes
+ +

From off, 3 clicks will enter "BattCheck" mode, which blinks out the +current battery voltage. First it blinks the number of volts, then it +pauses, then it blinks out the tenths of volts. Thus, if the battery were +at 3.5 volts, the light would blink three times, pause, then five times. +For zeroes, it gives a very short blink.

+ +

A fully-charged lithium-ion battery is 4.2 volts. The light considers 2.8 +volts to be an empty battery and won't turn on if the battery is at or +below 2.8 volts.

+ +

The voltage sequence will continue blinking until you turn off the light +with a single click.

+ +

While the light is in BattCheck mode, 2 clicks will enter TempCheck +mode. Instead of blinking out the battery voltage, the light will start +blinking out its current temperature in degrees Celsius, first the tens +digit then the units digit. Like BattCheck mode, the light will continue +blinking out the temperature until you turn it off with a single click.

+ +

While the light is in TempCheck mode, 4 clicks will enter thermal +configuration mode. See the thermal configuration mode documentation +below for how that works.

+ +
Tactical Mode
+ +

From off, 4 clicks will enter "tactical" or "momentary" mode. The +light will flash once to show that it's entered the mode. The auxiliary +LEDs will turn off (if they were on). In tactical mode, the light will +turn on at its memorized brightness for as long as the button is being +held down. It will turn off as soon as the button is released.

+ +

There's no button press combination that will exit tactical mode. To exit +it, you will have to partially unscrew and retighten the tailcap.

+ +
Lockout Mode
+ +

From off, 6 clicks will enter lockout mode. The light will flash +twice to show that it's entered the mode. There's a separate aux LED mode +for lockout mode, so you can tell whether the light is in lockout or not.

+ +

In lockout mode, pressing the button will turn on the light at its lowest +brightness ("moonlight mode") for as long as the button is held down.

+ +

Another 6 clicks will exit lockout mode. The light will flash twice to +show that it's left the mode.

+ +

While in lockout mode, 3 clicks will cycle through the various +settings for the aux LEDs in lockout mode. The four modes are, in order: +low, high, blink (on high), and off. The default mode is blink.

+ +

Remember that loosening the tailcap a quarter turn will also lock out the +light. Using the 6 clicks is called "electronic lockout", while turning +the tailcap is "physical lockout".

+ +
Aux LED Configuration
+ +

From off, 7 clicks will cycle to the next aux LED mode. The four +modes are, in order: low, high, blink (on high), and off. The default +mode is low.

+ +
Beacon Mode
+ +

From off, 8 clicks will enter beacon mode. In beacon mode, the light +will blink on and off every few seconds.

+ +

By default, the light will blink every two seconds. To change the timing, +use 4 clicks while in beacon mode. The light will enter a one-item +menu. During the flickering for input, press the button a number of times +equal to the number of seconds between blinks.

+ +

1 click will exit beacon mode.

+ +
Thermal Configuration Mode
+ +

From off, 10 clicks will enter thermal configuration mode.

+ +

The menu items here are:

+ +
    +
  1. Current temperature (every click is one degree Celsius)
  2. +
  3. Temperature ceiling (every click is one degree above 30°C)
  4. +
+ +

The "current temperature" item can be used to adjust the calibration of +the light's temperature sensor. To use it, make sure the light has been +off long enough that all of its components have cooled (or warmed) to the +ambient temperature. Check the ambient temperature using a thermometer +you trust. Go to thermal configuration mode, and enter the current +temperature by clicking the button a number of times equal to the +temperature in degrees Celsius. (If it's 22°C, click the button 22 +times.)

+ +

You can check the default calibration by entering TempCheck mode from a +room-temperature light. The D4Ss are supposed to go through a temperature +calibration at the factory, so hopefully most of them won't need manual +thermal calibration.

+ +

The temperature ceiling is simply the highest temperature the light should +be allowed to reach. Once it hits its temperature ceiling, it will +progressively dim itself until the temperature stabilizes below the +ceiling. Note that the number of clicks in that menu option is added to +30 to reach the actual ceiling. (Thus, you can't set a ceiling below +31°C.) The maximum allowed ceiling is 70°C.

+ +

The default temperature ceiling is 45°C.

+ + +
+ + + +

+
Phil! Gold
+ + + + diff --git a/spaghetti-monster/rampingios/rampingios-v3.md b/spaghetti-monster/rampingios/rampingios-v3.md new file mode 100644 index 0000000..bc0e2b7 --- /dev/null +++ b/spaghetti-monster/rampingios/rampingios-v3.md @@ -0,0 +1,262 @@ +RampingIOS V3 Manual + +This Markdown-formatted manual was contributed by phil_g under a +Creative Commons CC0 waiver: + http://aperiodic.net/phil/archives/Geekery/rampingios-v3.html + https://creativecommons.org/publicdomain/zero/1.0/ + + +
+ + + + +
RampingIOS V3 UI diagram
+
+ +The Emisar [D4S][emisar-d4s] flashlights use a firmware named RampingIOS +V3. (The Emisar [D4][emisar-d4], [D1][emisar-d1], and [D1S][emisar-d1s] +all use [RampingIOS V2][rampingios-v2].) There's not really a manual; the +only thing we get is the diagram on the right. It's reasonably +comprehensive, but there's a fair amount of detail it merely summarizes, +so I thought a textual manual would be nice. + + [emisar-d4]: https://intl-outdoor.com/emisar-d4-high-power-led-flashlight-p-921.html + [emisar-d1]: https://intl-outdoor.com/emisar-d1-mini-thrower-p-922.html + [emisar-d1s]: https://intl-outdoor.com/emisar-d1s-thrower-p-926.html + [emisar-d4s]: https://intl-outdoor.com/emisar-d4s-26650-high-power-led-flashlight-p-932.html + [rampingios-v2]: http://aperiodic.net/phil/archives/Geekery/rampingios-v2.html + +The Emisar D4S only works when the head and tailcap are tightened fully. +You can physically lock it out--prevent it from turning on +accidentally--by simply loosening the tailcap a small amount. A quarter +turn will do it. + +Emisar lights are known for their ramping interfaces. Rather than have a +small number of distinct brightness levels, they can vary their brightness +anywhere between their lowest and highest levels, like a light on a +dimmer. The D4S is in ramping mode by default, but it also has a stepped +mode that can be configured to be closer to how non-ramping lights work. + +Each mode--ramping and stepped--can have differently-configured brightness +floors and ceilings. + +The driver for the D4S has two different chipsets. At low brightness +levels, a fairly-efficient but low-power chipset (called a *7135*) is +used. These lowest brightness levels are called the "*regulated levels*". +Each regulated level will always be the same brightness regardless of how +much charge the battery has. Above a particular brightness level, the +light switches over to a less-efficient but high-power chipset (called a +*FET*). These levels are called "*direct-drive*". The brightness of the +direct-drive levels is directly related to the battery's charge level; the +more charged the battery, the brighter the levels. The light is at its +most efficient, in terms of power used for every lumen generated, at the +brightest regulated level. When the light is first powered by tightening +the tailcap, it will default to this level. + +At higher brightness levels, the light's LEDs generate a lot of heat. If +the light exceeds its configured maximum temperature, it will begin +dimming itself automatically until the temperature drops below the allowed +maximum. + +The D4S has a set of cyan-colored auxiliary LEDs that can be on when the +main LEDs are off. You can configure the behavior of the aux LEDs. + +#### Basic Usage + +The default mode for the light is ramping mode. Triple-pressing the +button (**3 clicks**) while the light is on will toggle between ramping +and stepped mode. + +While the light is off, press and release the button (**1 click**) to turn +it on. It will turn on at the last-used brightness level. (This is +called "*mode memory*".) Immediately after loosening and tightening the +tailcap (or after changing the battery), the memorized level will be the +light's max regulated level. + +When the light is on, 1 click will turn it off. The current brightness +level will be memorized for future use. There's a fraction of a second +delay between pressing the button and the light actually turning off. +That's because of the way the light processes input; it's waiting to make +sure you're only going to press the button once (since multiple presses +will trigger other actions). + +When the light is on, holding the button down will brighten the light. In +ramping mode, the brightness will increase gradually ("*ramping up*"). In +stepped mode, the light will jump through increasing brightness levels. +If you press, release, and then hold the button, it will begin dimming. +In ramping mode, the brightness will decrease gradually ("*ramping +down*"). In stepped mode, the light will jump through decreasing +brightness levels. While the light is changing, if you release the button +and immediately hold it again, the direction (dimming or brightening) will +switch. + +In ramping mode, while the light is ramping, it'll briefly blink off and +on again at two different brightness levels: the maximum regulated level +and the brightness ceiling. + +While the light is off, double-pressing the button (**2 clicks**) will +immediately jump to the brightness ceiling. + +While the light is on, **2 clicks** will jump to the maximum brightness +level, regardless of the configured brightness ceiling. Another two +clicks will go back to the previous brightness level. + +While the light is off, if you hold the button the light will turn on at +its lowest level. If you continue holding the button, the light will +begin brightening from there. + +##### Configuration Menus + +The light has several different configuration modes. Each of those modes +works more or less the same way. The mode will have a series of menu +items that it will go through. For each menu item, the light will first +blink a number of times corresponding to the item number (first, second, +etc.) After that, the light will begin fluttering on and off fairly +quickly. While the light is fluttering, you can click the button a number +of times; the light will count the number of button presses and use that +number as its new configuration for that menu item. After a short period +of time, the fluttering will stop and the light will move on to the next +menu item. After the light has gone through all of the menu items, it +will return to whatever mode it was in before entering the configuration +mode. + +If you don't press the button during a particular menu item's fluttering, +that item will remain unchanged. + +##### Configuring the Basic Modes + +While the light is on, **4 clicks** will enter ramping or stepped +configuration mode, depending on which mode the light was in before the 4 +clicks. + +For ramping mode, there are two menu options: + + 1. Brightness floor (default 1/150) + 2. Brightness ceiling (default 150/150) + +During the floor configuration, press the button equal to the number of +ramping levels (out of 150) at which the floor should be. To set the +lowest possible floor, click the button once. + +The ceiling is configured similarly, but you press the button equal to the +number of steps away from maximum brightness. To set the highest possible +ceiling (at max brightness), click the button once. + +For stepped mode, there are three menu options: + + 1. Brightness floor (default 20/150) + 2. Brightness ceiling (default 120/150) + 3. Number of steps (default 7) + +#### Other Modes + +The other modes largely involve multiple clicks from off. Most of them +are not generally needed for everyday use, but they supplement the light's +basic operations. + +##### BattCheck/TempCheck Modes + +From off, **3 clicks** will enter "BattCheck" mode, which blinks out the +current battery voltage. First it blinks the number of volts, then it +pauses, then it blinks out the tenths of volts. Thus, if the battery were +at 3.5 volts, the light would blink three times, pause, then five times. +For zeroes, it gives a very short blink. + +A fully-charged lithium-ion battery is 4.2 volts. The light considers 2.8 +volts to be an empty battery and won't turn on if the battery is at or +below 2.8 volts. + +The voltage sequence will continue blinking until you turn off the light +with a single click. + +While the light is in BattCheck mode, **2 clicks** will enter TempCheck +mode. Instead of blinking out the battery voltage, the light will start +blinking out its current temperature in degrees Celsius, first the tens +digit then the units digit. Like BattCheck mode, the light will continue +blinking out the temperature until you turn it off with a single click. + +While the light is in TempCheck mode, **4 clicks** will enter thermal +configuration mode. See the thermal configuration mode documentation +below for how that works. + +##### Tactical Mode + +From off, **4 clicks** will enter "tactical" or "momentary" mode. The +light will flash once to show that it's entered the mode. The auxiliary +LEDs will turn off (if they were on). In tactical mode, the light will +turn on at its memorized brightness for as long as the button is being +held down. It will turn off as soon as the button is released. + +There's no button press combination that will exit tactical mode. To exit +it, you will have to partially unscrew and retighten the tailcap. + +##### Lockout Mode + +From off, **6 clicks** will enter lockout mode. The light will flash +twice to show that it's entered the mode. There's a separate aux LED mode +for lockout mode, so you can tell whether the light is in lockout or not. + +In lockout mode, pressing the button will turn on the light at its lowest +brightness ("*moonlight mode*") for as long as the button is held down. + +Another 6 clicks will exit lockout mode. The light will flash twice to +show that it's left the mode. + +While in lockout mode, **3 clicks** will cycle through the various +settings for the aux LEDs in lockout mode. The four modes are, in order: +low, high, blink (on high), and off. The default mode is blink. + +Remember that loosening the tailcap a quarter turn will also lock out the +light. Using the 6 clicks is called "*electronic lockout*", while turning +the tailcap is "*physical lockout*". + +##### Aux LED Configuration + +From off, **7 clicks** will cycle to the next aux LED mode. The four +modes are, in order: low, high, blink (on high), and off. The default +mode is low. + +##### Beacon Mode + +From off, **8 clicks** will enter beacon mode. In beacon mode, the light +will blink on and off every few seconds. + +By default, the light will blink every two seconds. To change the timing, +use **4 clicks** while in beacon mode. The light will enter a one-item +menu. During the flickering for input, press the button a number of times +equal to the number of seconds between blinks. + +1 click will exit beacon mode. + +##### Thermal Configuration Mode + +From off, **10 clicks** will enter thermal configuration mode. + +The menu items here are: + + 1. Current temperature (every click is one degree Celsius) + 2. Temperature ceiling (every click is one degree *above 30°C*) + +The "current temperature" item can be used to adjust the calibration of +the light's temperature sensor. To use it, make sure the light has been +off long enough that all of its components have cooled (or warmed) to the +ambient temperature. Check the ambient temperature using a thermometer +you trust. Go to thermal configuration mode, and enter the current +temperature by clicking the button a number of times equal to the +temperature in degrees Celsius. (If it's 22°C, click the button 22 +times.) + +You can check the default calibration by entering TempCheck mode from a +room-temperature light. The D4Ss are supposed to go through a temperature +calibration at the factory, so hopefully most of them won't need manual +thermal calibration. + +The temperature ceiling is simply the highest temperature the light should +be allowed to reach. Once it hits its temperature ceiling, it will +progressively dim itself until the temperature stabilizes below the +ceiling. Note that the number of clicks in that menu option is added to +*30* to reach the actual ceiling. (Thus, you can't set a ceiling below +31°C.) The maximum allowed ceiling is 70°C. + +The default temperature ceiling is 45°C. diff --git a/spaghetti-monster/rampingios/rampingios-v3.txt b/spaghetti-monster/rampingios/rampingios-v3.txt new file mode 100644 index 0000000..4598a76 --- /dev/null +++ b/spaghetti-monster/rampingios/rampingios-v3.txt @@ -0,0 +1,324 @@ +RampingIOS V3 Manual +http://aperiodic.net/phil/archives/Geekery/rampingios-v3.html + +Tue, 28 Aug 2018 +9:47AM | Geekery | # + + +RampingIOS V3 Manual +-------------------- + +[rampingiosv3-ui.png] RampingIOS V3 UI diagram + +The Emisar D4S flashlights use a firmware named RampingIOS V3. (The Emisar D4, +D1, and D1S all use RampingIOS V2.) There's not really a manual; the only thing +we get is the diagram on the right. It's reasonably comprehensive, but there's +a fair amount of detail it merely summarizes, so I thought a textual manual +would be nice. + +The Emisar D4S only works when the head and tailcap are tightened fully. You +can physically lock it out--prevent it from turning on accidentally--by simply +loosening the tailcap a small amount. A quarter turn will do it. + +Emisar lights are known for their ramping interfaces. Rather than have a small +number of distinct brightness levels, they can vary their brightness anywhere +between their lowest and highest levels, like a light on a dimmer. The D4S is +in ramping mode by default, but it also has a stepped mode that can be +configured to be closer to how non-ramping lights work. + +Each mode--ramping and stepped--can have differently-configured brightness +floors and ceilings. + +The driver for the D4S has two different chipsets. At low brightness levels, a +fairly-efficient but low-power chipset (called a 7135) is used. These lowest +brightness levels are called the "regulated levels". Each regulated level will +always be the same brightness regardless of how much charge the battery has. +Above a particular brightness level, the light switches over to a +less-efficient but high-power chipset (called a FET). These levels are called " +direct-drive". The brightness of the direct-drive levels is directly related to +the battery's charge level; the more charged the battery, the brighter the +levels. The light is at its most efficient, in terms of power used for every +lumen generated, at the brightest regulated level. When the light is first +powered by tightening the tailcap, it will default to this level. + +At higher brightness levels, the light's LEDs generate a lot of heat. If the +light exceeds its configured maximum temperature, it will begin dimming itself +automatically until the temperature drops below the allowed maximum. + +The D4S has a set of cyan-colored auxiliary LEDs that can be on when the main +LEDs are off. You can configure the behavior of the aux LEDs. + + +Basic Usage +----------- + +The default mode for the light is ramping mode. Triple-pressing the button (3 +clicks) while the light is on will toggle between ramping and stepped mode. + +While the light is off, press and release the button (1 click) to turn it on. +It will turn on at the last-used brightness level. (This is called "mode memory +".) Immediately after loosening and tightening the tailcap (or after changing +the battery), the memorized level will be the light's max regulated level. + +When the light is on, 1 click will turn it off. The current brightness level +will be memorized for future use. There's a fraction of a second delay between +pressing the button and the light actually turning off. That's because of the +way the light processes input; it's waiting to make sure you're only going to +press the button once (since multiple presses will trigger other actions). + +When the light is on, holding the button down will brighten the light. In +ramping mode, the brightness will increase gradually ("ramping up"). In stepped +mode, the light will jump through increasing brightness levels. If you press, +release, and then hold the button, it will begin dimming. In ramping mode, the +brightness will decrease gradually ("ramping down"). In stepped mode, the light +will jump through decreasing brightness levels. While the light is changing, if +you release the button and immediately hold it again, the direction (dimming or +brightening) will switch. + +In ramping mode, while the light is ramping, it'll briefly blink off and on +again at two different brightness levels: the maximum regulated level and the +brightness ceiling. + +While the light is off, double-pressing the button (2 clicks) will immediately +jump to the brightness ceiling. + +While the light is on, 2 clicks will jump to the maximum brightness level, +regardless of the configured brightness ceiling. Another two clicks will go +back to the previous brightness level. + +While the light is off, if you hold the button the light will turn on at its +lowest level. If you continue holding the button, the light will begin +brightening from there. + + +Configuration Menus +------------------- + +The light has several different configuration modes. Each of those modes works +more or less the same way. The mode will have a series of menu items that it +will go through. For each menu item, the light will first blink a number of +times corresponding to the item number (first, second, etc.) After that, the +light will begin fluttering on and off fairly quickly. While the light is +fluttering, you can click the button a number of times; the light will count +the number of button presses and use that number as its new configuration for +that menu item. After a short period of time, the fluttering will stop and the +light will move on to the next menu item. After the light has gone through all +of the menu items, it will return to whatever mode it was in before entering +the configuration mode. + +If you don't press the button during a particular menu item's fluttering, that +item will remain unchanged. + + +Configuring the Basic Modes + +While the light is on, 4 clicks will enter ramping or stepped configuration +mode, depending on which mode the light was in before the 4 clicks. + +For ramping mode, there are two menu options: + + 1. Brightness floor (default 1/150) + 2. Brightness ceiling (default 150/150) + +During the floor configuration, press the button equal to the number of ramping +levels (out of 150) at which the floor should be. To set the lowest possible +floor, click the button once. + +The ceiling is configured similarly, but you press the button equal to the +number of steps away from maximum brightness. To set the highest possible +ceiling (at max brightness), click the button once. + +For stepped mode, there are three menu options: + + 1. Brightness floor (default 20/150) + 2. Brightness ceiling (default 120/150) + 3. Number of steps (default 7) + + +Other Modes +----------- + +The other modes largely involve multiple clicks from off. Most of them are not +generally needed for everyday use, but they supplement the light's basic +operations. + + +BattCheck/TempCheck Modes + +From off, 3 clicks will enter "BattCheck" mode, which blinks out the current +battery voltage. First it blinks the number of volts, then it pauses, then it +blinks out the tenths of volts. Thus, if the battery were at 3.5 volts, the +light would blink three times, pause, then five times. For zeroes, it gives a +very short blink. + +A fully-charged lithium-ion battery is 4.2 volts. The light considers 2.8 volts +to be an empty battery and won't turn on if the battery is at or below 2.8 +volts. + +The voltage sequence will continue blinking until you turn off the light with a +single click. + +While the light is in BattCheck mode, 2 clicks will enter TempCheck mode. +Instead of blinking out the battery voltage, the light will start blinking out +its current temperature in degrees Celsius, first the tens digit then the units +digit. Like BattCheck mode, the light will continue blinking out the +temperature until you turn it off with a single click. + +While the light is in TempCheck mode, 4 clicks will enter thermal configuration +mode. See the thermal configuration mode documentation below for how that +works. + + +Tactical Mode + +From off, 4 clicks will enter "tactical" or "momentary" mode. The light will +flash once to show that it's entered the mode. The auxiliary LEDs will turn off +(if they were on). In tactical mode, the light will turn on at its memorized +brightness for as long as the button is being held down. It will turn off as +soon as the button is released. + +There's no button press combination that will exit tactical mode. To exit it, +you will have to partially unscrew and retighten the tailcap. + + +Lockout Mode + +From off, 6 clicks will enter lockout mode. The light will flash twice to show +that it's entered the mode. There's a separate aux LED mode for lockout mode, +so you can tell whether the light is in lockout or not. + +In lockout mode, pressing the button will turn on the light at its lowest +brightness ("moonlight mode") for as long as the button is held down. + +Another 6 clicks will exit lockout mode. The light will flash twice to show +that it's left the mode. + +While in lockout mode, 3 clicks will cycle through the various settings for the +aux LEDs in lockout mode. The four modes are, in order: low, high, blink (on +high), and off. The default mode is blink. + +Remember that loosening the tailcap a quarter turn will also lock out the +light. Using the 6 clicks is called "electronic lockout", while turning the +tailcap is "physical lockout". + + +Aux LED Configuration + +From off, 7 clicks will cycle to the next aux LED mode. The four modes are, in +order: low, high, blink (on high), and off. The default mode is low. + + +Beacon Mode + +From off, 8 clicks will enter beacon mode. In beacon mode, the light will blink +on and off every few seconds. + +By default, the light will blink every two seconds. To change the timing, use 4 +clicks while in beacon mode. The light will enter a one-item menu. During the +flickering for input, press the button a number of times equal to the number of +seconds between blinks. + +1 click will exit beacon mode. + + +Thermal Configuration Mode + +From off, 10 clicks will enter thermal configuration mode. + +The menu items here are: + + 1. Current temperature (every click is one degree Celsius) + 2. Temperature ceiling (every click is one degree above 30?C) + +The "current temperature" item can be used to adjust the calibration of the +light's temperature sensor. To use it, make sure the light has been off long +enough that all of its components have cooled (or warmed) to the ambient +temperature. Check the ambient temperature using a thermometer you trust. Go to +thermal configuration mode, and enter the current temperature by clicking the +button a number of times equal to the temperature in degrees Celsius. (If it's +22?C, click the button 22 times.) + +You can check the default calibration by entering TempCheck mode from a +room-temperature light. The D4Ss are supposed to go through a temperature +calibration at the factory, so hopefully most of them won't need manual thermal +calibration. + +The temperature ceiling is simply the highest temperature the light should be +allowed to reach. Once it hits its temperature ceiling, it will progressively +dim itself until the temperature stabilizes below the ceiling. Note that the +number of clicks in that menu option is added to 30 to reach the actual +ceiling. (Thus, you can't set a ceiling below 31?C.) The maximum allowed +ceiling is 70?C. + +The default temperature ceiling is 45?C. + + +Static + + * zsh prompt + * PGP + * SSH + * MTA + * tutorials + * config files + * desktop + * books I own + * stuff I'm giving away + * Dr. Who eps I have + * bookmarks + * photos + * about + +Directory + + * Root (143) + + Books (32) + + Events (7) + o Burning Man (3) + o Camping (2) + o PDF (2) + + Geekery (36) + o Test (3) + + General (24) + + Links (12) + o Slashdot (1) + + MTA (22) + + Recipes (4) + + Video Games (6) + o FFXI (1) + +Archive + + ?August? +Sun Mon Tue Wed Thu Fri Sat + 1 2 3 4 +5 6 7 8 9 10 11 +12 13 14 15 16 17 18 +19 20 21 22 23 24 25 +26 27 28 29 30 31 + + ?2018? + Months +Jan Feb Mar Apr May Jun +Jul Aug Sep Oct Nov Dec + +Search + +[ ] +Powered by Google + +Currently Reading + +Recent Books + +------------------------------------------------------------------------------- + +Copyright (C) 2018 Phil Gold + +Back to main page. + + * Valid HTML 4.01 + * Valid CSS 2 + * RSS syndication + * Valid RSS 1.0 + -- cgit v1.2.3 From c0d79d1f4151cd5a4b52167864c0c37422452bc9 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sat, 29 Sep 2018 15:45:26 -0600 Subject: Applied recent Anduril updates to RampingIOS V3: - D4-219C build target. - Moon timing hint. - Better timing consistency on hold-from-off. - Fixed bug where changing ramp style could go to the wrong brightness level. --- spaghetti-monster/rampingios/build-all.sh | 3 ++- spaghetti-monster/rampingios/rampingiosv3.c | 26 ++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/rampingios/build-all.sh b/spaghetti-monster/rampingios/build-all.sh index 42efce7..22597b7 100755 --- a/spaghetti-monster/rampingios/build-all.sh +++ b/spaghetti-monster/rampingios/build-all.sh @@ -8,8 +8,9 @@ for TARGET in \ EMISAR_D1 \ EMISAR_D1S \ EMISAR_D4 \ + EMISAR_D4_219C \ EMISAR_D4S \ - EMISAR_D4S_219c \ + EMISAR_D4S_219C \ ; do echo "===== $TARGET =====" ../../../bin/build-85.sh "$UI" "-DFSM_${TARGET}_DRIVER" diff --git a/spaghetti-monster/rampingios/rampingiosv3.c b/spaghetti-monster/rampingios/rampingiosv3.c index de2de62..5c8f7ea 100644 --- a/spaghetti-monster/rampingios/rampingiosv3.c +++ b/spaghetti-monster/rampingios/rampingiosv3.c @@ -25,8 +25,9 @@ //#define FSM_EMISAR_D1_DRIVER //#define FSM_EMISAR_D1S_DRIVER //#define FSM_EMISAR_D4_DRIVER +//#define FSM_EMISAR_D4_219C_DRIVER //#define FSM_EMISAR_D4S_DRIVER -//#define FSM_EMISAR_D4S_219c_DRIVER +//#define FSM_EMISAR_D4S_219C_DRIVER //#define FSM_FF_ROT66_DRIVER //#define FSM_FW3A_DRIVER @@ -36,6 +37,10 @@ #define USE_THERMAL_REGULATION #define DEFAULT_THERM_CEIL 45 // try not to get hotter than this +// short blip when crossing from "click" to "hold" from off +// (helps the user hit moon mode exactly, instead of holding too long +// or too short) +#define MOON_TIMING_HINT // short blips while ramping #define BLINK_AT_CHANNEL_BOUNDARIES //#define BLINK_AT_RAMP_FLOOR @@ -67,10 +72,13 @@ #elif defined(FSM_EMISAR_D1S_DRIVER) #include "cfg-emisar-d1s.h" +#elif defined(FSM_EMISAR_D4_219C_DRIVER) +#include "cfg-emisar-d4-219c.h" + #elif defined(FSM_EMISAR_D4_DRIVER) #include "cfg-emisar-d4.h" -#elif defined(FSM_EMISAR_D4S_219c_DRIVER) +#elif defined(FSM_EMISAR_D4S_219C_DRIVER) #include "cfg-emisar-d4s-219c.h" #elif defined(FSM_EMISAR_D4S_DRIVER) @@ -275,9 +283,19 @@ uint8_t off_state(EventPtr event, uint16_t arg) { } // hold: go to lowest level else if (event == EV_click1_hold) { + #ifdef MOON_TIMING_HINT + if (arg == 0) { + // let the user know they can let go now to stay at moon + uint8_t temp = actual_level; + set_level(0); + delay_4ms(2); + set_level(temp); + } else + #endif // don't start ramping immediately; // give the user time to release at moon level - if (arg >= HOLD_TIMEOUT) { + //if (arg >= HOLD_TIMEOUT) { // smaller + if (arg >= (!ramp_style) * HOLD_TIMEOUT) { // more consistent set_state(steady_state, 1); } return MISCHIEF_MANAGED; @@ -410,7 +428,7 @@ uint8_t steady_state(EventPtr event, uint16_t arg) { // 3 clicks: toggle smooth vs discrete ramping else if (event == EV_3clicks) { ramp_style = !ramp_style; - memorized_level = nearest_level(memorized_level); + memorized_level = nearest_level(actual_level); #ifdef USE_THERMAL_REGULATION target_level = memorized_level; #ifdef USE_SET_LEVEL_GRADUALLY -- cgit v1.2.3 From 8be340a5d60755b9e57404380baa892554d9bc7b Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 30 Sep 2018 01:58:41 -0600 Subject: Added ROT66 14x7135 support. Split original 7x7135 target into two. Still acts weird at the channel boundary, and I think it's the driver, not the emitters or 7135 chips. Not sure what exactly causes it, but the aux LED board acts weird there too. --- spaghetti-monster/anduril/anduril.c | 4 ++++ spaghetti-monster/anduril/build-all.sh | 1 + spaghetti-monster/anduril/cfg-ff-rot66-219.h | 21 +++++++++++++++++++++ spaghetti-monster/anduril/cfg-ff-rot66.h | 14 +++++++------- 4 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 spaghetti-monster/anduril/cfg-ff-rot66-219.h (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index c98026f..1d4d0d2 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -30,6 +30,7 @@ //#define FSM_EMISAR_D4S_DRIVER //#define FSM_EMISAR_D4S_219C_DRIVER //#define FSM_FF_ROT66_DRIVER +//#define FSM_FF_ROT66_219_DRIVER //#define FSM_FW3A_DRIVER #define USE_LVP // FIXME: won't build when this option is turned off @@ -104,6 +105,9 @@ #elif defined(FSM_FF_ROT66_DRIVER) #include "cfg-ff-rot66.h" +#elif defined(FSM_FF_ROT66_219_DRIVER) +#include "cfg-ff-rot66-219.h" + #elif defined(FSM_FW3A_DRIVER) #include "cfg-fw3a.h" diff --git a/spaghetti-monster/anduril/build-all.sh b/spaghetti-monster/anduril/build-all.sh index a8bb397..f652e16 100755 --- a/spaghetti-monster/anduril/build-all.sh +++ b/spaghetti-monster/anduril/build-all.sh @@ -13,6 +13,7 @@ for TARGET in \ EMISAR_D4S \ EMISAR_D4S_219C \ FF_ROT66 \ + FF_ROT66_219 \ FW3A \ ; do echo "===== $TARGET =====" diff --git a/spaghetti-monster/anduril/cfg-ff-rot66-219.h b/spaghetti-monster/anduril/cfg-ff-rot66-219.h new file mode 100644 index 0000000..46ceb9f --- /dev/null +++ b/spaghetti-monster/anduril/cfg-ff-rot66-219.h @@ -0,0 +1,21 @@ +// Fireflies ROT66-219 (7x7135) config options for Anduril +// same as regular ROT66, but calibrated for Nichia 219B with 7x7135 chips +#define FSM_FF_ROT66_DRIVER +#include "cfg-ff-rot66.h" + +// driver is a FET+N+1, +// where N=6 for the 219b version +// calculated to get transition points at level 65 and 115 +// first 65 steps same as regular ROT66 +// remaining steps from this command: +// level_calc.py ninth 3 150 7135 1 1.4 110.1 7135 14 1 1058.5 FET 1 10 4500 +#undef PWM2_LEVELS +#define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,17,18,20,21,23,25,27,29,31,33,36,38,41,43,46,49,52,55,58,62,65,69,73,77,81,86,90,95,100,105,111,116,122,128,135,141,148,155,163,170,178,187,195,204,214,224,234,244,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 +#undef PWM3_LEVELS +#define PWM3_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,8,12,16,21,25,30,35,40,45,50,56,62,68,74,81,87,94,101,109,116,124,133,141,150,159,168,178,188,198,209,220,231,243,255 +#undef MAX_Nx7135 +#define MAX_Nx7135 115 + +// regulate down faster when the FET is active, slower otherwise +#undef THERM_FASTER_LEVEL +#define THERM_FASTER_LEVEL 130 // throttle back faster when high diff --git a/spaghetti-monster/anduril/cfg-ff-rot66.h b/spaghetti-monster/anduril/cfg-ff-rot66.h index 6cae4fd..c8e0d52 100644 --- a/spaghetti-monster/anduril/cfg-ff-rot66.h +++ b/spaghetti-monster/anduril/cfg-ff-rot66.h @@ -1,4 +1,4 @@ -// Fireflies ROT66 config options for Anduril +// Fireflies ROT66 (14x7135) config options for Anduril // the button lights up #define USE_INDICATOR_LED @@ -24,17 +24,17 @@ // driver is a FET+N+1, // where N=6 for the 219b version, -// or N=13 for the XP-L HI version -// calculated to get transition points at level 65 and 115, using a "ninth"-shaped ramp +// or N=13 for the XP-L HI version (this version) +// calculated to get transition points at level 65 and 125 #define RAMP_LENGTH 150 // first 65 steps copied from FW3A #define PWM1_LEVELS 1,1,2,2,3,3,4,4,5,6,7,8,9,10,12,13,14,15,17,19,20,22,24,26,29,31,34,36,39,42,45,48,51,55,59,62,66,70,75,79,84,89,93,99,104,110,115,121,127,134,140,147,154,161,168,176,184,192,200,209,217,226,236,245,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 // remaining steps from this command: -// level_calc.py 3 150 7135 1 1.4 110.1 7135 14 1 1058.5 FET 1 10 4500 -#define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,17,18,20,21,23,25,27,29,31,33,36,38,41,43,46,49,52,55,58,62,65,69,73,77,81,86,90,95,100,105,111,116,122,128,135,141,148,155,163,170,178,187,195,204,214,224,234,244,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 -#define PWM3_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,8,12,16,21,25,30,35,40,45,50,56,62,68,74,81,87,94,101,109,116,124,133,141,150,159,168,178,188,198,209,220,231,243,255 +// level_calc.py ninth 3 150 7135 1 1.4 110.1 7135 15 1 1644.16 FET 1 10 4500 +#define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,17,18,19,20,21,22,23,25,26,27,29,30,32,34,35,37,39,41,43,46,48,50,53,55,58,61,64,67,70,73,77,81,84,88,92,97,101,106,110,115,120,126,131,137,143,149,156,162,169,177,184,192,200,208,217,226,235,245,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 +#define PWM3_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,13,21,28,35,43,51,60,68,77,87,96,106,117,127,138,150,161,173,186,199,212,226,240,255 #define MAX_1x7135 65 -#define MAX_Nx7135 115 +#define MAX_Nx7135 125 #define HALFSPEED_LEVEL 14 #define QUARTERSPEED_LEVEL 8 -- cgit v1.2.3 From 25e8da3db9acee2c809176fa1f9169a65844f582 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 7 Oct 2018 18:52:00 -0600 Subject: First working PL47 build. Does aux LEDs on pin 7 but not pin 3. --- spaghetti-monster/anduril/anduril.c | 3 ++ spaghetti-monster/anduril/build-all.sh | 1 + spaghetti-monster/anduril/cfg-ff-pl47.h | 55 +++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 spaghetti-monster/anduril/cfg-ff-pl47.h (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index 1d4d0d2..4aaea74 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -102,6 +102,9 @@ #elif defined(FSM_EMISAR_D4S_DRIVER) #include "cfg-emisar-d4s.h" +#elif defined(FSM_FF_PL47_DRIVER) +#include "cfg-ff-pl47.h" + #elif defined(FSM_FF_ROT66_DRIVER) #include "cfg-ff-rot66.h" diff --git a/spaghetti-monster/anduril/build-all.sh b/spaghetti-monster/anduril/build-all.sh index f652e16..9e2a83c 100755 --- a/spaghetti-monster/anduril/build-all.sh +++ b/spaghetti-monster/anduril/build-all.sh @@ -12,6 +12,7 @@ for TARGET in \ EMISAR_D4_219C \ EMISAR_D4S \ EMISAR_D4S_219C \ + FF_PL47 \ FF_ROT66 \ FF_ROT66_219 \ FW3A \ diff --git a/spaghetti-monster/anduril/cfg-ff-pl47.h b/spaghetti-monster/anduril/cfg-ff-pl47.h new file mode 100644 index 0000000..5a623fc --- /dev/null +++ b/spaghetti-monster/anduril/cfg-ff-pl47.h @@ -0,0 +1,55 @@ +// Fireflies PL47 config options for Anduril + +// the button lights up +#define USE_INDICATOR_LED +// the aux LEDs are in the same place as the main LEDs +#ifdef USE_INDICATOR_LED_WHILE_RAMPING +#undef USE_INDICATOR_LED_WHILE_RAMPING +#endif +//#define USE_INDICATOR_LED_WHILE_RAMPING +// enable blinking indicator LED while off? +#define TICK_DURING_STANDBY + +// If TICK_DURING_STANDBY is enabled... +// off mode: high (2) +// lockout: blinking (3) +#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 2) + +// ... or if TICK_DURING_STANDBY is turned off: +// off mode: high (2) +// lockout: off (0) +//#define INDICATOR_LED_DEFAULT_MODE ((0<<2) + 2) + + +#ifdef RAMP_LENGTH +#undef RAMP_LENGTH +#endif +#define RAMP_LENGTH 150 + +// driver is a FET + 3x7135, ~400 lm at highest regulated level +// ramp copied from Emisar D4S ramp +#define PWM1_LEVELS 1,1,2,2,3,3,4,4,5,5,6,6,7,8,8,9,10,10,11,12,13,14,15,16,17,18,19,21,22,23,25,26,27,29,31,32,34,36,38,40,42,44,46,49,51,54,56,59,62,65,68,71,74,78,81,85,89,93,97,101,106,110,115,120,125,130,136,141,147,153,160,166,173,180,187,195,202,210,219,227,236,245,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 +#define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,4,5,7,8,10,11,13,14,16,18,19,21,23,25,27,29,31,34,36,38,41,43,46,48,51,54,57,60,63,66,69,72,76,79,83,87,91,95,99,103,107,112,116,121,126,131,136,141,146,152,158,163,169,175,182,188,195,202,209,216,223,231,239,247,255 +#define MAX_1x7135 83 +#define HALFSPEED_LEVEL 13 +#define QUARTERSPEED_LEVEL 6 + +// ceiling is level 120/150 +#define RAMP_SMOOTH_CEIL (MAX_LEVEL*4/5) + +// thermal regulation parameters +#ifdef MIN_THERM_STEPDOWN +#undef MIN_THERM_STEPDOWN // this should be lower, because 3x7135 instead of 1x7135 +#endif +#define MIN_THERM_STEPDOWN 60 // lowest value it'll step down to + +// regulate down faster when the FET is active, slower otherwise +#define THERM_FASTER_LEVEL 130 // throttle back faster when high + +// play it safe, don't try to regulate above the recommended safe level +#define THERM_HARD_TURBO_DROP + +// don't do this +#undef BLINK_AT_CHANNEL_BOUNDARIES +#undef BLINK_AT_RAMP_CEILING + -- cgit v1.2.3 From 477082fc0c8671988b7bcac2a6d816b80a9fe675 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 7 Oct 2018 19:19:37 -0600 Subject: Added option to skip "low" mode for aux LEDs. Not actually used though. --- spaghetti-monster/anduril/anduril.c | 6 ++++++ spaghetti-monster/anduril/cfg-ff-pl47.h | 4 ++++ 2 files changed, 10 insertions(+) (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index 4aaea74..d15e9a0 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -1189,6 +1189,9 @@ uint8_t lockout_state(EventPtr event, uint16_t arg) { #else mode = (mode + 1) % 3; #endif + #ifdef INDICATOR_LED_SKIP_LOW + if (mode == 1) { mode ++; } + #endif indicator_led_mode = (mode << 2) + (indicator_led_mode & 0x03); indicator_led(mode); save_config(); @@ -1205,6 +1208,9 @@ uint8_t lockout_state(EventPtr event, uint16_t arg) { #else uint8_t mode = (arg >> 5) % 3; #endif + #ifdef INDICATOR_LED_SKIP_LOW + if (mode == 1) { mode ++; } + #endif indicator_led_mode = (indicator_led_mode & 0b11111100) | mode; #ifdef TICK_DURING_STANDBY if (mode == 3) diff --git a/spaghetti-monster/anduril/cfg-ff-pl47.h b/spaghetti-monster/anduril/cfg-ff-pl47.h index 5a623fc..d916e06 100644 --- a/spaghetti-monster/anduril/cfg-ff-pl47.h +++ b/spaghetti-monster/anduril/cfg-ff-pl47.h @@ -15,6 +15,10 @@ // lockout: blinking (3) #define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 2) +// the "low" mode doesn't work on this light's aux LEDs +// (but it does work on the switch LEDs) +//#define INDICATOR_LED_SKIP_LOW + // ... or if TICK_DURING_STANDBY is turned off: // off mode: high (2) // lockout: off (0) -- cgit v1.2.3 From 7c3fe5878da90e1b5f540ebb2547e974715a6f98 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 7 Oct 2018 19:20:19 -0600 Subject: Made second aux LED copy the behavior of the first. (to make the PL47 switch LEDs mirror the front-facing aux LEDs) --- spaghetti-monster/fsm-misc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/fsm-misc.c b/spaghetti-monster/fsm-misc.c index e60909e..e61fe00 100644 --- a/spaghetti-monster/fsm-misc.c +++ b/spaghetti-monster/fsm-misc.c @@ -113,14 +113,26 @@ void indicator_led(uint8_t lvl) { case 0: // indicator off DDRB &= 0xff ^ (1 << AUXLED_PIN); PORTB &= 0xff ^ (1 << AUXLED_PIN); + #ifdef AUXLED2_PIN // second LED mirrors the first + DDRB &= 0xff ^ (1 << AUXLED2_PIN); + PORTB &= 0xff ^ (1 << AUXLED2_PIN); + #endif break; case 1: // indicator low DDRB &= 0xff ^ (1 << AUXLED_PIN); PORTB |= (1 << AUXLED_PIN); + #ifdef AUXLED2_PIN // second LED mirrors the first + DDRB &= 0xff ^ (1 << AUXLED2_PIN); + PORTB |= (1 << AUXLED2_PIN); + #endif break; default: // indicator high DDRB |= (1 << AUXLED_PIN); PORTB |= (1 << AUXLED_PIN); + #ifdef AUXLED2_PIN // second LED mirrors the first + DDRB |= (1 << AUXLED2_PIN); + PORTB |= (1 << AUXLED2_PIN); + #endif break; } } -- cgit v1.2.3 From 14a58d158c544b1cbbe078a7203f85094a6b1ec4 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Tue, 9 Oct 2018 18:43:30 -0600 Subject: bug fix: set thermal target to actual level, not maximum level, when doing double-click from off --- spaghetti-monster/anduril/anduril.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index d15e9a0..6e33610 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -515,10 +515,11 @@ uint8_t steady_state(EventPtr event, uint16_t arg) { if ((arg > mode_min) && (arg < mode_max)) memorized_level = arg; // use the requested level even if not memorized + arg = nearest_level(arg); #ifdef USE_THERMAL_REGULATION target_level = arg; #endif - set_level(nearest_level(arg)); + set_level(arg); #ifdef USE_REVERSING ramp_direction = 1; #endif -- cgit v1.2.3 From 3684b0c49319dcec03d44f89ac1a5c19b8f59feb Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Tue, 9 Oct 2018 18:46:55 -0600 Subject: applied thermal target bugfix from Anduril --- spaghetti-monster/rampingios/rampingiosv3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/rampingios/rampingiosv3.c b/spaghetti-monster/rampingios/rampingiosv3.c index 5c8f7ea..2aeeddf 100644 --- a/spaghetti-monster/rampingios/rampingiosv3.c +++ b/spaghetti-monster/rampingios/rampingiosv3.c @@ -394,10 +394,11 @@ uint8_t steady_state(EventPtr event, uint16_t arg) { if ((arg > mode_min) && (arg < mode_max)) memorized_level = arg; // use the requested level even if not memorized + arg = nearest_level(arg); #ifdef USE_THERMAL_REGULATION target_level = arg; #endif - set_level(nearest_level(arg)); + set_level(arg); #ifdef USE_REVERSING ramp_direction = 1; #endif -- cgit v1.2.3