Skip to content

Commit

Permalink
🎨 (drivers): Update CoreTouchSensor
Browse files Browse the repository at this point in the history
  • Loading branch information
MMyster committed Jul 26, 2022
1 parent 25cd648 commit 54d2188
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/CoreTouchSensor/include/CoreTouchSensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class CoreTouchSensor : public interface::TouchSensor
auto read() -> bool final;
void reset() final;
void setSensitivity(uint16_t value, bool saved = false) final;
auto getState() -> bool final;

private:
enum class PowerMode : uint8_t
Expand Down
5 changes: 5 additions & 0 deletions drivers/CoreTouchSensor/source/CoreTouchSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,8 @@ void CoreTouchSensor::setPowerMode(PowerMode power_mode)
auto pm = static_cast<uint8_t>(power_mode);
_power_mode_pin.write(pm);
}

auto CoreTouchSensor::getState() -> bool
{
return _state;
}
1 change: 1 addition & 0 deletions include/interface/drivers/TouchSensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class TouchSensor
virtual auto read() -> bool = 0;
virtual void reset() = 0;
virtual void setSensitivity(uint16_t value, bool saved = false) = 0;
virtual auto getState() -> bool = 0;
};

} // namespace leka::interface

0 comments on commit 54d2188

Please sign in to comment.