Skip to content

Commit

Permalink
put soldering profile mode into its own file, put common functions in…
Browse files Browse the repository at this point in the history
… utils
  • Loading branch information
codingcatgirl committed Apr 24, 2023
1 parent 8cc722e commit 6c6a9d1
Show file tree
Hide file tree
Showing 11 changed files with 402 additions and 335 deletions.
4 changes: 3 additions & 1 deletion source/Core/BSP/BSP.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ enum StatusLED {
LED_COOLING_STILL_HOT, // The unit is off and cooling but still hot
LED_UNKNOWN, //
};
void setStatusLED(const enum StatusLED state, bool buzzer);
void setStatusLED(const enum StatusLED state);

void setBuzzer(bool on);

// preStartChecks are run until they return 0
// By the PID, after each ADC sample comes in
Expand Down
11 changes: 1 addition & 10 deletions source/Core/BSP/MHP30/BSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ void setBuzzer(bool on) {
htim3.Instance->PSC = 1; // revert back out of hearing range
}
}
void setStatusLED(const enum StatusLED state, bool buzzer) {
void setStatusLED(const enum StatusLED state) {
static enum StatusLED lastState = LED_UNKNOWN;
static TickType_t buzzerEnd = 0;

Expand All @@ -460,18 +460,9 @@ void setStatusLED(const enum StatusLED state, bool buzzer) {
ws2812.led_set_color(0, 0xFF, 0x8C, 0x00); // Orange
break;
}
if (buzzer) {
// Buzzer requested
buzzerEnd = xTaskGetTickCount() + TICKS_SECOND / 3;
}
ws2812.led_update();
lastState = state;
}
if (xTaskGetTickCount() < buzzerEnd) {
setBuzzer(true);
} else {
setBuzzer(false);
}
}
uint64_t getDeviceID() {
//
Expand Down
2 changes: 1 addition & 1 deletion source/Core/BSP/Miniware/BSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ bool isTipDisconnected() {
return tipTemp > tipDisconnectedThres;
}

void setStatusLED(const enum StatusLED state, bool buzzer) {}
void setStatusLED(const enum StatusLED state) {}
uint8_t preStartChecks() { return 1; }
uint64_t getDeviceID() {
//
Expand Down
2 changes: 1 addition & 1 deletion source/Core/BSP/Pinecil/BSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ bool isTipDisconnected() {
return tipTemp > tipDisconnectedThres;
}

void setStatusLED(const enum StatusLED state, bool buzzer) {}
void setStatusLED(const enum StatusLED state) {}

uint8_t preStartChecks() { return 1; }
uint64_t getDeviceID() { return dbg_id_get(); }
Expand Down
2 changes: 1 addition & 1 deletion source/Core/BSP/Pinecilv2/BSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ bool isTipDisconnected() {
return tipTemp > tipDisconnectedThres;
}

void setStatusLED(const enum StatusLED state, bool buzzer) {
void setStatusLED(const enum StatusLED state) {
// Dont have one
}

Expand Down
8 changes: 4 additions & 4 deletions source/Core/Threads/OperatingModes/HomeScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void drawHomeScreen(bool buttonLockout) {
case BUTTON_F_LONG:
#ifdef PROFILE_SUPPORT
if (!isTipDisconnected()) {
gui_solderingMode(0); // enter soldering mode
gui_solderingProfileMode(); // enter soldering profile mode
buttonLockout = true;
}
#else
Expand Down Expand Up @@ -97,13 +97,13 @@ void drawHomeScreen(bool buttonLockout) {
if ((tipTemp < 50) && getSettingValue(SettingsOptions::Sensitivity)
&& (((xTaskGetTickCount() - lastMovementTime) > MOVEMENT_INACTIVITY_TIME) && ((xTaskGetTickCount() - lastButtonTime) > BUTTON_INACTIVITY_TIME))) {
OLED::setDisplayState(OLED::DisplayState::OFF);
setStatusLED(LED_OFF, false);
setStatusLED(LED_OFF);
} else {
OLED::setDisplayState(OLED::DisplayState::ON);
if (tipTemp > 55) {
setStatusLED(LED_COOLING_STILL_HOT, false);
setStatusLED(LED_COOLING_STILL_HOT);
} else {
setStatusLED(LED_STANDBY, false);
setStatusLED(LED_STANDBY);
}
}
// Clear the lcd buffer
Expand Down
1 change: 1 addition & 0 deletions source/Core/Threads/OperatingModes/OperatingModes.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ void performCJCC(void); // Used to ca
void gui_solderingTempAdjust(void); // For adjusting the setpoint temperature of the iron
int gui_SolderingSleepingMode(bool stayOff, bool autoStarted); // Sleep mode
void gui_solderingMode(uint8_t jumpToSleep); // Main mode for hot pointy tool
void gui_solderingProfileMode(); // Profile mode for hot likely-not-so-pointy tool
void showDebugMenu(void); // Debugging values
void showPDDebug(void); // Debugging menu that hows PD adaptor info
void showWarnings(void); // Shows user warnings if required
Expand Down
Loading

0 comments on commit 6c6a9d1

Please sign in to comment.