Skip to content

Commit

Permalink
Merge pull request #170 from firmata/BuildIssueEsp
Browse files Browse the repository at this point in the history
Workaround for a possible build problem
  • Loading branch information
pgrawehr authored Nov 23, 2024
2 parents 0134a9c + 1f7645a commit 1fdeb99
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
3 changes: 0 additions & 3 deletions src/AnalogOutputFirmata.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ class AnalogOutputFirmata: public FirmataFeature
void analogWriteInternal(byte pin, uint32_t value);
private:
void setupPwmPin(byte pin);
#if ESP32
void internalReset();
#endif
boolean handleSysex(byte command, byte argc, byte* argv)
{
if (command == EXTENDED_ANALOG)
Expand Down
19 changes: 7 additions & 12 deletions src/AnalogOutputFirmataEsp32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ AnalogOutputFirmata::AnalogOutputFirmata()

void AnalogOutputFirmata::reset()
{
internalReset();
for (int i = 0; i < TOTAL_PINS; i++)
{
if (Firmata.getPinMode(i) == PIN_MODE_PWM)
{
ledcDetach(i);
}
}
}


Expand All @@ -50,17 +56,6 @@ void AnalogOutputFirmata::setupPwmPin(byte pin) {
ledcWrite(pin, 0);
}

void AnalogOutputFirmata::internalReset()
{
for (int i = 0; i < TOTAL_PINS; i++)
{
if (Firmata.getPinMode(i) == PIN_MODE_PWM)
{
ledcDetach(i);
}
}
}

boolean AnalogOutputFirmata::handlePinMode(byte pin, int mode)
{
if (mode == PIN_MODE_PWM && FIRMATA_IS_PIN_PWM(pin)) {
Expand Down

0 comments on commit 1fdeb99

Please sign in to comment.