Skip to content

Commit

Permalink
wrap tofnled init in a func
Browse files Browse the repository at this point in the history
  • Loading branch information
Zer0-bit committed Aug 4, 2023
1 parent 68c381c commit a3095c9
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/gaggiuino.ino
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ void setup(void) {
// Initialise comms library for talking to the ESP mcu
espCommsInit();

// Initialize LED
led.begin();
led.setColor(9u, 0u, 9u); // WHITE
// Init the tof sensor
tof.init(systemState);
tof.setCustomRanges(tofStartValue, tofEndValue);

cpsInit(runningCfg);
LOG_INFO("CPS Init");

Expand All @@ -79,8 +72,8 @@ void setup(void) {
pumpInit(currentState.powerLineFrequency, runningCfg.system.pumpFlowAtZero);
LOG_INFO("Pump init");

// Change LED colour on setup exit.
led.setColor(9u, 0u, 9u); // 64171
ToFnLedInit();
LOG_INFO("ToFnLed Init");

iwdcInit();
}
Expand Down Expand Up @@ -654,3 +647,12 @@ static void flushAuto() {
}
#endif
}

static void ToFnLedInit() {
// Initialize LED
led.begin();
led.setColor(9u, 0u, 9u); // WHITE
// Init the tof sensor
tof.init(systemState);
tof.setCustomRanges(tofStartValue, tofEndValue);
}

0 comments on commit a3095c9

Please sign in to comment.