@@ -250,7 +250,7 @@ static uint32_t get_adc_internal_channel(PinName pin)
250250#if defined(HAL_TIM_MODULE_ENABLED) && !defined(HAL_TIM_MODULE_ONLY)
251251uint32_t get_pwm_channel (PinName pin)
252252{
253- uint32_t function = pinmap_function (pin, PinMap_PWM );
253+ uint32_t function = pinmap_function (pin, PinMap_TIM );
254254 uint32_t channel = 0 ;
255255 switch (STM_PIN_CHANNEL (function)) {
256256 case 1 :
@@ -1004,17 +1004,17 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
10041004 */
10051005void pwm_start (PinName pin, uint32_t PWM_freq, uint32_t value, TimerCompareFormat_t resolution)
10061006{
1007- TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_PWM );
1007+ TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_TIM );
10081008 HardwareTimer *HT;
10091009 TimerModes_t previousMode;
10101010 uint32_t index = get_timer_index (Instance);
10111011 if (HardwareTimer_Handle[index] == NULL ) {
1012- HardwareTimer_Handle[index]->__this = new HardwareTimer ((TIM_TypeDef *)pinmap_peripheral (pin, PinMap_PWM ));
1012+ HardwareTimer_Handle[index]->__this = new HardwareTimer ((TIM_TypeDef *)pinmap_peripheral (pin, PinMap_TIM ));
10131013 }
10141014
10151015 HT = (HardwareTimer *)(HardwareTimer_Handle[index]->__this );
10161016
1017- uint32_t channel = STM_PIN_CHANNEL (pinmap_function (pin, PinMap_PWM ));
1017+ uint32_t channel = STM_PIN_CHANNEL (pinmap_function (pin, PinMap_TIM ));
10181018
10191019 previousMode = HT->getMode (channel);
10201020 if (previousMode != TIMER_OUTPUT_COMPARE_PWM1) {
@@ -1034,11 +1034,11 @@ void pwm_start(PinName pin, uint32_t PWM_freq, uint32_t value, TimerCompareForma
10341034 */
10351035void pwm_stop (PinName pin)
10361036{
1037- TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_PWM );
1037+ TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_TIM );
10381038 HardwareTimer *HT;
10391039 uint32_t index = get_timer_index (Instance);
10401040 if (HardwareTimer_Handle[index] == NULL ) {
1041- HardwareTimer_Handle[index]->__this = new HardwareTimer ((TIM_TypeDef *)pinmap_peripheral (pin, PinMap_PWM ));
1041+ HardwareTimer_Handle[index]->__this = new HardwareTimer ((TIM_TypeDef *)pinmap_peripheral (pin, PinMap_TIM ));
10421042 }
10431043
10441044 HT = (HardwareTimer *)(HardwareTimer_Handle[index]->__this );
0 commit comments