diff --git a/targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/device/system_CC3220SF.c b/targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/device/system_CC3220SF.c index 8adc062c89..4c2482c051 100644 --- a/targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/device/system_CC3220SF.c +++ b/targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/device/system_CC3220SF.c @@ -62,3 +62,12 @@ void SystemInit (void) SCB->VTOR = (uint32_t) &__Vectors; CC3220SF_LAUNCHXL_initGeneral(); } + +/* + * ======== ClockP_getCpuFreq ======== + */ +void ClockP_getCpuFreq(ClockP_FreqHz *freq) +{ + freq->lo = (uint32_t)SystemCoreClock; + freq->hi = 0; +} diff --git a/targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/device/system_CC3220SF.h b/targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/device/system_CC3220SF.h index 95ee0672a2..fb686bb02d 100644 --- a/targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/device/system_CC3220SF.h +++ b/targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/device/system_CC3220SF.h @@ -32,6 +32,7 @@ extern "C" { #include #include "ti/drivers/net/wifi/wlan.h" +#include "ti/drivers/dpl/ClockP.h" extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ diff --git a/targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/ti/drivers/pwm/PWMTimerCC32XX.c b/targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/ti/drivers/pwm/PWMTimerCC32XX.c index d70037d501..df8fcced16 100644 --- a/targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/ti/drivers/pwm/PWMTimerCC32XX.c +++ b/targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/ti/drivers/pwm/PWMTimerCC32XX.c @@ -152,8 +152,6 @@ static const uint32_t gpioPinIndexes[8] = { #define PinConfigPinMode(config) (((config) >> 8) & 0xF) #define PinConfigPin(config) (((config) >> 0) & 0x3F) -extern uint32_t SystemCoreClock; - /* * ======== getDutyCounts ======== */ @@ -163,10 +161,7 @@ static uint32_t getDutyCounts(PWM_Duty_Units dutyUnits, uint32_t dutyValue, uint32_t duty = 0; ClockP_FreqHz freq; - freq.hi = 0; - freq.lo = SystemCoreClock; - - //ClockP_getCpuFreq(&freq); + ClockP_getCpuFreq(&freq); switch (dutyUnits) { case PWM_DUTY_COUNTS: @@ -199,10 +194,7 @@ static uint32_t getPeriodCounts(PWM_Period_Units periodUnits, uint32_t period = 0; ClockP_FreqHz freq; - freq.hi = 0; - freq.lo = SystemCoreClock; - - //ClockP_getCpuFreq(&freq); + ClockP_getCpuFreq(&freq); switch (periodUnits) { case PWM_PERIOD_COUNTS: