-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e916912
commit 80d0b00
Showing
7 changed files
with
32 additions
and
20 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
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
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
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
name=vovagorodok_ArduinoPin | ||
version=1.0.0 | ||
version=1.1.0 | ||
author=vovagorodok | ||
maintainer=vovagorodok <[email protected]> | ||
sentence=Objective arduino pin | ||
paragraph=Objective arduino pin | ||
category=Hardware | ||
url=https://github.com/vovagorodok/ArduinoPin | ||
includes=ArduinoPin.h, DigitalPin.h, AnalogPin.h, ScopedOn.h | ||
includes=ArduinoPin.h, DigitalPin.h, AnalogPin.h, ScopedSwitch.h | ||
architectures=* |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#pragma once | ||
#include <DigitalPin.h> | ||
#include <AnalogPin.h> | ||
#include <ScopedOn.h> | ||
#include <ScopedSwitch.h> |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#pragma once | ||
|
||
template <typename T> | ||
class ScopedOn | ||
{ | ||
public: | ||
inline ScopedOn(T& sw) : ref(sw) | ||
{ ref.on(); } | ||
inline ~ScopedOn() | ||
{ ref.off(); } | ||
private: | ||
T& ref; | ||
}; | ||
|
||
template <typename T> | ||
class ScopedOff | ||
{ | ||
public: | ||
inline ScopedOff(T& sw) : ref(sw) | ||
{ ref.off(); } | ||
inline ~ScopedOff() | ||
{ ref.on(); } | ||
private: | ||
T& ref; | ||
}; |