New Basic UI (based on FSM/Anduril code) - do you like it?

How did you do that mod?

I did mine by copying @SammysHP method, adding this to the cfg file (cfg-sofirn-sc21-pro.h in my case) :


#undef AUTO_REVERSE_TIME
#define AUTO_REVERSE_TIME (TICKS_PER_SECOND / 5)



I found the default value in
@ToyKeeper’s anduril2-r657
config-default.h file
line 75:


#define AUTO_REVERSE_TIME (TICKS_PER_SECOND * 2 / 3)



@SammysHP cfg file for TS10:
cfg-wurkkos-ts10-sammyshp.h
line 107-108:


#undef AUTO_REVERSE_TIME
#define AUTO_REVERSE_TIME (TICKS_PER_SECOND / 2)



1 Thank

Previously I tried (TICKS_PER_SECOND / 3) ,
it was not enough. (TICKS_PER_SECOND / 5) gives me the best result so far.
1H: ramping up. Release and immediately 1H again: ramping up. Very satisfying.

I’m curious on how people do that mod…
Is there a different method somehow?

me too, I much prefer the 1H always ramping up,
2H for ramping down.

1 Thank

me the same.
with 1H always ramping up it becomes much more intuitive to operate.

for me it’s a similar case with manual memory (knowing the level of brightness everytime before turning it on)

I couldn’t agree more…

from ON, 1H: ramping up. always.

it’s awesome :flashlight::flashlight::flashlight: :grin:

1 Thank

Glad I got some positive feedback. Such a modification would make me using Anduril again. Maybe it’s time for a survey?

1 Thank

It’d be easy to disable auto reverse for a custom build, probably just a few lines to change. At the moment there isn’t a feature flag for that, but it’d be fairly easy to put behind one. Personally I don’t mind auto reverse, I guess I never considered some people don’t like it (but then again, some people like 4C ramp → lockout :stuck_out_tongue_winking_eye:, and that’s one of the very the first things I changed )

1 Thank

my favorite is 12C, for momentary mode :grin:
I think I’ll change it to something like 1,012C :sweat_smile:

There was one some time ago, but it got replaced with the customizable timeout. Setting it to zero should have the same effect.

1 Thank

like this :

#undef AUTO_REVERSE_TIME
#define AUTO_REVERSE_TIME 0

is that gonna work?

currently, my setup:

#undef AUTO_REVERSE_TIME
#define AUTO_REVERSE_TIME (TICKS_PER_SECOND / 5)

I tried TICKS_PER_SECOND / 3 before that, it still had some auto_reverse
so it was some sort of trials and retries for me.

How many ticks in one second of a t1616 actually?
and different MCU’s have different number of ticks?

That depends on the configuration, thus we have TICKS_PER_SECOND.

Of course, you told it to wait 1/3 seconds until the direction is restored.

2 Thanks

I think I read it somewhere in one of the source files (I don’t remember which one), it’s mentioned 1 tick is 1/62 of a second. That does’t look like 20MHz (or even 3.33MHz)? attiny1616 is 20MHz right?

but yeah the number does’t really matter, a TICKS_PER_SECOND is one second.
10 TICKS_PER_SECOND divided by 5,
or 100 TICKS_PER_SECOND divided by 5,
they’re both 1/5 of a second (just with different number of ticks).

i don’t care how many ticks it is,
just gimme 1/5 of a second (200ms) :rofl:

so the MCU, the firmware, do care about the “ticks” , it’s their lingo :grin:

Now you know that I don’t know what I’m talking about :face_with_hand_over_mouth:

The code that interacts with it is if (arg == AUTO_REVERSE_TIME) ramp_direction = 1;, which is evaluated every EV_tick (default every 16ms) where arg is the number of frames since the current state or event started, so 0 should work AFAIK, but if not, just try 1 instead.

1 Thank

I’ll try that AUTO_REVERSE_TIME setting later.

I have another thing to “debug”.
I built hex files for my SC21 Pro, with multi-channel-r721. Reflashed OK. factory reset as usual.

test: everything is normal,
party strobe & bike flasher & firework mode: OK,
custom mode mappings work as good as before (as with hex file built with anduril2-r657).

basically everything is OK, except one:
tactical strobe mode: it doesn’t flicker at all, it’s steady like the regular ramp mode. it’s adjustable as usual though. can be adjusted to get the std “tactical” strobe. then tactical strobe mode works as expected.
but, after factory reset it’s back to the steady non-flickering tactical strobe mode.

my “cfg-sofirn-sc21-pro.h” file (it’s actually named cfg-0632.h to differentiate it from the standard/original multi-channel-r721’s cfg file) is a hodgepodge with some custom mods, that maybe the cause of the tactical strobe mode abnormality.

But I found something else:

anduril2-r657, strobe-modes.h file has this:

#if defined(USE_PARTY_STROBE_MODE) || defined(USE_TACTICAL_STROBE_MODE)
// party / tactical strobe timing
uint8_t strobe_delays[] = { 41, 67 };  // party strobe 24 Hz, tactical strobe 10 Hz
inline void party_tactical_strobe_mode_iter(uint8_t st);
#endif

while multi-channel-r721’s strobe-modes.h has this:

#if defined(USE_PARTY_STROBE_MODE) || defined(USE_TACTICAL_STROBE_MODE)
inline void party_tactical_strobe_mode_iter(uint8_t st);
#endif 

strobe_delays[] got moved to load-save-config.h for its default; most config did with the refactor to be more space-efficient.

https://bazaar.launchpad.net/~toykeeper/flashlight-firmware/multi-channel/view/721/ToyKeeper/spaghetti-monster/anduril/load-save-config.h#L105

1 Thank

thanks so much for pointing that out :+1:
I’ll look into that later when I get time.

If I can’t get it right it’s not a super big problem, I still have very good hex files from anduril2-r657 (will all the favorite mods).
I’ll probably try to adapt the fancy “version-check-mode” (XXXX-YYYY-MM-DD, using aux LED, with “buzz” of the main LED) from multi-channel-r721 to the a2-r657.
(is it called porting / backporting?). And the fancy batt-check and temp-check which have an option to use aux or main LED.

I’ve learned some from adapting/copying your firework mode. thanks again for that.

I have read a lot of the files of anduril2-r657,
not exactly know how everything works,
but at least knowing what works for custom mod mappings, firework mode, disable lightning mode, AUTO_REVERSE_TIME etc.

AUTO_REVERSE_TIME 0 doesn’t really work. It compiles OK. Flashed OK. But the light can’t ramp down; 1H and 2H both ramp up :scream:.
1 works great. the effect/feel is like TICKS_PER_SECOND / 5

TICKS_PER_SECOND / 5 is 1/5th of a second, right?
AUTO_REVERSE_TIME 1; what does 1 mean? 1 tick?

Yes.

1 Thank

My tactical-strobe abnormality

I built another hex file with anduril2-r657, and my tactical-strobe was broken as well, so it’s not about the multi-channel. :thinking::thinking::thinking:

My tactical-strobe abnormality, it’s from me messing with the strobe-modes.h, I changed the order of the strobes, separating party-strobe and tactical-strobe;

party-strobe
firework-mode
tactical-strobe
bike-flasher


Reedited strobe-modes.h, now it’s like this:


// rearrange the strobes?

#ifdef USE_STROBE_STATE
typedef enum
{

    #ifdef USE_PARTY_STROBE_MODE
    party_strobe_e,
    #endif

    #ifdef USE_TACTICAL_STROBE_MODE
    tactical_strobe_e,
    #endif

    ////////////////////////
    #ifdef USE_FIREWORK_MODE
    firework_mode_e,
    #endif
    ////////////////////////

    #ifdef USE_BIKE_FLASHER_MODE
    bike_flasher_e,
    #endif

// lightning and candle are disabled in
//   my cfg.h file.
//  now let's comment them out:
/* 
 *
    #ifdef USE_LIGHTNING_MODE
    lightning_storm_e,
    #endif

    #ifdef USE_CANDLE_MODE
    candle_mode_e,
    #endif
 *
 */

    strobe_mode_END
} strobe_mode_te;

const int NUM_STROBES = strobe_mode_END;

Now Strobe Modes are normal.

I’ll revisit my multi-channel build later.(especially regarding the tactical-strobe. as I thought it was because of me mixing/hodgepodging anduril2-r657 and multi-channel-r721, turned out it’s me rearranged the strobe modes inappropriately) :grin::grin: