From a95d23e03a43a523b08d8bbfe3961ad07e7b845d Mon Sep 17 00:00:00 2001 From: James Gartrell Date: Thu, 16 Feb 2023 09:30:49 -0800 Subject: [PATCH] Add removeAllPins to HwPWM instance Given that no function exists to enumerate added pins, this allows for the HwPWM instance to be completely reset. --- cores/nRF5/HardwarePWM.cpp | 9 +++++++++ cores/nRF5/HardwarePWM.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/cores/nRF5/HardwarePWM.cpp b/cores/nRF5/HardwarePWM.cpp index d4d1d771..cd8dc9dc 100644 --- a/cores/nRF5/HardwarePWM.cpp +++ b/cores/nRF5/HardwarePWM.cpp @@ -205,6 +205,15 @@ bool HardwarePWM::removePin(uint8_t pin) return true; } +bool HardwarePWM::removeAllPins(void) +{ + for(int ch=0; ch