E-switch UI Development / FSM

If you want an indicator LED on a D4, edit the D4 config file to copy a few things from the Q8 config file. These are probably the options of interest:

// the button lights up
#define USE_INDICATOR_LED
// the button is visible while main LEDs are on
//#define USE_INDICATOR_LED_WHILE_RAMPING
// enable blinking indicator LED while off
#define TICK_DURING_STANDBY

The “while ramping” option should probably be off, if the aux LED is under the optic instead of the button.

Thank you TK! I thought I will put there a warm white led but with the off while ramping option I can put there anything.

Thanks for the clear explanation, TK!

Although I’m still not sure if 0xDE is used, any idea how much would be the power draw versus when it’s just 0xDF.

In stock form for BLF Q8 versus Q8 running Anduril, would there be an increased power draw when OFF?

Having BOD on increases standby power by about 20uA, I think. Or 25uA. Or something like that. So, for a Q8 with the button light off, it’s like 2uA vs 22uA. Or with the button light on, it’s like 100uA vs 120uA. These are rough estimates though. With the button set at a lower brightness, it’s closer to 30uA.

Narsil vs Anduril doesn’t make much difference in standby power draw. The main bits which are relevant are whether BOD is enabled, and whether the button is lit up.

Plus, Anduril can run the button at a lower brightness level if desired. And it goes to sleep a few seconds earlier. And if you enable tick during standby, the button can blink, which is basically 1/8th as much button-related power as the high brightness setting.

In all cases though, standby power is pretty negligible on a Q8.

Thanks again for the informative reply.

I have a few other minor questions, maybe they’re already answered somewhere but I haven’t been able to sift through the messages.

a) candle mode timer: by default, when set to candle mode, then flashlight is in candle mode indefinitely until user clicks to change mode or the batteries get drained; doing a triple-click adds a +30 minutes timer.

my question is (I haven’t been able to actually do a timed testing), the +30 minutes timer is added from the time the triple-click is initiated?
That is: set flashlight to candle mode, then triple-click, this causes the flashlight to stay in candle mode for 30 minutes (on the 29th minute it dims down and sputters before the flame dies).

Now what if I have already done the triple-click, then let’s say on the 20th minute of the previous timer, I do another triple-click, that means, the timer gets reset to 30 minutes again right? Or is it 10 minutes (previous timer still has 10 minutes remaining) + extend another 30 minutes, so that makes it total 40 minutes?

b) the 2 blinks when ramping

I’m still a bit new to Anduril (I just got the Emisar D4 recently, and notice it has a very fast blink while ramping up or down. I noted that the “blink” exactly occurs at the regulated level — which is the exact level when re-placing a new battery inside the D4, the max regulated level where there’s No PWM.

In Anduril, there are 2 blinks in between while ramping. From what I understand, the first blink (lower) occurs at the max regulated output. So this is exactly the same as the blink in the stock D4.

My question is about the second blink (while nearing the top brightness). I think it’s called the “ceiling”, but I’m not sure yet what level this is, or is it just the configurable ceiling?

c) question about shortcuts to Moon and Turbo (when ramp floor is set higher).

In ramping mode, the lowest level (“floor”) and highest level (“ceiling) can be configured by the user thru the Ramp Config. So the lowest level can be higher than Moon (lowest possible output) while the highest ramp level can be lower than the Max Brightness (ie. Turbo).

In case the flashlight’s ramping floor and ceiling has been set to higher-than-Moon and lower-than-Turbo, the shortcut to Turbo is to double-click.
And the shortcut to Moon, when the flashlight is Off: Hold the button until it turns on in the lowest Moon mode.

My question is: if the ramping floor (memorized level) is set to higher-than-Moon, and the flashlight is currently in the ON state (“Steady” mode), is there a way to go to Moon (lowest) brightness mode?

d) Good night / Sunset mode (how does it work?):

- I have yet to test this out, just curious about the brightness ramp down (eg. how many steps brightness level ramp down, spaced for how many minutes each) for “good night” mode? (I suppose if I can read and understand the source code, the “program flow” of how it works should be there…)

e) BattCheck (voltage blink out differs from stock vs Anduril?):

I’m not very sure, but it seems that while my BLF Q8 was in stock mode, I can get BattCheck readings of 4.1v (4 blinks, then 1 blink) when the batteries are nearly fully charged.

But now after flashing to Anduril, when I do a BattCheck, I can get readings of up to 4.3v (4 blinks, then 3 blinks) — is the BattCheck changed when flashing from the stock NarsilM v1.0 (for Q8) compared to Anduril for Q8 (I used the current 2018-07-01 hex file)?

f) Is there a way to “reset” to a baseline configuration, in case the various settings have been “messed up”?

BLF member steel_1024 has posted more photos of the GT mini, including disassembly.

I think this is our first glimpse at the driver:

Does this get us closer to an Andúril build for the GT mini? :wink:

I also wish to try Andúril.

But I still have no time to study the information.

:slight_smile:

ToyKeeper is traveling right now, but she seemed optimistic about the GT mini being capable of Andúril.

TA said it should be no problem to port Andúril to the GTmini

I got errors when compiling the latest anduril like “anduril.elf section `.text’ will not fit in region `text’. How do I solve this?

Use the provided bin/build-85.sh script, or copy the compiler options from it, or remove some code to make it fit.

The builds are optimized for size as much as possible, which is not the compiler’s default behavior.

Hi everyone, I’m trying to build anduril in Armer studio 7. I have placed all the necessary files in the project folder. When I click build I get an error: redefinition of ’uint8_t eeprom [14] clicking on the error takes me into the fsm-eeprom.c file. I’m so close can anyone help? I’d love anduril for my emisar d4!

Thanks guys

Frank

It’s recommended to download the entire repository and keep it organized in its original layout. This may help with the build errors. The build scripts use command line tools though, instead of Atmel Studio, so there will still be some configuration to do before a build will work.

Unfortunately, Launchpad still doesn’t have a “download branch as zip” function, and might never have such a thing. So the easiest way to get a complete copy is to use bzr and have it create a local branch.

Are you building a .hex yourself because you want to make changes to the code?

If not, you can simply use the .hex files ToyKeeper has pre-built for several lights.

Thank you Toykeeper. I only have a windows machine with Atmel studio so I may be out of luck as I can’t run the build scripts. I assume they are Linux.

Thank you goshdogit. I use the AVR burn o matic GUI for avrdude. It asks for the hex file and the .eep EEPROM file. So the reason I am trying to use atmel studio is so I will also have the eeprom file. Is there another way to flash without it? I appreciate your help!

Lots of folks use AVRDUDE to flash drivers, available here. I run it from the command prompt of my Windows 7 machine.

First, I use this command to verify that my programmer is connected properly to the driver:

Second, I use this command to reflash the driver with a new .hex file. I use the ‘fuse values’ suggested by ToyKeeper. Change the “ANDURIL.hex” to your .hex file’s name.

I’m not familiar with the GUI you’ve mentioned, so I’m going to check it out now.

You already have your programmer and its drivers working, correct?

I just found another GUI for avrdude called avrdudess I’m messing with it now. Yes my programmer and drivers are all good. I’ll try flashing just the hex file but for some reason I thought I had to flash the .eep file as well.

goshdoggit said it perfectly.
The only thing I can add is an example of what to paste into the avrdude command prompt.
This is the fuse for Biscotti.
avrdude -p t13 -c usbasp -u -Uflash:w:biscotti.hex:a -Ulfuse:w:0x75:m -Uhfuse:w:0xFF:m
This is pasted into here.

Hope this helps.

Success! The AVRDUDESS GUI worked great. The Anduril firmware is spectacular I love my Emisar D4 so much more now. Thank you all very much for the help. Toykeeper thank you for the great firmware!

Frank