Well, I'm trying to develop a basic LCD-and-buttons interface - and no matter what optimization techniques I use, the code size bloats unreasonably - it's already bigger than the functional part, and that's just for implementing a user interface! What I'm going to have is a button set like this:
[ ^ ] [Mode] [<] [Set] [>] [ v ]
A HD44780 based LCD will display a few user changeable settings like this:
|Parm1:A|Parm2:B | |Parm3:C|Parm4:D |
The [Set] button makes a setting blink, [Left]/[Right] buttons change the blinking setting, and [Up]/[Down] change the setting value. The [Mode] button changes the whole screen to another set of settable values. What I'm stuck with is a reasonably sized code to handle the stuff happening on LCD - blinking the values (redrawing values on timer), changing and outputting right values, etc. I use most code optimization techniques (like grouping global vars in structures, avoiding globals at all if possible, etc), but I still have a gut feeling I'm very wrong with my ideas. In the end it all boils down to throwing in a load of "ifs" to handle all possible conditions, and there must be a neater way.
Is there an open source project including some sort of LCD based UI that I could check? Maybe I'm just an idealist, but I just can't have that beast written the way it's now.