@@ -274,7 +274,7 @@ static uint32_t get_adc_internal_channel(PinName pin)
274
274
#if defined(HAL_TIM_MODULE_ENABLED) && !defined(HAL_TIM_MODULE_ONLY)
275
275
uint32_t get_pwm_channel (PinName pin)
276
276
{
277
- uint32_t function = pinmap_function (pin, PinMap_PWM );
277
+ uint32_t function = pinmap_function (pin, PinMap_TIM );
278
278
uint32_t channel = 0 ;
279
279
switch (STM_PIN_CHANNEL (function)) {
280
280
case 1 :
@@ -1026,17 +1026,17 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
1026
1026
*/
1027
1027
void pwm_start (PinName pin, uint32_t PWM_freq, uint32_t value, TimerCompareFormat_t resolution)
1028
1028
{
1029
- TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_PWM );
1029
+ TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_TIM );
1030
1030
HardwareTimer *HT;
1031
1031
TimerModes_t previousMode;
1032
1032
uint32_t index = get_timer_index (Instance);
1033
1033
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 ));
1035
1035
}
1036
1036
1037
1037
HT = (HardwareTimer *)(HardwareTimer_Handle[index ]->__this );
1038
1038
1039
- uint32_t channel = STM_PIN_CHANNEL (pinmap_function (pin, PinMap_PWM ));
1039
+ uint32_t channel = STM_PIN_CHANNEL (pinmap_function (pin, PinMap_TIM ));
1040
1040
1041
1041
previousMode = HT->getMode (channel);
1042
1042
if (previousMode != TIMER_OUTPUT_COMPARE_PWM1) {
@@ -1056,11 +1056,11 @@ void pwm_start(PinName pin, uint32_t PWM_freq, uint32_t value, TimerCompareForma
1056
1056
*/
1057
1057
void pwm_stop (PinName pin)
1058
1058
{
1059
- TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_PWM );
1059
+ TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_TIM );
1060
1060
HardwareTimer *HT;
1061
1061
uint32_t index = get_timer_index (Instance);
1062
1062
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 ));
1064
1064
}
1065
1065
1066
1066
HT = (HardwareTimer *)(HardwareTimer_Handle[index ]->__this );
0 commit comments