Browse Source

timestamp => endtime

Scott Lahteine 8 years ago
parent
commit
d1dffc7ad1
1 changed files with 7 additions and 7 deletions
  1. 7
    7
      Marlin/buzzer.h

+ 7
- 7
Marlin/buzzer.h View File

46
   private:
46
   private:
47
     struct state_t {
47
     struct state_t {
48
       tone_t   tone;
48
       tone_t   tone;
49
-      uint32_t timestamp;
49
+      uint32_t endtime;
50
     } state;
50
     } state;
51
 
51
 
52
   protected:
52
   protected:
82
      */
82
      */
83
     void reset() {
83
     void reset() {
84
       this->off();
84
       this->off();
85
-      this->state.timestamp = 0;
85
+      this->state.endtime = 0;
86
     }
86
     }
87
 
87
 
88
   public:
88
   public:
97
     /**
97
     /**
98
      * @brief Add a tone to the queue
98
      * @brief Add a tone to the queue
99
      * @details Adds a tone_t structure to the ring buffer, will block IO if the
99
      * @details Adds a tone_t structure to the ring buffer, will block IO if the
100
-     * queue is full waiting for one slot to get available.
100
+     *          queue is full waiting for one slot to get available.
101
      *
101
      *
102
      * @param duration Duration of the tone in milliseconds
102
      * @param duration Duration of the tone in milliseconds
103
      * @param frequency Frequency of the tone in hertz
103
      * @param frequency Frequency of the tone in hertz
114
     /**
114
     /**
115
      * @brief Loop function
115
      * @brief Loop function
116
      * @details This function should be called at loop, it will take care of
116
      * @details This function should be called at loop, it will take care of
117
-     * playing the tones in the queue.
117
+     *          playing the tones in the queue.
118
      */
118
      */
119
     virtual void tick() {
119
     virtual void tick() {
120
-      if (!this->state.timestamp) {
120
+      if (!this->state.endtime) {
121
         if (this->buffer.isEmpty()) return;
121
         if (this->buffer.isEmpty()) return;
122
 
122
 
123
         this->state.tone = this->buffer.dequeue();
123
         this->state.tone = this->buffer.dequeue();
124
-        this->state.timestamp = millis() + this->state.tone.duration;
124
+        this->state.endtime = millis() + this->state.tone.duration;
125
         if (this->state.tone.frequency > 0) this->on();
125
         if (this->state.tone.frequency > 0) this->on();
126
       }
126
       }
127
-      else if (ELAPSED(millis(), this->state.timestamp)) this->reset();
127
+      else if (ELAPSED(millis(), this->state.endtime)) this->reset();
128
     }
128
     }
129
 };
129
 };
130
 
130
 

Loading…
Cancel
Save