-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For ESP8266 special port register type
- Loading branch information
Showing
4 changed files
with
18 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
* | ||
* Author: Balazs Kelemen | ||
* Contact: [email protected] | ||
* Copyright: 2012 Balazs Kelemen | ||
* Copyright: 2017 Balazs Kelemen | ||
* Copying permission statement: | ||
This file is part of SoftTimer. | ||
|
@@ -34,8 +34,8 @@ void BlinkTask::init(byte outPin, unsigned long onMs, unsigned long offMs, byte | |
this->delayMs = delayMs; | ||
|
||
pinMode(outPin, OUTPUT); | ||
_bitMask = digitalPinToBitMask(outPin); | ||
_portRegister = portOutputRegister(digitalPinToPort(outPin)); | ||
this->_bitMask = digitalPinToBitMask(outPin); | ||
this->_portRegister = portOutputRegister(digitalPinToPort(outPin)); | ||
|
||
this->onLevel = HIGH; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
* | ||
* Author: Balazs Kelemen | ||
* Contact: [email protected] | ||
* Copyright: 2012 Balazs Kelemen | ||
* Copyright: 2017 Balazs Kelemen | ||
* Copying permission statement: | ||
This file is part of SoftTimer. | ||
|
@@ -113,7 +113,11 @@ class BlinkTask : public Task | |
byte _state; | ||
|
||
uint8_t _bitMask; | ||
#ifndef ESP8266 | ||
volatile uint8_t *_portRegister; | ||
#else | ||
volatile uint32_t *_portRegister; | ||
#endif | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
* | ||
* Author: Balazs Kelemen | ||
* Contact: [email protected] | ||
* Copyright: 2012 Balazs Kelemen | ||
* Copyright: 2017 Balazs Kelemen | ||
* Copying permission statement: | ||
This file is part of SoftTimer. | ||
|
@@ -50,7 +50,11 @@ class FrequencyTask : public Task | |
private: | ||
boolean _stateOn; | ||
uint8_t _bitMask; | ||
#ifndef ESP8266 | ||
volatile uint8_t *_portRegister; | ||
#else | ||
volatile uint32_t *_portRegister; | ||
#endif | ||
static void step(Task* me); | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
* | ||
* Author: Balazs Kelemen | ||
* Contact: [email protected] | ||
* Copyright: 2012 Balazs Kelemen | ||
* Copyright: 2017 Balazs Kelemen | ||
* Copying permission statement: | ||
This file is part of SoftTimer. | ||
|
@@ -62,7 +62,11 @@ class SoftPwmTask : public Task | |
static void step(Task* me); | ||
|
||
uint8_t _bitMask; | ||
#ifndef ESP8266 | ||
volatile uint8_t *_portRegister; | ||
#else | ||
volatile uint32_t *_portRegister; | ||
#endif | ||
}; | ||
|
||
#endif |