/* * Check_Shunt_Limits.c * * Created on: Jun 16, 2022 * Author: max */ #include "Check_Shunt_Limits.h" #include "AMS_Errorcodes.h" #include "main.h" ShuntData shunt_data; void CheckShuntLimits() { uint32_t now = HAL_GetTick(); if (((shunt_data.last_message + SHUNT_TIMEOUT) < now) && (now > 2000)) { AMSErrorHandle error; error.errorcode = AMS_ERROR_SHUNT_TIMEOUT; AMS_Error_Handler(&error); } /*if(shuntcurrent > SHUNT_OVERCURRENT) { AMS_Error_Handler(0x07); } if(shuntbusbartemp > SHUNT_OVERTEMP) { AMS_Error_Handler(0x08); }*/ }