@@ -203,21 +203,31 @@ class TimerInterrupt
203
203
204
204
public:
205
205
206
- TimerInterrupt ()
207
- {
208
- _timer = -1 ;
209
- _frequency = 0 ;
210
- _callback = NULL ;
211
- _params = NULL ;
212
- };
213
-
214
- TimerInterrupt (uint8_t timerNo)
215
- {
216
- _timer = timerNo;
217
- _frequency = 0 ;
218
- _callback = NULL ;
219
- _params = NULL ;
220
- };
206
+ TimerInterrupt ()
207
+ {
208
+ _timer = -1 ;
209
+ _frequency = 0 ;
210
+ _callback = NULL ;
211
+ _params = NULL ;
212
+ _timerDone = false ;
213
+ _prescalerIndex = NO_PRESCALER;
214
+ _OCRValue = 0 ;
215
+ _OCRValueRemaining = 0 ;
216
+ _toggle_count = -1 ;
217
+ };
218
+
219
+ explicit TimerInterrupt (uint8_t timerNo)
220
+ {
221
+ _timer = timerNo;
222
+ _frequency = 0 ;
223
+ _callback = NULL ;
224
+ _params = NULL ;
225
+ _timerDone = false ;
226
+ _prescalerIndex = NO_PRESCALER;
227
+ _OCRValue = 0 ;
228
+ _OCRValueRemaining = 0 ;
229
+ _toggle_count = -1 ;
230
+ };
221
231
222
232
void callback () __attribute__((always_inline))
223
233
{
@@ -892,7 +902,7 @@ class TimerInterrupt
892
902
return _timer;
893
903
};
894
904
895
- volatile long getCount () __attribute__((always_inline))
905
+ long getCount () __attribute__((always_inline))
896
906
{
897
907
return _toggle_count;
898
908
};
@@ -908,12 +918,12 @@ class TimerInterrupt
908
918
// interrupts();
909
919
};
910
920
911
- volatile long get_OCRValue () __attribute__((always_inline))
921
+ long get_OCRValue () __attribute__((always_inline))
912
922
{
913
923
return _OCRValue;
914
924
};
915
925
916
- volatile long get_OCRValueRemaining () __attribute__((always_inline))
926
+ long get_OCRValueRemaining () __attribute__((always_inline))
917
927
{
918
928
return _OCRValueRemaining;
919
929
};
@@ -928,7 +938,7 @@ class TimerInterrupt
928
938
else
929
939
_OCRValueRemaining -= min (MAX_COUNT_8BIT, _OCRValueRemaining);
930
940
931
- if (_OCRValueRemaining < = 0 )
941
+ if (_OCRValueRemaining = = 0 )
932
942
{
933
943
// Reset value for next cycle
934
944
_OCRValueRemaining = _OCRValue;
0 commit comments