Skip to content

Commit

Permalink
dma bs
Browse files Browse the repository at this point in the history
  • Loading branch information
Zer0-bit committed Jun 19, 2023
1 parent dbe04a7 commit 8427ec6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/eeprom_data/eeprom_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@ bool eepromWrite(eepromValues_t eepromValuesNew) {
eepromMetadata.version = EEPROM_DATA_VERSION;
eepromMetadata.values = eepromValuesNew;
eepromMetadata.versionTimestampXOR = eepromMetadata.timestamp ^ eepromMetadata.version;
EEPROM.put(0, eepromMetadata);

dmaWriteCurrentMetadata();
// dmaWriteCurrentMetadata();

return true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/gaggiuino.ino
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void setup(void) {
thermocoupleInit();
LOG_INFO("Thermocouple Init");

lcdUploadCfg(runningCfg);
lcdUploadCfg(runningCfg, systemState);
LOG_INFO("LCD cfg uploaded");

adsInit();
Expand Down Expand Up @@ -481,7 +481,7 @@ void lcdRefreshElementsTrigger(void) {
}

// Make the necessary changes
uploadPageCfg(eepromCurrentValues);
uploadPageCfg(eepromCurrentValues, systemState);
// refresh the screen elements
pageValuesRefresh();
}
Expand Down
4 changes: 2 additions & 2 deletions src/lcd/lcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ extern volatile NextionPage lcdLastCurrentPageId;
void lcdInit(void);
bool lcdCheckSerialInit(const char* expectedOutput, size_t expectedLen);
void lcdUploadProfile(eepromValues_t &eepromCurrentValues);
void lcdUploadCfg(eepromValues_t &eepromCurrentValues);
void uploadPageCfg(eepromValues_t &eepromCurrentValues);
void lcdUploadCfg(eepromValues_t &eepromCurrentValues, SystemState &sys);
void uploadPageCfg(eepromValues_t &eepromCurrentValues, SystemState &sys);
void lcdListen(void);
void lcdWakeUp(void);

Expand Down
9 changes: 6 additions & 3 deletions src/lcd/nextion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void lcdUploadProfile(eepromValues_t &eepromCurrentValues) {
}

// This is never called again after boot
void lcdUploadCfg(eepromValues_t &eepromCurrentValues) {
void lcdUploadCfg(eepromValues_t &eepromCurrentValues, SystemState &sys) {
// bool profileType = false;

// Profile names for all buttons
Expand Down Expand Up @@ -167,11 +167,14 @@ void lcdUploadCfg(eepromValues_t &eepromCurrentValues) {

// Led
myNex.writeNum("ledOn", eepromCurrentValues.ledState);
sys.ledColours[0] = eepromCurrentValues.ledR;
sys.ledColours[1] = eepromCurrentValues.ledR;
sys.ledColours[2] = eepromCurrentValues.ledB;

lcdUploadProfile(eepromCurrentValues);
}

void uploadPageCfg(eepromValues_t &eepromCurrentValues) {
void uploadPageCfg(eepromValues_t &eepromCurrentValues, SystemState &sys) {
// Updating only page specific elements as necessary to speed up things and avoid needless writes.
switch (lcdCurrentPageId) {
case NextionPage::BrewPreinfusion:
Expand Down Expand Up @@ -252,7 +255,7 @@ void uploadPageCfg(eepromValues_t &eepromCurrentValues) {
}
break;
default:
lcdUploadCfg(eepromCurrentValues);
lcdUploadCfg(eepromCurrentValues, sys);
break;
}
}
Expand Down

0 comments on commit 8427ec6

Please sign in to comment.