ToyKeeper / anduril

Anduril 2 Flashlight Firmware and FSM UI Toolkit
GNU General Public License v3.0
249 stars 62 forks source link

Request: SC31T Pro / Tail Clicky flashlight operation #101

Open fiveseven808 opened 2 months ago

fiveseven808 commented 2 months ago

I just built a SC31T Pro with a new SC31 Pro and an SC31T and flashed the SC31 Pro with the binary here: anduril.2022-08-05.sofirn-sp36t-t1616.hex

It works great! BUT I want to expand on this, seeing as Anduril now has Off->6C for tactical mode, I want to launch straight into it for tail clicky anduril lights.

Expected behavior:

I understand that to measure the time between clicks there needs to be an Off-Time Cap (OTC as referred to in older TK firmwares). Since this would require a hardware mod to work in the same fashion we can rule this mode of operation out for now

Instead what I want is, instead of START_AT_MEMORIZED_LEVEL being the default for tail clicky lights, I want to START_AT_TACTICAL_LEVEL1. That way so long as the flashlight is "off" there's never a question as to what level the flashlight will start up on since it will configured in a separate menu rather than the normal ramp.

Ideally, I'd want this configurable as well. I.e. If people like the old operation, a menu item would disable this flag. Disabled with 10H from tactical mode then 1C to set or unset perhaps?

Since the configuration menu sounds difficult to implement, Ideally I'd like to just figure out how to START_AT_TACTICAL_LEVEL1.


Revisiting the OTC issue... The SC31T tailcap is curious. It appears, like lighted tailcaps that the SC31T tailcap isn't a hard circuit break, but it's in parallel with a leakage resistor that can supply enough current to the MCU and aux LEDs.

This means the operation is as follows: Start from flashlight off. Aux lights are off.

  1. Tailcap Switch on
  2. Push side button to turn off-> Aux LEDs turn on
  3. Lock flashlight with 4C -> Aux LEDs begin the flashing animation
  4. Tailcap Switch off
  5. Observe Aux flashing animation still on

This implies that the leakage current is enough to keep the MCU running and power the Aux so that it can do high-brightness (kind of). The high brightness flash part of the flashing aux animation seems to struggle a little compared to when the tailcap switch is on.

This may be a bit of a hack, but would it be possible to monitor battery voltage during this Tailcap Switch off state, and measure the time until the flashlight turns back on (full battery voltage). I don't know what the battery voltage looks like through the leakage resistor and the anduril MCU on, but it's curious that there is a separate sort of mode that the anduril MCU exists in between completely off and aux LEDs doing it's thing-off.

It would be more complicated but it might be possible to measure the time in between battery voltage changes (due to rear clicky presses) in the SC31T Pro as a substitute for an OTC to measure the off-time for multi-mode tailcap switch changes.

fiveseven808 commented 2 months ago

Another idea instead of linking the hypothetical START_AT_TACTICAL_LEVEL1 which appears to be linked to lvl = cfg.tactical_levels[click-1]; where click = 1?

How about, if START_AT_MEMORIZED_LEVEL is defined, we can also save turbo as memorized_level. Operation would be

  1. Turn light on
  2. 2C -> Turbo
  3. Tail switch off
  4. Tail switch on (goes directly to turbo, as it's saved in memorized_level)

That way there's no weird inconsistency with how it works right now, and it make it very easy to get the tail switch operation back to turbo/ceiling after possibly using it in lower momentary modes.

Not sure where I would add in a save for memorized_level though.