diff --git a/examples/foc/foc_cfg.h b/examples/foc/foc_cfg.h index 44f46c4ab..14a1d1a47 100644 --- a/examples/foc/foc_cfg.h +++ b/examples/foc/foc_cfg.h @@ -180,7 +180,7 @@ /* CHARCTRL setpoint control */ #ifdef CONFIG_EXAMPLES_FOC_SETPOINT_CHAR -# define SETPOINT_ADC_SCALE (1 / 1000.0f) +# define SETPOINT_ADC_SCALE (1.0f / (CONFIG_EXAMPLES_FOC_SETPOINT_MAX / 1000.0f)) #endif /* VBUS source must be specified */