Flashlight Firmware Repository

1: I am not sure how to use the BRZ diff but I will try to look it up. That said I have not changed anything in the code at this point besides coping the D4S HWdef and config files and adding them to the build script as new drivers. I then copied the ramp from narsil and that is basically it at this point besides a few define changes in the config file.

Would the THERM_WARNING_SECONDS effect the step up as well? It steps down perfectly. The issue is that it will then step back up even when it is WELL over the set temp limit (such as a self reported 90-100C vs the 45c set point).

2: Great! Once they are updated I will update my code and see if it works better.

3: I was not even aware most of these options existed, I will try to look them up. An example of why a GUI can be nice, poking around menus can show you these types of options and it handles all the syntax and usage methods for you. :wink:

4: I have read that the calibration is not optional a few times? Is every D4 manually calibrated before it is shipped? I can’t figure out how calibration could be the reason that it allows the light to ramp back up even when the temperature is at a self reported 90c+? This is the root issue that I have, it steps up even when WELL above the max temp it should allow by it’s own blink out. If it would just stop ramping the power up when above say 10-20% above the set temp, then it would be fine but it just keeps ramping until the temp is over 100c.

I have calibrated my light and the results were the same BTW, just 2-3c more accurate.

I am really liking what you have done with Anduril so far, the thermal runaway is the only issue preventing me from using it at this point since that is dangerous. The other features that were mentions are just icing on the cake. :partying_face:

Umm… I have a question. If I’m trying to set the thermal limit on my Q8 with NarsilM 1.0 and it never reaches “hot” state, is there a way to exit without saving the state (at too cool a level)? Or, will I have to take it as it is, then recharge my cells, and try again, attempting to find some way to get it hotter? I am in my house, where ambient temp is 69F right now, but I want to calibrate the Q8 for a higher temp, because I might be using it in the summer, when outside ambient temps can still be around 80F or more after dark. I have the light in thermal config mode, waiting for it to get hot. I’m afraid the cells may run down too much before the light gets hot enough. According to voltage check in the Q8, it was at 3.7V before I started thermal config.

Always do thermal config at full battery.

Yeah, I didn’t think about it until I was already a few minutes in, and the head had only got to “just warm” and now I’m thinking I have to start over. :person_facepalming:

But, I have to make sure my cells are at full power, and do it when I have time to wait around for it to get hot. I didn’t know it would take so long to heat up, but I’m glad it does! Meanwhile, I don’t want to retain this “failed” setting if there’s a way out of it. :wink:

The temp started dropping, so I just shut it off. I’ll try again later. I’d still like to know the answer, if someone will tell me. Is there a way out of thermal config without saving state, if “waiting” needs to be cut short for any reason?

What you just discovered is the reason I like anduril… Just set the thermal limit, at an exact temp, with a series of clicks.

Yeah, I saw discussion about that. It would be nice, but it’s not the way Narsil works, and I don’t have the ability to re-flash the driver. :weary:

I have a general question about the modes in the firmwares.

I’ve read the code of several firmwares in the repository to understand how “multiple-clicks” function works for e-switches.

All of them had the same technique of counting clicks each time the button is not pressed and press-duration > 0.
So for the simplest UI of: 1 click = ON/OFF and 2-fast-clicks = TURBO :
When you double click (and the light is initially ON), first of all - the light turns OFF and then moves into TURBO mode.
Am I right or missing something?

What I don’t get is how do you distinguish a single click from multiple clicks? Because from what I can see, the firmwares in the repo, always run the code for 1-click, and when multiple-clicks detected, it’s code will run in addition to the 1-click code.

Thanks :slight_smile:

FSM solves that issue. Using this UI toolkit, it does not do the 1-click code before the 2-click code or the 3-click code… unless you specifically tell it to.

On some FSM-based interfaces, it intentionally goes to the 1-click level before going to the 2-click level, but it’s not a side effect. It only does that if it’s instructed to do so on purpose. Otherwise it’ll wait until the user is done clicking before it responds. For example, the Baton clone UI demonstrates both methods.

Thanks for the reference :slight_smile:
It’s an interesting implementation, ill test on my diving light soon

TK
I wanted to flash Anduril in my D4 with xpl-hi. But what does the lower muggle ceiling mean? I found it here

That was a one-off special build because someone requested a version with muggle mode limited to ~150 lm.

Thanks for this. This is exactly what I needed after I enabled some additional code in Anduril for dual switch support. I ran out of space and couldn’t make sense of the compile options I was missing in Atmel Studio. Now it compiles without issue!

Texas_Ace, were you ever able to suss out those problems with the GT70 style driver and Anduril? I’ve been researching a lot, and trying to find a way to get Anduril onto my GT70, but am not coming up with much information unfortunately.

Are Anduril inputs and outputs assigned to the same ports as Narsil and bistroHD?
Narsil:

bistroHD:

And Anduril?

Yes

Check the individual hwdef files to see how the pins are mapped for different types of hardware:

https://bazaar.launchpad.net/~toykeeper/flashlight-firmware/fsm/files/head:/ToyKeeper/

/* BLF GT driver layout
* ----
* Reset -|1 8|- VCC (unused)
* eswitch -|2 7|- Voltage divider
* AUX LED -|3 6|- Current control (buck level)
* GND -|4 5|- PWM (buck output on/off)

/* Emisar D4 driver layout
* ----
* Reset -|1 8|- VCC
* eswitch -|2 7|-
* AUX LED -|3 6|- PWM (FET)
* GND -|4 5|- PWM (1x7135)

/* Fireflies ROT66 driver layout
* ----
* Reset -|1 8|- VCC
* eswitch -|2 7|- optic nerve
* FET -|3 6|- 7x7135
* GND -|4 5|- 1x7135

As always very helpful. Thanks a lot!

I actually do have some experience in programming Arduinos but I am quite lost in the repository.
Could somebody point me out which files I would need to compile the code for the FW3A?