You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By reading the EEPROM logger info this could be made automatic.
I propose making multiple options: Margay Logger(Model_1v0); Forces the logger instatiated to use the Model_1v0 parameters, or any other board options Margay Logger(Auto); Reads the serial number written to the EEPROM, checks the board type, and chooses the appropriate logger based on this. Should default to most recent production version.
Margay::Margay(board Model_)
{
if(Model_ == Auto) {
unsignedint Len = EEPROM.length(); //Define local shorthand for lengthunsignedint Val = (EEPROM.read(Len - 8) << 8) | (EEPROM.read(Len - 7)); //Get device ID bytes of SNswitch(Val) {
case0x4D00: //Check against serial number ID of model v0.0
Model_ = Model_0v0; //Overide model definitionbreak;
case0x4D01: //Check against serial number ID of model v1.0
Model_ = Model_1v0; //Overide model definitionbreak;
default:
Model_ = Model_1v0; //Overide with most recent production version
...
}
}
//Define model params as normal. Either using forced model name, or overwritten model name due to auto selectionif(Model_ == 1) {
...
}
elseif(Model_ == 0) {
...
}
Model = Model_;
}
Improve the way pinout is selected between various margay boards
The text was updated successfully, but these errors were encountered: