Skip to content

Commit e057c68

Browse files
committed
For ESP8266 special port register type
1 parent 0eb6860 commit e057c68

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

src/BlinkTask.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Author: Balazs Kelemen
77
* Contact: [email protected]
8-
* Copyright: 2012 Balazs Kelemen
8+
* Copyright: 2017 Balazs Kelemen
99
* Copying permission statement:
1010
This file is part of SoftTimer.
1111
@@ -34,8 +34,8 @@ void BlinkTask::init(byte outPin, unsigned long onMs, unsigned long offMs, byte
3434
this->delayMs = delayMs;
3535

3636
pinMode(outPin, OUTPUT);
37-
_bitMask = digitalPinToBitMask(outPin);
38-
_portRegister = portOutputRegister(digitalPinToPort(outPin));
37+
this->_bitMask = digitalPinToBitMask(outPin);
38+
this->_portRegister = portOutputRegister(digitalPinToPort(outPin));
3939

4040
this->onLevel = HIGH;
4141
}

src/BlinkTask.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Author: Balazs Kelemen
77
* Contact: [email protected]
8-
* Copyright: 2012 Balazs Kelemen
8+
* Copyright: 2017 Balazs Kelemen
99
* Copying permission statement:
1010
This file is part of SoftTimer.
1111
@@ -113,7 +113,11 @@ class BlinkTask : public Task
113113
byte _state;
114114

115115
uint8_t _bitMask;
116+
#ifndef ESP8266
116117
volatile uint8_t *_portRegister;
118+
#else
119+
volatile uint32_t *_portRegister;
120+
#endif
117121
};
118122

119123
#endif

src/FrequencyTask.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Author: Balazs Kelemen
77
* Contact: [email protected]
8-
* Copyright: 2012 Balazs Kelemen
8+
* Copyright: 2017 Balazs Kelemen
99
* Copying permission statement:
1010
This file is part of SoftTimer.
1111
@@ -50,7 +50,11 @@ class FrequencyTask : public Task
5050
private:
5151
boolean _stateOn;
5252
uint8_t _bitMask;
53+
#ifndef ESP8266
5354
volatile uint8_t *_portRegister;
55+
#else
56+
volatile uint32_t *_portRegister;
57+
#endif
5458
static void step(Task* me);
5559
};
5660

src/SoftPwmTask.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Author: Balazs Kelemen
77
* Contact: [email protected]
8-
* Copyright: 2012 Balazs Kelemen
8+
* Copyright: 2017 Balazs Kelemen
99
* Copying permission statement:
1010
This file is part of SoftTimer.
1111
@@ -62,7 +62,11 @@ class SoftPwmTask : public Task
6262
static void step(Task* me);
6363

6464
uint8_t _bitMask;
65+
#ifndef ESP8266
6566
volatile uint8_t *_portRegister;
67+
#else
68+
volatile uint32_t *_portRegister;
69+
#endif
6670
};
6771

6872
#endif

0 commit comments

Comments
 (0)