diff --git a/firmware/Sources/HAL/HAL_PWM/hal_pwm.c b/firmware/Sources/HAL/HAL_PWM/hal_pwm.c index 2a6d4f7..0d02564 100644 --- a/firmware/Sources/HAL/HAL_PWM/hal_pwm.c +++ b/firmware/Sources/HAL/HAL_PWM/hal_pwm.c @@ -23,7 +23,6 @@ /* Definition of local symbolic constants */ /**********************************************************************************/ -#define MIN_PWM 96 /**********************************************************************************/ /* Definition of local function like macros */ /**********************************************************************************/ @@ -89,12 +88,12 @@ HAL_PWM_result_e HAL_PwmSetDuty(const uint32_t duty){ } //If duty between max and min values - else if (duty>=MIN_PWM){ + else if (duty>=HAL_PWM_MIN_PWM){ pwm_duty = duty; } else{ // Minimum duty to apply to the pwm is 96 by hardware with the actual configuration. - pwm_duty = MIN_PWM; + pwm_duty = HAL_PWM_MIN_PWM; } // Write the value to compare in the register. diff --git a/firmware/Sources/HAL/HAL_PWM/hal_pwm.h b/firmware/Sources/HAL/HAL_PWM/hal_pwm.h index cee06ae..222cb42 100644 --- a/firmware/Sources/HAL/HAL_PWM/hal_pwm.h +++ b/firmware/Sources/HAL/HAL_PWM/hal_pwm.h @@ -16,6 +16,8 @@ /**********************************************************************************/ /* Definition of local symbolic constants */ /**********************************************************************************/ +#define HAL_PWM_MIN_PWM 96 +/* This value depends on the prescaler of the HRTIM, go to documentation for more info */ /**********************************************************************************/ /* Definition of local function like macros */