Skip to content
Snippets Groups Projects
Commit 3cc7938b authored by Jan Grewe's avatar Jan Grewe
Browse files

Don't restart automatically after stopping with button.

parent 1aaec84a
No related branches found
No related tags found
No related merge requests found
...@@ -80,7 +80,6 @@ void loop() ...@@ -80,7 +80,6 @@ void loop()
{ {
WState = W_CYCLE; WState = W_CYCLE;
Restart = false; Restart = false;
Continue = false;
} }
StartTime = millis(); StartTime = millis();
winder.enableOutputs(); winder.enableOutputs();
...@@ -159,7 +158,10 @@ void loop() ...@@ -159,7 +158,10 @@ void loop()
winder.disableOutputs(); winder.disableOutputs();
StartTime = millis(); StartTime = millis();
WState = W_PAUSE; WState = W_PAUSE;
if (Continue)
{
pwr_led.Breathe(5000).Forever(); pwr_led.Breathe(5000).Forever();
}
break; // case W_STOP break; // case W_STOP
case W_PAUSE: case W_PAUSE:
...@@ -173,10 +175,9 @@ void loop() ...@@ -173,10 +175,9 @@ void loop()
{ {
WState = W_IDLE; WState = W_IDLE;
} }
else if (temp > (delta * long(PAUSE_MIN))) // ms per minute else if (Continue && temp > (delta * long(PAUSE_MIN))) // ms per minute
{ {
WState = W_IDLE; WState = W_IDLE;
Continue = true;
last_min = false; last_min = false;
Serial.print("d_time : "); Serial.print("d_time : ");
Serial.print(temp); Serial.print(temp);
...@@ -186,7 +187,9 @@ void loop() ...@@ -186,7 +187,9 @@ void loop()
else if ((!last_min) && (temp > (delta * long(PAUSE_MIN - 1)))) // ms per minute else if ((!last_min) && (temp > (delta * long(PAUSE_MIN - 1)))) // ms per minute
{ {
Serial.println("Last Minute ..."); Serial.println("Last Minute ...");
if (Continue) {
pwr_led.Breathe(1000).Forever(); pwr_led.Breathe(1000).Forever();
}
last_min = true; last_min = true;
} }
else else
...@@ -233,6 +236,8 @@ void handleSwEvent(AceButton *button, uint8_t eventType, ...@@ -233,6 +236,8 @@ void handleSwEvent(AceButton *button, uint8_t eventType,
case W_RIGHT: case W_RIGHT:
Serial.println(">>Stop Winding<<"); Serial.println(">>Stop Winding<<");
StopWind = true; StopWind = true;
Continue = false;
pwr_led.On();
break; break;
default: default:
break; break;
...@@ -242,6 +247,7 @@ void handleSwEvent(AceButton *button, uint8_t eventType, ...@@ -242,6 +247,7 @@ void handleSwEvent(AceButton *button, uint8_t eventType,
case AceButton::kEventClicked: case AceButton::kEventClicked:
Serial.println("SW CLICK"); Serial.println("SW CLICK");
pwr_led.Reset(); pwr_led.Reset();
Continue = true;
switch (WState) switch (WState)
{ {
case W_IDLE: case W_IDLE:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment