From a30f2895983013541d035118d5a7fa560b0e335c Mon Sep 17 00:00:00 2001 From: Stefan de Bruijn Date: Tue, 3 Nov 2020 16:25:34 +0100 Subject: [PATCH] Fixed 16->8 PWM channels --- Grbl_Esp32/src/PinUsers/PwmPin.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Grbl_Esp32/src/PinUsers/PwmPin.cpp b/Grbl_Esp32/src/PinUsers/PwmPin.cpp index 1e90666b..73ae7c3b 100644 --- a/Grbl_Esp32/src/PinUsers/PwmPin.cpp +++ b/Grbl_Esp32/src/PinUsers/PwmPin.cpp @@ -8,10 +8,11 @@ namespace PinUsers { class NativePwm : public PwmDetail { - static LimitedResource<16>& PwmChannelResources() { - // The ESP32 chip has 16 PWM channels. + static LimitedResource<8>& PwmChannelResources() { + // The ESP32 chip has 16 PWM channels, but the second 8 channels share the same timers as the first 8. + // So, in essense, we use only 8 here, so we can configure them independently. - static LimitedResource<16> instances_; + static LimitedResource<8> instances_; return instances_; }