-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handling new restrictions separately.
- Loading branch information
Zer0-bit
committed
Apr 13, 2023
1 parent
25846bb
commit ddd146a
Showing
11 changed files
with
160 additions
and
19 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
/* 09:32 15/03/2023 - change triggering comment */ | ||
#ifndef EEPROM_DATA_V6_H | ||
#define EEPROM_DATA_V6_H | ||
|
||
#include "../eeprom_data.h" | ||
#include "../eeprom_metadata.h" | ||
|
||
/** | ||
* current data version definition below | ||
* | ||
* changing the schema requires bumping version number. this forces a schema update | ||
* on boards with a lower version after flash. to make this graceful for users: | ||
* - archive the current version in its corresponding header in legacy/ | ||
* - in that header, make sure to register the upgrade function for | ||
* the loader to pick it up | ||
* - bump up the version in eeprom_metadata.h | ||
* - make schema changes | ||
* | ||
* adding fields to data below shouldn't require changes to legacy upgrade | ||
* functions - they just won't populate the new field, and it will use | ||
* default value. | ||
* | ||
* removing fields might require deleting assignments in existing legacy | ||
* functions that reference them. this will pop up as a compile time failure | ||
*/ | ||
|
||
/** | ||
* Version 6: | ||
* - Pressure as float: | ||
* - pressureProfilingStart | ||
* - pressureProfilingFinish | ||
* - preinfusionBar | ||
* - preinfusionFlowPressureTarget | ||
* - flowProfilePressureTarget | ||
*/ | ||
struct eepromValues_t_v6 { | ||
uint16_t setpoint; | ||
uint16_t steamSetPoint; | ||
uint16_t offsetTemp; | ||
uint16_t hpwr; | ||
uint16_t mainDivider; | ||
uint16_t brewDivider; | ||
float pressureProfilingStart; | ||
float pressureProfilingFinish; | ||
uint16_t pressureProfilingHold; | ||
uint16_t pressureProfilingLength; | ||
bool pressureProfilingState; | ||
bool preinfusionState; | ||
uint16_t preinfusionSec; | ||
float preinfusionBar; | ||
uint16_t preinfusionSoak; | ||
uint16_t preinfusionRamp; | ||
bool preinfusionFlowState; | ||
float preinfusionFlowVol; | ||
uint16_t preinfusionFlowTime; | ||
uint16_t preinfusionFlowSoakTime; | ||
float preinfusionFlowPressureTarget; | ||
bool flowProfileState; | ||
float flowProfileStart; | ||
float flowProfileEnd; | ||
float flowProfilePressureTarget; | ||
uint16_t flowProfileCurveSpeed; | ||
uint16_t powerLineFrequency; | ||
uint16_t lcdSleep; | ||
bool warmupState; | ||
bool homeOnShotFinish; | ||
bool graphBrew; | ||
bool brewDeltaState; | ||
bool switchPhaseOnThreshold; | ||
bool basketPrefill; | ||
int scalesF1; | ||
int scalesF2; | ||
float pumpFlowAtZero; | ||
bool stopOnWeightState; | ||
float shotDose; | ||
float shotStopOnCustomWeight; | ||
uint16_t shotPreset; | ||
}; | ||
|
||
static bool upgradeSchema_v6(eepromValues_t &targetValues, eepromValues_t_v6 &loadedValues) { | ||
targetValues.setpoint = loadedValues.setpoint; | ||
targetValues.steamSetPoint = loadedValues.steamSetPoint; | ||
targetValues.offsetTemp = loadedValues.offsetTemp; | ||
targetValues.hpwr = loadedValues.hpwr; | ||
targetValues.mainDivider = loadedValues.mainDivider; | ||
targetValues.brewDivider = loadedValues.brewDivider; | ||
targetValues.pressureProfilingStart = (float) loadedValues.pressureProfilingStart; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Zer0-bit
Owner
|
||
targetValues.pressureProfilingFinish = (float) loadedValues.pressureProfilingFinish; | ||
targetValues.pressureProfilingHold = loadedValues.pressureProfilingHold; | ||
targetValues.pressureProfilingLength = loadedValues.pressureProfilingLength; | ||
targetValues.pressureProfilingState = loadedValues.pressureProfilingState; | ||
targetValues.preinfusionState = loadedValues.preinfusionState; | ||
targetValues.preinfusionSec = loadedValues.preinfusionSec; | ||
targetValues.preinfusionBar = (float) loadedValues.preinfusionBar; | ||
targetValues.preinfusionSoak = loadedValues.preinfusionSoak; | ||
targetValues.preinfusionRamp = loadedValues.preinfusionRamp; | ||
targetValues.preinfusionFlowState = loadedValues.preinfusionFlowState; | ||
targetValues.preinfusionFlowVol = loadedValues.preinfusionFlowVol; | ||
targetValues.preinfusionFlowTime = loadedValues.preinfusionFlowTime; | ||
targetValues.preinfusionFlowSoakTime = loadedValues.preinfusionFlowSoakTime; | ||
targetValues.preinfusionFlowPressureTarget = (float) loadedValues.preinfusionFlowPressureTarget; | ||
targetValues.flowProfileState = loadedValues.flowProfileState; | ||
targetValues.flowProfileStart = loadedValues.flowProfileStart; | ||
targetValues.flowProfileEnd = loadedValues.flowProfileEnd; | ||
targetValues.flowProfilePressureTarget = (float) loadedValues.flowProfilePressureTarget; | ||
targetValues.flowProfileCurveSpeed = loadedValues.flowProfileCurveSpeed; | ||
targetValues.powerLineFrequency = loadedValues.powerLineFrequency; | ||
targetValues.lcdSleep = loadedValues.lcdSleep; | ||
targetValues.warmupState = loadedValues.warmupState; | ||
targetValues.homeOnShotFinish = loadedValues.homeOnShotFinish; | ||
targetValues.graphBrew = loadedValues.graphBrew; | ||
targetValues.brewDeltaState = loadedValues.brewDeltaState; | ||
targetValues.switchPhaseOnThreshold = loadedValues.switchPhaseOnThreshold; | ||
targetValues.basketPrefill = loadedValues.basketPrefill; | ||
targetValues.scalesF1 = loadedValues.scalesF1; | ||
targetValues.scalesF2 = loadedValues.scalesF2; | ||
targetValues.pumpFlowAtZero = loadedValues.pumpFlowAtZero; | ||
targetValues.stopOnWeightState = loadedValues.stopOnWeightState; | ||
targetValues.shotDose = loadedValues.shotDose; | ||
targetValues.shotStopOnCustomWeight = loadedValues.shotStopOnCustomWeight; | ||
targetValues.shotPreset = loadedValues.shotPreset; | ||
return true; | ||
} | ||
|
||
REGISTER_LEGACY_EEPROM_DATA(6, eepromValues_t_v6, upgradeSchema_v6) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fyi, these explicit float casts are not necessary in 6 to 7 upgrade. they were necessary from older versions because 6 changed the data type. should be harmless though.