Because there is no interface to allow testing by just directly sending G code to the printer, I was putting code for the extension board in machine start, as the example show.
While testing the buzzer I canceled the print, not wanting to print anything. The buzzer was on at the time I canceled and it just stayed on.
During normal printing, when I cancel a print the printer performs a set of actions, such as parking the print head and lowering the bed. Is this defined somewhere that can be modified?
Handling end of print with machine end code and resetting any settings for the expansion board as necessary makes sense. However, I wonder if any extension board actions might be left in progress when canceling a print and with bad results. For example if a stepper motor is running and the print is canceled, not stopping the stepper could have many results that are not expected.