Skip to content

Commit

Permalink
remove unused periodic trigger, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kjyv committed Oct 3, 2023
1 parent 44aecd2 commit 5b1dfa8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ MACHINE machine = (enum MACHINE)MACHINEID;
#define HIGH_ACCURACY

#include "PeriodicTrigger.h"
PeriodicTrigger writeDebugTrigger(5000); // returns true every 5000 ms
PeriodicTrigger logbrew(500);

enum MachineState {
Expand Down Expand Up @@ -860,6 +859,10 @@ float filterPressureValue(float input) {
* @brief steamON & Quickmill
*/
void checkSteamON() {
if (STEAMSWITCHTYPE == 0) {
return;
}

// check digital GIPO
if (digitalRead(PIN_STEAMSWITCH) == HIGH) {
steamON = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/scalevoid.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @file scalevoid.h
*
* @brief TODO
* @brief Implementation of scale initialization and weight measurement
*/

#pragma once
Expand Down
9 changes: 4 additions & 5 deletions src/steamswitchvoid.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ unsigned long lastDebounceTimeSteamTrigger = 0; // the last time the output
unsigned long debounceDelaySteamTrigger = 50; // the debounce time; increase if the output flickers

void checkSteamSwitch() {
#if STEAMSWITCHTYPE == 1
#if STEAMSWITCHTYPE == 0
return;
#elif STEAMSWITCHTYPE == 1
// Set steamON to 1 when steamswitch is HIGH
if (digitalRead(PIN_STEAMSWITCH) == HIGH) {
steamON = 1;
Expand All @@ -24,9 +26,7 @@ void checkSteamSwitch() {
if (digitalRead(PIN_STEAMSWITCH) == LOW && steamFirstON == 0) {
steamON = 0;
}
#endif

#if STEAMSWITCHTYPE == 2 // TRIGGER
#elif STEAMSWITCHTYPE == 2 // TRIGGER
int reading = digitalRead(PIN_STEAMSWITCH);

if (reading != lastSteamSwitchTrigger) {
Expand Down Expand Up @@ -56,6 +56,5 @@ void checkSteamSwitch() {
}

lastSteamSwitchTrigger = reading;

#endif
}

0 comments on commit 5b1dfa8

Please sign in to comment.