mirror of
https://github.com/tbnobody/OpenDTU.git
synced 2025-12-11 01:10:20 +01:00
Make setLed method compatible with Arduino Framework 3
This commit is contained in:
@@ -135,7 +135,12 @@ void LedSingleClass::setLed(const uint8_t ledNo, const bool ledState)
|
||||
return;
|
||||
}
|
||||
|
||||
#if ESP_ARDUINO_VERSION_MAJOR < 3
|
||||
const uint32_t currentPWM = ledcRead(analogGetChannel(pin.led[ledNo]));
|
||||
#else
|
||||
const uint32_t currentPWM = ledcRead(pin.led[ledNo]);
|
||||
#endif
|
||||
|
||||
const uint32_t targetPWM = ledState ? pwmTable[config.Led_Single[ledNo].Brightness] : LED_OFF;
|
||||
|
||||
if (currentPWM == targetPWM) {
|
||||
|
||||
Reference in New Issue
Block a user