My forked repository. DISCO_F407VG, DISCO_F303VC, DISCO_F051R8 and DISCO_F100RB maybe added.
Dependents: FastPWM-DISCO-test
Fork of FastPWM by
Diff: FastPWM_common.cpp
- Revision:
- 12:4600daab8a83
- Parent:
- 6:0f57969697b6
- Child:
- 18:d91c0629e4e6
--- a/FastPWM_common.cpp Wed Jul 16 15:44:21 2014 +0000 +++ b/FastPWM_common.cpp Sun Jul 20 12:49:21 2014 +0000 @@ -1,6 +1,7 @@ #include "FastPWM.h" FastPWM::FastPWM(PinName pin, int prescaler) : PwmOut(pin) { + fast_obj = NULL; initFastPWM(); this->prescaler(prescaler); @@ -11,6 +12,11 @@ } +FastPWM::~FastPWM( void ) { + if (fast_obj != NULL) + delete(fast_obj); +} + void FastPWM::period(double seconds) { if (dynamicPrescaler) calcPrescaler((uint64_t)(seconds * (double) SystemCoreClock));