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
 
34
 
35
   if (!this->isRunning()) return;
35
   if (!this->isRunning()) return;
36
 
36
 
37
-  this->status = STPWTCH_STOPPED;
37
+  this->state = STPWTCH_STOPPED;
38
   this->stopTimestamp = millis();
38
   this->stopTimestamp = millis();
39
 }
39
 }
40
 
40
 
45
 
45
 
46
   if (!this->isRunning()) return;
46
   if (!this->isRunning()) return;
47
 
47
 
48
-  this->status = STPWTCH_PAUSED;
48
+  this->state = STPWTCH_PAUSED;
49
   this->stopTimestamp = millis();
49
   this->stopTimestamp = millis();
50
 }
50
 }
51
 
51
 
59
   if (this->isPaused()) this->accumulator = this->duration();
59
   if (this->isPaused()) this->accumulator = this->duration();
60
   else this->reset();
60
   else this->reset();
61
 
61
 
62
-  this->status = STPWTCH_RUNNING;
62
+  this->state = STPWTCH_RUNNING;
63
   this->startTimestamp = millis();
63
   this->startTimestamp = millis();
64
 }
64
 }
65
 
65
 
68
     debug(PSTR("reset"));
68
     debug(PSTR("reset"));
69
   #endif
69
   #endif
70
 
70
 
71
-  this->status = STPWTCH_STOPPED;
71
+  this->state = STPWTCH_STOPPED;
72
   this->startTimestamp = 0;
72
   this->startTimestamp = 0;
73
   this->stopTimestamp = 0;
73
   this->stopTimestamp = 0;
74
   this->accumulator = 0;
74
   this->accumulator = 0;
75
 }
75
 }
76
 
76
 
77
 bool Stopwatch::isRunning() {
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
 bool Stopwatch::isPaused() {
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
 uint16_t Stopwatch::duration() {
85
 uint16_t Stopwatch::duration() {

+ 2
- 2
Marlin/stopwatch.h View File

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

Loading…
Cancel
Save