Skip to content

Commit

Permalink
* missed const modifier. Fixed.
Browse files Browse the repository at this point in the history
* Added a reference to the co-author of class DirectPin.
  • Loading branch information
valmat committed Mar 27, 2016
1 parent 024f4ef commit 4dba4b4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/DirectInteract.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
*
* DirectInteract this is a helper class to direct interaction with a set of Arduino pins.
*
* @author Valeriy V Dmitriev aka valmat <[email protected]>
* @author ...
* @licenses MIT https://opensource.org/licenses/MIT
* @repo https://github.com/valmat/LedMatrix
* @author Valeriy V Dmitriev aka valmat <[email protected]>
* @coauthor Nikolai Tikhonov aka Dragon_Knight <[email protected]>, https://vk.com/globalzone_edev
* @licenses MIT https://opensource.org/licenses/MIT
* @repo https://github.com/valmat/LedMatrix
*
*/

Expand Down
17 changes: 8 additions & 9 deletions src/DirectPin.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
* The purpose of this class is to increase speed by eliminating unnecessary in this case checks.
* Not all methods are implemented, but only those that are needed within the library.
*
* @author Valeriy V Dmitriev aka valmat <[email protected]>
* @author ...
* @licenses MIT https://opensource.org/licenses/MIT
* @repo https://github.com/valmat/LedMatrix
* @author Valeriy V Dmitriev aka valmat <[email protected]>
* @coauthor Nikolai Tikhonov aka Dragon_Knight <[email protected]>, https://vk.com/globalzone_edev
* @licenses MIT https://opensource.org/licenses/MIT
* @repo https://github.com/valmat/LedMatrix
*
*/

Expand Down Expand Up @@ -39,25 +39,25 @@ class DirectPin
{}

// Directly set mode as `OUTPUT`
void modeOut(bool mode)
void modeOut(bool mode) const
{
*(_baseReg + 1) |= _bitMask;
}

// Directly set mode as `INPUT`
void modeIn()
void modeIn() const
{
*(_baseReg + 1) &= ~_bitMask;
}

// Directly set mode as `OUTPUT`
void modeOut()
void modeOut() const
{
*(_baseReg + 1) |= _bitMask;
}

// Directly set mode
void setMode(uint8_t mode)
void setMode(uint8_t mode) const
{
if(OUTPUT == mode) {
modeOut();
Expand Down Expand Up @@ -105,7 +105,6 @@ class DirectPin
{
for(uint8_t i = 0; i < 8; ++i) {
turn(val & (1 << i));

clock.on();
clock.off();
}
Expand Down

0 comments on commit 4dba4b4

Please sign in to comment.