Flashlight Firmware Repository

OK I’m done for tonight I’ll have another crack at this tomorrow.

I’ve even tried adjusting MTN-Mom as it has temp sensor so any input would shut off but no luck so far.

Yes, but… what happens if you power up the light without the charger attached? It needs to distinguish between either of these two…

  • Charger isn’t attached.
  • Charger is attached but not powered.

… and this:

  • Charger is attached and powered.

Earlier it sounded like “attached and powered” gave the same result as “not attached”, which isn’t very useful.

Given a way to distinguish those different states, making it change while on isn’t terribly difficult.

but the charger will always be attached…. When i say charger, I am referring to the X6R charging circuit, not the actual charging cord

… oh. Then that definitely makes things easier. :slight_smile:

Sometimes I over-complicate things.

I’ve spend a good few hours today playing with this trying different tweaks on different firmwares.

Best I go was tweaking MTN_momentary_temp so that if the temp sensor reads 255 then mode_idx = 0 when I had the if, else the wrong way round it would just set mode to 0 when ever I tried to change mode but when they were to correct way round I just got very odd mode changes.

Hi TK,

Someone asked me to flash some micros for him with this firmware.
http://bazaar.launchpad.net/~toykeeper/flashlight-firmware/trunk/files/head:/ToyKeeper/blf-a6/cypreus2/

His boards are not the FET+1 so my question is will this firmware work with a regular FET driver?

I was thinking maybe if I disable the second channel and change the PWM values for the first?

Or is it more complicated than than?

It should work on a FET-only driver if you disable moon and replace all the 7135 modes with FET modes and recalculate the levels and recalibrate the OTC and voltage values.

I have been making some progress with this Pin3 turn off. The code here turns the light off when the usb cable is connected. :slight_smile:

It does have a bug tho. Once it’s turned the light off and you unplug the charger cable it will allow you to change modes then turn off again after .5s

EDIT: Made one last tweak and now it works!!! Code HERE

I’ve added an extra beacon mode, very long press to activate.

But hey it’s getting there. (BTW voltage monitoring is switched off atm so I know its not interfering with turning off ect…)

Sweeeet. I’m excited to try it this afternoon. When you unplug the cable, does it automatically come on, or do you need to press switch?

press switch and it comes back on. Sometimes it needs a moment to check its unplugged but i think if we just reduce the ticks it will be ok.

hmm did you try it with or without a resistor on pin3?

I flashed the one in the second link above and it isn’t reacting to the charger cord. I do have a resistor on it.

I’m using a 4.3v zener

I see you retained a lot of the temp monitoring code. I wonder if we can clean it up so that it’s essentially “If it’s connected, off. If it isn’t connected, on” (as it is now, I have no idea what’s actually going on in that code :bigsmile: )

I’ve tried to strip lots out but I kept loosing the functionality. Maybe somebody else might have better luck. If it’s not working you should only need to reduce the charger high and low values to lower ones.
I’ll have another go at reducing the code during the week, I’m just glad I got it to work.

:beer: yep well done. glad it is working for you. I have a few things to work on before it fits my usage. I’m hoping TK get’s a chance to look at it when her X6R arrives

Yeh, I’m sure that she’ll be able to clean it up a bit and polish it off.

I must be going insane. I’ve tried a wide range of values with no love.

I’m to the point where I would pay someone to just get this FW working for me as a whole.

I haven’t ordered a X6R yet or the driver / parts to upgrade it, but I might be able to get something working anyway.

You have no idea how appreciative I would be. I was hoping to have this light ready for my grandfather’s birthday… That was yesterday. Oops.

Wonder why it’s not working for you? Have you tried bypassing the resistor? I’m sure what ever TK comes up with will be much more elegant that what I have.