Skip to content

Commit 3fae563

Browse files
authored
convert to older C++ (2003)
moved variable definitions from header to class constructor.
1 parent 13778fe commit 3fae563

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# FireTimer
2-
[![GitHub version](https://badge.fury.io/gh/PowerBroker2%2FFireTimer.svg)](https://badge.fury.io/gh/PowerBroker2%2FFireTimer) [![arduino-library-badge](https://www.ardu-badge.com/badge/FireTimer.svg?)](https://www.ardu-badge.com/FireTimer)<br /><br />
3-
Simple and non-blocking Arduino library used to "fire-off" processes at specific intervals
2+
Simple and non-blocking Arduino library used to "fire-off" processes at specific intervals. Difference with original: internal veriables are defined in class constructor, not in header - the library works well in Energia IDE with mspgcc version that does not support C++11.
43

54
# Example
65
```C++
@@ -68,4 +67,4 @@ msTimer.start();
6867
To update the timer's timeout value:
6968
```c++
7069
msTimer.update(100); // Save 100ms as the new timeout value and reset the timer
71-
```
70+
```

library.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name=FireTimer
2-
version=1.0.5
2+
version=1.1.1
33
author=PowerBroker2 <gitstuff2@gmail.com>
4-
maintainer=PowerBroker2 <gitstuff2@gmail.com>
4+
maintainer=z3q <ups.developer@gmail.com>
55
sentence=Simple and non-blocking library to time the execution of processes
66
paragraph=Simple and non-blocking library to time the execution of processes
77
category=Timing
8-
url=https://github.com/PowerBroker2/FireTimer
8+
url=https://github.com/z3q/FireTimer
99
architectures=*

src/FireTimer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
*/
2222
void FireTimer::begin(const ulong &timeout, const bool &micros)
2323
{
24+
bool us = false;
25+
ulong timeDiff = 0;
26+
ulong timeBench = 0;
27+
ulong period = 0;
28+
2429
us = micros;
2530
update(timeout);
2631
}

src/FireTimer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ const bool MICRO_SECONDS = true;
1616
class FireTimer
1717
{
1818
public: // <<---------------------------------------//public
19-
bool us = false;
20-
ulong timeDiff = 0;
19+
bool us;
20+
ulong timeDiff;
2121

2222

2323

@@ -32,6 +32,6 @@ class FireTimer
3232

3333

3434
private: // <<---------------------------------------//private
35-
ulong timeBench = 0;
36-
ulong period = 0;
35+
ulong timeBench ;
36+
ulong period ;
3737
};

0 commit comments

Comments
 (0)