@@ -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 :
@@ -1016,17 +1016,17 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
10161016 */
10171017void pwm_start (PinName pin, uint32_t PWM_freq, uint32_t value, TimerCompareFormat_t resolution)
10181018{
1019- TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_PWM );
1019+ TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_TIM );
10201020 HardwareTimer *HT;
10211021 TimerModes_t previousMode;
10221022 uint32_t index = get_timer_index (Instance);
10231023 if (HardwareTimer_Handle[index] == NULL ) {
1024- HardwareTimer_Handle[index]->__this = new HardwareTimer ((TIM_TypeDef *)pinmap_peripheral (pin, PinMap_PWM ));
1024+ HardwareTimer_Handle[index]->__this = new HardwareTimer ((TIM_TypeDef *)pinmap_peripheral (pin, PinMap_TIM ));
10251025 }
10261026
10271027 HT = (HardwareTimer *)(HardwareTimer_Handle[index]->__this );
10281028
1029- uint32_t channel = STM_PIN_CHANNEL (pinmap_function (pin, PinMap_PWM ));
1029+ uint32_t channel = STM_PIN_CHANNEL (pinmap_function (pin, PinMap_TIM ));
10301030
10311031 previousMode = HT->getMode (channel);
10321032 if (previousMode != TIMER_OUTPUT_COMPARE_PWM1) {
@@ -1046,11 +1046,11 @@ void pwm_start(PinName pin, uint32_t PWM_freq, uint32_t value, TimerCompareForma
10461046 */
10471047void pwm_stop (PinName pin)
10481048{
1049- TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_PWM );
1049+ TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_TIM );
10501050 HardwareTimer *HT;
10511051 uint32_t index = get_timer_index (Instance);
10521052 if (HardwareTimer_Handle[index] == NULL ) {
1053- HardwareTimer_Handle[index]->__this = new HardwareTimer ((TIM_TypeDef *)pinmap_peripheral (pin, PinMap_PWM ));
1053+ HardwareTimer_Handle[index]->__this = new HardwareTimer ((TIM_TypeDef *)pinmap_peripheral (pin, PinMap_TIM ));
10541054 }
10551055
10561056 HT = (HardwareTimer *)(HardwareTimer_Handle[index]->__this );
0 commit comments