@@ -259,7 +259,7 @@ static uint32_t get_adc_internal_channel(PinName pin)
259
259
#if defined(HAL_TIM_MODULE_ENABLED) && !defined(HAL_TIM_MODULE_ONLY)
260
260
uint32_t get_pwm_channel (PinName pin)
261
261
{
262
- uint32_t function = pinmap_function (pin, PinMap_PWM );
262
+ uint32_t function = pinmap_function (pin, PinMap_TIM );
263
263
uint32_t channel = 0 ;
264
264
switch (STM_PIN_CHANNEL (function)) {
265
265
case 1 :
@@ -1013,17 +1013,17 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
1013
1013
*/
1014
1014
void pwm_start (PinName pin, uint32_t PWM_freq, uint32_t value, TimerCompareFormat_t resolution)
1015
1015
{
1016
- TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_PWM );
1016
+ TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_TIM );
1017
1017
HardwareTimer *HT;
1018
1018
TimerModes_t previousMode;
1019
1019
uint32_t index = get_timer_index (Instance);
1020
1020
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 ));
1022
1022
}
1023
1023
1024
1024
HT = (HardwareTimer *)(HardwareTimer_Handle[index ]->__this );
1025
1025
1026
- uint32_t channel = STM_PIN_CHANNEL (pinmap_function (pin, PinMap_PWM ));
1026
+ uint32_t channel = STM_PIN_CHANNEL (pinmap_function (pin, PinMap_TIM ));
1027
1027
1028
1028
previousMode = HT->getMode (channel);
1029
1029
if (previousMode != TIMER_OUTPUT_COMPARE_PWM1) {
@@ -1043,11 +1043,11 @@ void pwm_start(PinName pin, uint32_t PWM_freq, uint32_t value, TimerCompareForma
1043
1043
*/
1044
1044
void pwm_stop (PinName pin)
1045
1045
{
1046
- TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_PWM );
1046
+ TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral (pin, PinMap_TIM );
1047
1047
HardwareTimer *HT;
1048
1048
uint32_t index = get_timer_index (Instance);
1049
1049
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 ));
1051
1051
}
1052
1052
1053
1053
HT = (HardwareTimer *)(HardwareTimer_Handle[index ]->__this );
0 commit comments