Skip to content

Commit

Permalink
feat(Arduino): detach analog output
Browse files Browse the repository at this point in the history
  • Loading branch information
leon0399 committed Jul 5, 2024
1 parent ec6aac8 commit ca2ffc5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/arduino_esp32/senseshift/arduino/output/ledc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ namespace SenseShift::Arduino::Output {
{
}

~LedcOutput() override { ledcDetach(this->pin_); }

void init() override
{
pinMode(this->pin_, OUTPUT);
Expand All @@ -36,7 +38,7 @@ namespace SenseShift::Arduino::Output {
}
}

[[nodiscard]] auto getMaxValue() const -> std::uint32_t { return (1 << analog_resolution_) - 1; }
[[nodiscard]] inline auto getMaxValue() const -> std::uint32_t { return (1 << this->analog_resolution_) - 1; }

void writeState(const float value) override
{
Expand Down

0 comments on commit ca2ffc5

Please sign in to comment.