Skip to content

Commit

Permalink
Remove virtual from interface operator definitions
Browse files Browse the repository at this point in the history
Also remove errant 'x' from InterfaceDigitalInOut.h :)
  • Loading branch information
AGlass0fMilk committed Mar 9, 2021
1 parent 78e33b0 commit 1bc96c9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion drivers/include/drivers/interfaces/InterfaceDigitalIn.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct DigitalIn {
virtual void mode(PinMode pull) = 0;
virtual int is_connected() = 0;

virtual operator int()
operator int()
{
// Underlying implementation is responsible for thread-safety
return read();
Expand Down
6 changes: 3 additions & 3 deletions drivers/include/drivers/interfaces/InterfaceDigitalInOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@ struct DigitalInOut {
virtual void mode(PinMode pull) = 0;
virtual int is_connected() = 0;

virtual DigitalInOut &operator= (int value)
DigitalInOut &operator= (int value)
{
// Underlying implementation is responsible for thread-safety
write(value);
return *this;
}

virtual DigitalInOut &operator= (DigitalInOut &rhs)
DigitalInOut &operator= (DigitalInOut &rhs)
{
// Underlying implementation is responsible for thread-safety
write(rhs.read());
return *this;
}

virtual operator int()
operator int()
{
// Underlying implementation is responsible for thread-safety
return read();
Expand Down
6 changes: 3 additions & 3 deletions drivers/include/drivers/interfaces/InterfaceDigitalOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ struct DigitalOut {
virtual int read() = 0;
virtual int is_connected() = 0;

virtual DigitalOut &operator= (int value)
DigitalOut &operator= (int value)
{
// Underlying implementation is responsible for thread-safety
write(value);
return *this;
}

virtual DigitalOut &operator= (DigitalOut &rhs)
DigitalOut &operator= (DigitalOut &rhs)
{
// Underlying implementation is responsible for thread-safety
write(rhs.read());
return *this;
}

virtual operator int()
operator int()
{
// Underlying implementation is responsible for thread-safety
return read();
Expand Down

0 comments on commit 1bc96c9

Please sign in to comment.