diff --git a/Core/Inc/AMS_HighLevel.h b/Core/Inc/AMS_HighLevel.h index 870007a..70c6134 100644 --- a/Core/Inc/AMS_HighLevel.h +++ b/Core/Inc/AMS_HighLevel.h @@ -11,7 +11,6 @@ #include "ADBMS_Abstraction.h" #include "ADBMS_CMD_MAKROS.h" #include "ADBMS_LL_Driver.h" -#include "can.h" typedef enum { AMSDEACTIVE, diff --git a/Core/Inc/PWM_control.h b/Core/Inc/PWM_control.h index 50f0c9f..4c83bbb 100644 --- a/Core/Inc/PWM_control.h +++ b/Core/Inc/PWM_control.h @@ -1,5 +1,5 @@ -#ifndef INC_PWM_CONTROL_H_ -#define INC_PWM_CONTROL_H_ +#ifndef INC_PWM_CONTROL_H +#define INC_PWM_CONTROL_H #include "stm32f3xx_hal.h" #include "ADBMS_LL_Driver.h" @@ -28,4 +28,4 @@ void PWM_control_init(TIM_HandleTypeDef powerground1, TIM_HandleTypeDef powergro void PWM_powerground_control(uint8_t percent); void PWM_battery_cooling_control(uint8_t percent); -#endif /* INC_CHANNEL_CONTROL_H_ */ +#endif /* INC_CHANNEL_CONTROL_H */ diff --git a/Core/Inc/can.h b/Core/Inc/can.h index c355b19..7f6fcae 100644 --- a/Core/Inc/can.h +++ b/Core/Inc/can.h @@ -1,9 +1,12 @@ +#ifndef INC_CAN_H +#define INC_CAN_H #include "stm32f3xx_hal.h" #include <stdint.h> +#include "main.h" #include "AMS_HighLevel.h" -#include "can-halal.h" #include "state_machine.h" +#include "can-halal.h" #define CAN_ID_IN 0x501 #define CAN_ID_OUT 0x502 @@ -12,4 +15,6 @@ void can_init(CAN_HandleTypeDef* hcan); void can_handle_send_status(); -void can_handle_recieve_command(const uint8_t *data); \ No newline at end of file +void can_handle_recieve_command(const uint8_t *data); + +#endif /* "INC_CAN_H" */ \ No newline at end of file diff --git a/Core/Src/PWM_control.c b/Core/Src/PWM_control.c index a6be4ae..7ad7c19 100644 --- a/Core/Src/PWM_control.c +++ b/Core/Src/PWM_control.c @@ -25,7 +25,7 @@ void PWM_control_init(TIM_HandleTypeDef powerground1, TIM_HandleTypeDef powergro controls the duty cycle of the fans by setting the CCR of the channel percent/100 = x/ARR */ void PWM_powerground_control(uint8_t percent){ - if (percent > 100 || percent < 0) + if (percent > 100) //something went wrong return; powerground_status = percent/100;