If up+down buttons are held during startup, NuEVI goes into "config management mode". Once there, it can send and receive MIDI SysEx messages (via USB MIDI only) with EEPROM config as well as firmware version status.
The config mode bypasses large parts of setup() and replaces loop() entirely, to not have anything else messing with it, so it will not "play" whatsoever. To exit this mode, the device has to be restarted.
The received config is sanity checked, the sysex message contains a crc32, the payload size needs to match the EEPROM config size, and the EEPROM version field needs to match the one used by the firmware. It does accept any value though, but invalid ones will get "corrected" upon next bootup by readEEPROM().
The exceptions are the sensor calibration values, where any "out of bounds" value will be ignored. This is to avoid changing the calibration if copying settings between devices, where it would be appropriate to set those values to 0x7f7f.
Also fixes the simulator argparser so --help works (as well as less unhelpful messages for invalid parameters). Something is very wonky with exceptions (many of them just cannot be caught) so they are avoided altogether.
Things missing and/or in need of thorough review:
More detailed specs of SysEx command format
Simulator should have a way of injecting MIDI data
A bunch of things should probably have a more appropriate amount of static and/or const (@blind !)
The structure of the SysEx data should be more nicely #defined.
If up+down buttons are held during startup, NuEVI goes into "config management mode". Once there, it can send and receive MIDI SysEx messages (via USB MIDI only) with EEPROM config as well as firmware version status. The config mode bypasses large parts of
setup()
and replacesloop()
entirely, to not have anything else messing with it, so it will not "play" whatsoever. To exit this mode, the device has to be restarted.The received config is sanity checked, the sysex message contains a crc32, the payload size needs to match the EEPROM config size, and the EEPROM version field needs to match the one used by the firmware. It does accept any value though, but invalid ones will get "corrected" upon next bootup by
readEEPROM()
. The exceptions are the sensor calibration values, where any "out of bounds" value will be ignored. This is to avoid changing the calibration if copying settings between devices, where it would be appropriate to set those values to0x7f7f
.Also fixes the simulator argparser so
--help
works (as well as less unhelpful messages for invalid parameters). Something is very wonky with exceptions (many of them just cannot be caught) so they are avoided altogether.Things missing and/or in need of thorough review:
Simulator should have a way of injecting MIDI datastatic
and/orconst
(@blind !)#defined
.