Trasselfrisyr / NuEVI

Electronic Valve Instrument – MIDI controller based on the Teensy 3.2
GNU General Public License v3.0
54 stars 11 forks source link

Config management mode #32

Closed jstck closed 5 years ago

jstck commented 5 years ago

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:

jstck commented 5 years ago

⏳ 💤 ❓