EdgeTX / edgetx

EdgeTX is the cutting edge open source firmware for your R/C radio
https://edgetx.org
GNU General Public License v2.0
1.45k stars 310 forks source link

feat(color): customizable switch UI support #5025

Open 3djc opened 2 weeks ago

3djc commented 2 weeks ago

Add custom switch UI support to main branch.

Hardware support was already introduced as part of adc refactor

pfeerick commented 2 weeks ago

I have no problem with fd52437 being reverted... while it does reduce the amount of repetition, I think it starts to blur the lines between driver and UI/helper code too much... It seems like instead of via includable headers for files like led_driver, some function protos are declared in board.cpp as needed? Some protos are in the wrong place though... as getFSLogicalState getFSPhysicalState , getFSPreviousPhysicalState and evalFunctionSwitches are all defined in switches.cpp, but not declared in switches.h

3djc commented 2 weeks ago

Not sure I'm following your comment @pfeerick . Seems to me it is now, thanks to Philmoz changes, quite nice

pfeerick commented 2 weeks ago

Not sure I'm following your comment

Why were getFSPhysicalState , getFSPreviousPhysicalState and evalFunctionSwitches declared in board.h instead of switches.h?

I can see why

void fsLedOff(uint8_t);
void fsLedOn(uint8_t);

were since there is no other header defining them.

3djc commented 2 weeks ago

History (or copy/paste of history). i think having those under switches.h like Phil changed is much better, but I think we all violently agree :D

pfeerick commented 2 weeks ago

Like I changed, actually :laughing: Ok, good, just wanted to make sure I wasn't missing something. Think I will need to move fsLedOn / fsLedOff / getFSLedState back into board.h as they actually come out of led_driver.cpp, but the rest can stay where they are.

3djc commented 2 weeks ago

My appologies ! No no makes a lot more sense this way.

pfeerick commented 1 week ago

Nice! :)