diff --git a/mbed-drivers/PwmOut.h b/mbed-drivers/PwmOut.h index 9e8c0bdf..6ddb2044 100644 --- a/mbed-drivers/PwmOut.h +++ b/mbed-drivers/PwmOut.h @@ -62,6 +62,12 @@ class PwmOut { pwmout_init(&_pwm, pin); } + /** Free PwmOut and related resources + */ + ~PwmOut() { + pwmout_free(&_pwm); + } + /** Set the ouput duty-cycle, specified as a percentage (float) * * @param value A floating-point value representing the output duty-cycle,