File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
targets/TARGET_Silicon_Labs/TARGET_EFM32 Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -342,13 +342,13 @@ void pwmout_pulsewidth(pwmout_t *obj, float seconds)
342
342
343
343
void pwmout_pulsewidth_ms (pwmout_t * obj , int ms )
344
344
{
345
- uint16_t width_cycles = (uint16_t ) ((REFERENCE_FREQUENCY >> pwm_prescaler_div ) * ms ) / 1000 ;
345
+ uint16_t width_cycles = (uint16_t ) ((( REFERENCE_FREQUENCY >> pwm_prescaler_div ) * ms ) / 1000 ) ;
346
346
TIMER_CompareBufSet (PWM_TIMER , obj -> channel , width_cycles );
347
347
}
348
348
349
349
void pwmout_pulsewidth_us (pwmout_t * obj , int us )
350
350
{
351
- uint16_t width_cycles = (uint16_t ) ((REFERENCE_FREQUENCY >> pwm_prescaler_div ) * us ) / 1000000 ;
351
+ uint16_t width_cycles = (uint16_t ) ((( uint64_t )( REFERENCE_FREQUENCY >> pwm_prescaler_div ) * ( uint64_t ) us ) / 1000000UL ) ;
352
352
TIMER_CompareBufSet (PWM_TIMER , obj -> channel , width_cycles );
353
353
}
354
354
You can’t perform that action at this time.
0 commit comments