Anduril ... 2?

@ToyKeeper

Fixed the fw3x-lume1 bug.

Need to add to the hwdef:

#define USE_CONFIG_COLORS
#define DEFAULT_BLINK_CHANNEL CM_MAIN

Now onto the bug itself, because I found it interesting:

DEFAULT_BLINK_CHANNEL needs to be defined for 3C in battcheck mode to work. Otherwise, what happens is when in battcheck mode, the 3C handler from channel-modes.c gets called instead (as channel mode state exists under other states) which causes the light to blink to acknowledge it, and move to the ‘next’ channel, except by default only one channel mode is enabled, so it wraps back around to CM_MAIN. Due to this, if you enable an aux channel in the 9H from on menu, then do a 3C in battcheck, it works, but only because it changes the selected channel mode (i.e. for ramp mode, etc).

This is kind of ugly, but also optimal in terms of code size. One alternate fix would be to make the channel_mode_state 3C handler check state and only work when not in battcheck state, so battcheck mode’s 3C handler will be guaranteed to be called or nothing will.

Alternatively, you could just add somewhere (maybe in channel-modes.h?), this:

#if NUM_CHANNEL_MODES > 1 && !defined(DEFAULT_BLINK_CHANNEL)
  #define DEFAULT_BLINK_CHANNEL 0
#endif

Which solves the issue by making it impossible to happen, without any extra image size, by always defining a blink channel as 0 (the first channel) if not already set in the cfg.h.

Another fix would be to change the ifdefs in battcheck-mode.c from #ifdef DEFAULT_BLINK_CHANNEL to #if NUM_CHANNEL_MODES > 1 instead.

Here’s a hex for anyone else interested (@Noir): 31.3 KB file on MEGA

2 Thanks