This adds all the things necessary for complete save support; expanding data coverage to all the adjustable aspects of the gun--including pin mapping, toggleable booleans, other settings, and TinyUSB identifiers pulled from the EEPROM.
This also adds the backbone for remote board configuration using serial, under new categories:
Xc clears the EEPROM, which will be helpful for either initial boot or upgrading from either older builds or other projects that uses the virtual EEPROM provided by Earle Philhower's core.
Xm is used for updating the aforementioned gun settings using the Xm.x.y.z format, where;
x is the type of data being updated (0 = bools, 1 = pins, 2 = expanded preferences, 3 = tinyUSB ID stuff)
y is what data to update (what bool, what pin, what pref, which part of the tUSB ID)
z is the new value to assign to the data
Just typing Xm will print out exactly what's configurable, much like a Unix program's --help dialog.
Xp loads preferences from EEPROM into memory and prints it out in a neat table, mainly for debugging.
Expanded EEPROM stuff is saved along with the normal profiles using the typical SavePreferences() method, or can be called directly using the new function ExtPreferences(false) (boolean determines whether it's a save or load operation, to minimize code duplication).
For now, this does not cover flash saveram-based devices, causing builds to fail on anything but RP2040 - though since the project primarily targets Pi Pico and its derivatives, which doesn't use an external flash, it's well within board. If anyone wants to fix flash-enabled devices, all that needs to be done in theory is add/expand the flash extended save stuff in SamcoPreferences.c/h.
Quality of code isn't the cleanest, but has worked for my test devices.
Note that for TinyUSB identifiers, we handle that directly in the main SamcoEnhanced.ino sketch (currently in TinyUSBInit() method and the fourth tier of Xm-type settings in SerialProcessing().
Variables that used to be bytes are now unsigned integers, to make saving/loading from EEPROM easier.
This also adds some miscellaneous fixes back into the main code, and formalizes Low Buttons Mode (a macro for making A/B turn into Start/Select when aimed offscreen).
This adds all the things necessary for complete save support; expanding data coverage to all the adjustable aspects of the gun--including pin mapping, toggleable booleans, other settings, and TinyUSB identifiers pulled from the EEPROM.
This also adds the backbone for remote board configuration using serial, under new categories:
Xc
clears the EEPROM, which will be helpful for either initial boot or upgrading from either older builds or other projects that uses the virtual EEPROM provided by Earle Philhower's core.Xm
is used for updating the aforementioned gun settings using theXm.x.y.z
format, where;x
is the type of data being updated (0 = bools, 1 = pins, 2 = expanded preferences, 3 = tinyUSB ID stuff)y
is what data to update (what bool, what pin, what pref, which part of the tUSB ID)z
is the new value to assign to the dataXm
will print out exactly what's configurable, much like a Unix program's --help dialog.Xp
loads preferences from EEPROM into memory and prints it out in a neat table, mainly for debugging. Expanded EEPROM stuff is saved along with the normal profiles using the typicalSavePreferences()
method, or can be called directly using the new functionExtPreferences(false)
(boolean determines whether it's a save or load operation, to minimize code duplication).For now, this does not cover flash saveram-based devices, causing builds to fail on anything but RP2040 - though since the project primarily targets Pi Pico and its derivatives, which doesn't use an external flash, it's well within board. If anyone wants to fix flash-enabled devices, all that needs to be done in theory is add/expand the flash extended save stuff in
SamcoPreferences.c/h
.Quality of code isn't the cleanest, but has worked for my test devices. Note that for TinyUSB identifiers, we handle that directly in the main
SamcoEnhanced.ino
sketch (currently inTinyUSBInit()
method and the fourth tier ofXm
-type settings inSerialProcessing()
. Variables that used to be bytes are now unsigned integers, to make saving/loading from EEPROM easier.This also adds some miscellaneous fixes back into the main code, and formalizes Low Buttons Mode (a macro for making A/B turn into Start/Select when aimed offscreen).
Closes #18