/* * bsp_Error_Detect.c * * Created on: Oct 23, 2024 * Author: akeguo */ #include "bsp_Error_Detect.h" void ErrorDetect(); HardWareController *HardWareErrorController; void Error_Detect_Intialzie(uint16_t DispacherPeriod) { HardWareErrorController = (HardWareController*) malloc( sizeof(HardWareController)); HardWareErrorController->pComHWHead = NULL; HardWareErrorController->pComHWTail = NULL; HardWareErrorController->Add_PCOMHardWare = ComHardWare_List_Add_t; HardWareErrorController->Set_PCOMHardWare = Set_PCOMHardWare_t; HardWareErrorController->PCOMHardWare_Check = PCOMHardWare_Check_t; HardWareErrorController->DispacherCallTime = DispacherPeriod;//check the communicaton every 50ms GF_BSP_Interrupt_Add_CallBack( DF_BSP_InterCall_TIM8_2ms_PeriodElapsedCallback, ErrorDetect); } void ErrorDetect() { HardWareErrorController->PCOMHardWare_Check(HardWareErrorController); }