Apologies for the longish post. If anyone with Anduril expertise could have a look at the code changes below, I would much appreciate it.
Background
I recently transplanted a lume1 driver into my FW3S. However, while doing that, I managed to damage the red AUX channel connection pad on the lume1 driver board so that I can’t use it any more. I’ve tried connecting a wire directly to the associated pin on the MCU, but it’s too small and I just can’t get a wire to stay on. I don’t want to damage the MCU by trying further.
So my initial thought was that I would have a lume1 FW3S with no AUX, which is still an improvement over the original driver.
However, I’m not satisfied by this. My next thought was to do the single channel AUX mod linked to here, however that would mean going back to the 1+7+FET driver.
Inspired by that, my current idea is to add a single channel AUX by using one of the remaining undamaged RGB channels on the lume1 driver and connecting it to only one of the channels on the lume1 AUX board (which one would depend on the colour I want for my single AUX channel).
I could do this by connecting only one AUX channel and just leaving everything else as-is, but that would leave me with a somewhat wonky UI – e.g. when I set the AUX, I would be cycling through all of the RGB colours but mostly seeing nothing except for when it gets to exactly the one colour I’ve connected. That would also be unsatisfying, so I’m now thinking about a custom Anduril hex with the proper single channel AUX settings.
Anduril 2 changes
Update: See full set of changes in reply post below
I would base my custom hex on the fw3x-lume1
tree and change various lines in anduril.h and hwdef.h. I would change the files to define a single channel AUX configuration like, for example, in the Wurkkos TS10 files.
anduril/hw/lumintop/fw3x-lume1/anduril.h
Here, I would remove this part:
// this light has three aux LED channels: R, G, B
#define USE_AUX_RGB_LEDS
// the aux LEDs are front-facing, so turn them off while main LEDs are on
#ifdef USE_INDICATOR_LED_WHILE_RAMPING
#undef USE_INDICATOR_LED_WHILE_RAMPING
#endif
and replace it with:
// this light uses single aux LED channel
#define USE_INDICATOR_LED
// the aux LEDs are front-facing, so turn them off while main LEDs are on
#ifdef USE_INDICATOR_LED_WHILE_RAMPING
#undef USE_INDICATOR_LED_WHILE_RAMPING
#endif
// default aux LED to high
#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 2)
I would also remove this part:
// use aux red + aux blue for police strobe
#define USE_POLICE_COLOR_STROBE_MODE
#define POLICE_STROBE_USES_AUX
#define POLICE_COLOR_STROBE_CH1 CM_AUXRED
#define POLICE_COLOR_STROBE_CH2 CM_AUXBLU
anduril/hw/lumintop/fw3x-lume1/hwdef.h
I would remove this part:
// this driver allows for aux LEDs under the optic
#ifdef FW3X_RGB_SWAP // wiring fixed by end user
#define AUXLED_R_PIN PA5 // pin 2
#define AUXLED_G_PIN PA4 // pin 3
#define AUXLED_B_PIN PA3 // pin 4
#else // Lumintop's factory wiring
#define AUXLED_R_PIN PA3 // pin 4
#define AUXLED_G_PIN PA4 // pin 3
#define AUXLED_B_PIN PA5 // pin 2
#endif
#define AUXLED_RGB_PORT PORTA // PORTA or PORTB or PORTC
#define AUXLED_RGB_DDR DDRA // DDRA or DDRB or DDRC
#define AUXLED_RGB_PUE PUEA // PUEA or PUEB or PUEC
and replace it with:
// front-facing aux LEDs only on the lume1 driver Green channel
#define AUXLED_PIN PA4 // pin 3
#define AUXLED_PORT PORTA // PORTA or PORTB or PORTC
However, here I am stuck with what to do with AUXLED_RGB_DDR
and AUXLED_RGB_PUE
, as , as I don’t understand what they are for.
Do I replace these with
#define AUXLED_DDR DDRA // DDRA or DDRB or DDRC
#define AUXLED_PUE PUEA // PUEA or PUEB or PUEC
or leave as-is, or remove?
Finally, I would change
inline void hwdef_setup() {
...
// Main PWM, Buck Boost Enable Pin, aux R/G/B
DDRA = (1 << CH1_PIN)
| (1 << CH1_ENABLE_PIN)
| (1 << AUXLED_R_PIN)
| (1 << AUXLED_G_PIN)
| (1 << AUXLED_B_PIN)
;
...
}
to…
inline void hwdef_setup() {
...
// Main PWM, Buck Boost Enable Pin, single-channel aux
DDRA = (1 << CH1_PIN)
| (1 << CH1_ENABLE_PIN)
| (1 << AUXLED_PIN)
;
...
}
Does that all look right?