The approach was
a) Split up the CoolantMode enum, which had become complicated because
it was trying to solve two incompatible requirements, into two
enums GCodeCoolant (a pure enumeration for the use of the GCode
parser) and CoolantState (a bitfield for runtime use where
independent turn-off is possible via overrides)
b) Fixed coolantsetstate() so it can turn off coolant bits
independently. Previously it could turn them on independently,
but only turn them off simultaneously. That was fine for M7 M8 M9,
but inadequate for realtime coolant overrides.
c) In the process, I refactored the code in CoolantControl.cpp with
the goal of “saying things once”, thus reducing the number of
ifdefs. When we have the Pin class, the ifdefs will be reduced
even more, perhaps even eliminated. Meanwhile, this cleans up the
code and probably makes the transition to Pins easier.
d) I also fixed a bug in Report.cpp in which it was not possible to
report both M7 and M8 at the same time.