File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -361,13 +361,13 @@ STATIC uint32_t compute_pwm_value_from_percent(uint32_t period, mp_obj_t percent
361361 if (0 ) {
362362 #if MICROPY_PY_BUILTINS_FLOAT
363363 } else if (MP_OBJ_IS_TYPE (percent_in , & mp_type_float )) {
364- float percent = mp_obj_get_float (percent_in );
364+ mp_float_t percent = mp_obj_get_float (percent_in );
365365 if (percent <= 0.0 ) {
366366 cmp = 0 ;
367367 } else if (percent >= 100.0 ) {
368368 cmp = period ;
369369 } else {
370- cmp = percent / 100.0 * ((float )period );
370+ cmp = percent / 100.0 * ((mp_float_t )period );
371371 }
372372 #endif
373373 } else {
@@ -391,11 +391,11 @@ STATIC uint32_t compute_pwm_value_from_percent(uint32_t period, mp_obj_t percent
391391// Helper function to compute percentage from timer perion and PWM value.
392392STATIC mp_obj_t compute_percent_from_pwm_value (uint32_t period , uint32_t cmp ) {
393393 #if MICROPY_PY_BUILTINS_FLOAT
394- float percent ;
394+ mp_float_t percent ;
395395 if (cmp >= period ) {
396396 percent = 100.0 ;
397397 } else {
398- percent = (float )cmp * 100.0 / ((float )period );
398+ percent = (mp_float_t )cmp * 100.0 / ((mp_float_t )period );
399399 }
400400 return mp_obj_new_float (percent );
401401 #else
You can’t perform that action at this time.
0 commit comments