Open markusgrosser opened 3 years ago
DL1YCF's comment: This looks useful, although I generally do not prefer calling callback functions from outside. But avoiding this would imply a major re-write of toolbar.c (creating separate functions, callable from outside, for doing the work, and calling them from the callbacks).
Unifying the MIDI and GPIO code is desirable in any case, but this would also imply a major re-write, since the code is compiled with MIDI but without GPIO on many machines. So GPIO alerts and the "real work done" must be separated to have the "real work" also done via MIDI. Just to give one example, vfoFunctionAlert() must remain in gpio.c, but vfo_function_pressed must be moved elsewhere in this case.
This is, in short, the reason why many of the GPIO functions have no counterpart in MIDI.
This also moves parts of toolbar control from
gpio.c
toext.{c,h}
, so that it can be used bymidi3.c
without duplicating everything.