@@ -274,7 +274,7 @@ static uint32_t get_adc_internal_channel(PinName pin)
274274#if defined(HAL_TIM_MODULE_ENABLED) && !defined(HAL_TIM_MODULE_ONLY)
275275uint32_t get_pwm_channel (PinName pin)
276276{
277- uint32_t function = pinmap_function (pin, PinMap_PWM );
277+ uint32_t function = pinmap_function (pin, PinMap_TIM );
278278 uint32_t channel = 0 ;
279279 switch (STM_PIN_CHANNEL (function)) {
280280 case 1 :
@@ -1026,17 +1026,17 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
10261026 */
10271027void pwm_start (PinName pin, uint32_t PWM_freq, uint32_t value, TimerCompareFormat_t resolution)
10281028{
1029- TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_PWM );
1029+ TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_TIM );
10301030 HardwareTimer *HT;
10311031 TimerModes_t previousMode;
10321032 uint32_t index = get_timer_index (Instance);
10331033 if (HardwareTimer_Handle[index] == NULL ) {
1034- HardwareTimer_Handle[index]->__this = new HardwareTimer ((TIM_TypeDef *)pinmap_peripheral (pin, PinMap_PWM ));
1034+ HardwareTimer_Handle[index]->__this = new HardwareTimer ((TIM_TypeDef *)pinmap_peripheral (pin, PinMap_TIM ));
10351035 }
10361036
10371037 HT = (HardwareTimer *)(HardwareTimer_Handle[index]->__this );
10381038
1039- uint32_t channel = STM_PIN_CHANNEL (pinmap_function (pin, PinMap_PWM ));
1039+ uint32_t channel = STM_PIN_CHANNEL (pinmap_function (pin, PinMap_TIM ));
10401040
10411041 previousMode = HT->getMode (channel);
10421042 if (previousMode != TIMER_OUTPUT_COMPARE_PWM1) {
@@ -1056,11 +1056,11 @@ void pwm_start(PinName pin, uint32_t PWM_freq, uint32_t value, TimerCompareForma
10561056 */
10571057void pwm_stop (PinName pin)
10581058{
1059- TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_PWM );
1059+ TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_TIM );
10601060 HardwareTimer *HT;
10611061 uint32_t index = get_timer_index (Instance);
10621062 if (HardwareTimer_Handle[index] == NULL ) {
1063- HardwareTimer_Handle[index]->__this = new HardwareTimer ((TIM_TypeDef *)pinmap_peripheral (pin, PinMap_PWM ));
1063+ HardwareTimer_Handle[index]->__this = new HardwareTimer ((TIM_TypeDef *)pinmap_peripheral (pin, PinMap_TIM ));
10641064 }
10651065
10661066 HT = (HardwareTimer *)(HardwareTimer_Handle[index]->__this );
0 commit comments