@@ -259,7 +259,7 @@ static uint32_t get_adc_internal_channel(PinName pin)
259259#if defined(HAL_TIM_MODULE_ENABLED) && !defined(HAL_TIM_MODULE_ONLY)
260260uint32_t get_pwm_channel (PinName pin)
261261{
262- uint32_t function = pinmap_function (pin, PinMap_PWM );
262+ uint32_t function = pinmap_function (pin, PinMap_TIM );
263263 uint32_t channel = 0 ;
264264 switch (STM_PIN_CHANNEL (function)) {
265265 case 1 :
@@ -1013,17 +1013,17 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
10131013 */
10141014void pwm_start (PinName pin, uint32_t PWM_freq, uint32_t value, TimerCompareFormat_t resolution)
10151015{
1016- TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_PWM );
1016+ TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_TIM );
10171017 HardwareTimer *HT;
10181018 TimerModes_t previousMode;
10191019 uint32_t index = get_timer_index (Instance);
10201020 if (HardwareTimer_Handle[index] == NULL ) {
1021- HardwareTimer_Handle[index]->__this = new HardwareTimer ((TIM_TypeDef *)pinmap_peripheral (pin, PinMap_PWM ));
1021+ HardwareTimer_Handle[index]->__this = new HardwareTimer ((TIM_TypeDef *)pinmap_peripheral (pin, PinMap_TIM ));
10221022 }
10231023
10241024 HT = (HardwareTimer *)(HardwareTimer_Handle[index]->__this );
10251025
1026- uint32_t channel = STM_PIN_CHANNEL (pinmap_function (pin, PinMap_PWM ));
1026+ uint32_t channel = STM_PIN_CHANNEL (pinmap_function (pin, PinMap_TIM ));
10271027
10281028 previousMode = HT->getMode (channel);
10291029 if (previousMode != TIMER_OUTPUT_COMPARE_PWM1) {
@@ -1043,11 +1043,11 @@ void pwm_start(PinName pin, uint32_t PWM_freq, uint32_t value, TimerCompareForma
10431043 */
10441044void pwm_stop (PinName pin)
10451045{
1046- TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_PWM );
1046+ TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_TIM );
10471047 HardwareTimer *HT;
10481048 uint32_t index = get_timer_index (Instance);
10491049 if (HardwareTimer_Handle[index] == NULL ) {
1050- HardwareTimer_Handle[index]->__this = new HardwareTimer ((TIM_TypeDef *)pinmap_peripheral (pin, PinMap_PWM ));
1050+ HardwareTimer_Handle[index]->__this = new HardwareTimer ((TIM_TypeDef *)pinmap_peripheral (pin, PinMap_TIM ));
10511051 }
10521052
10531053 HT = (HardwareTimer *)(HardwareTimer_Handle[index]->__this );
0 commit comments