Browse Source

Renamed stopwatch::status to stopwatch::state

João Brázio 8 years ago
parent
commit
739dcda0f1
No account linked to committer's email address
2 changed files with 8 additions and 8 deletions
  1. 6
    6
      Marlin/stopwatch.cpp
  2. 2
    2
      Marlin/stopwatch.h

+ 6
- 6
Marlin/stopwatch.cpp View File

@@ -34,7 +34,7 @@ void Stopwatch::stop() {
34 34
 
35 35
   if (!this->isRunning()) return;
36 36
 
37
-  this->status = STPWTCH_STOPPED;
37
+  this->state = STPWTCH_STOPPED;
38 38
   this->stopTimestamp = millis();
39 39
 }
40 40
 
@@ -45,7 +45,7 @@ void Stopwatch::pause() {
45 45
 
46 46
   if (!this->isRunning()) return;
47 47
 
48
-  this->status = STPWTCH_PAUSED;
48
+  this->state = STPWTCH_PAUSED;
49 49
   this->stopTimestamp = millis();
50 50
 }
51 51
 
@@ -59,7 +59,7 @@ void Stopwatch::start() {
59 59
   if (this->isPaused()) this->accumulator = this->duration();
60 60
   else this->reset();
61 61
 
62
-  this->status = STPWTCH_RUNNING;
62
+  this->state = STPWTCH_RUNNING;
63 63
   this->startTimestamp = millis();
64 64
 }
65 65
 
@@ -68,18 +68,18 @@ void Stopwatch::reset() {
68 68
     debug(PSTR("reset"));
69 69
   #endif
70 70
 
71
-  this->status = STPWTCH_STOPPED;
71
+  this->state = STPWTCH_STOPPED;
72 72
   this->startTimestamp = 0;
73 73
   this->stopTimestamp = 0;
74 74
   this->accumulator = 0;
75 75
 }
76 76
 
77 77
 bool Stopwatch::isRunning() {
78
-  return (this->status == STPWTCH_RUNNING) ? true : false;
78
+  return (this->state == STPWTCH_RUNNING) ? true : false;
79 79
 }
80 80
 
81 81
 bool Stopwatch::isPaused() {
82
-  return (this->status == STPWTCH_PAUSED) ? true : false;
82
+  return (this->state == STPWTCH_PAUSED) ? true : false;
83 83
 }
84 84
 
85 85
 uint16_t Stopwatch::duration() {

+ 2
- 2
Marlin/stopwatch.h View File

@@ -28,7 +28,7 @@
28 28
 // Print debug messages with M111 S2 (Uses 156 bytes of PROGMEM)
29 29
 //#define DEBUG_STOPWATCH
30 30
 
31
-enum StopwatchStatus {
31
+enum StopwatchState {
32 32
   STPWTCH_STOPPED,
33 33
   STPWTCH_RUNNING,
34 34
   STPWTCH_PAUSED
@@ -41,7 +41,7 @@ enum StopwatchStatus {
41 41
  */
42 42
 class Stopwatch {
43 43
   private:
44
-    StopwatchStatus status;
44
+    StopwatchState state;
45 45
     uint16_t accumulator;
46 46
     uint32_t startTimestamp;
47 47
     uint32_t stopTimestamp;

Loading…
Cancel
Save