If the averaged motor temperature exeeds a specified value a counter will be incremented and a warning condition flag will be set. If this counter in turn exeeds a specified limit, a temperature error flag will be set. If the temperature falls, the warning or error flags will be cleared.
Definition at line 165 of file temp.c. References COND_TEMP_ERR, COND_TEMP_WARN, mg_u16Value, mg_u8WarningCnt, safety_ClearCondition(), safety_SetCondition(), temp_GetCelsius(), VALUE_TEMP_ERROR, VALUE_TEMP_WARN, and WARNING_COUNT. Referenced by main(). { if(temp_GetCelsius(mg_u16Value) < VALUE_TEMP_WARN) { if (mg_u8WarningCnt > 0U) { mg_u8WarningCnt--; } } else if(temp_GetCelsius(mg_u16Value) < VALUE_TEMP_ERROR) { mg_u8WarningCnt++; } else { mg_u8WarningCnt = WARNING_COUNT; } if(mg_u8WarningCnt >= WARNING_COUNT) { mg_u8WarningCnt = WARNING_COUNT; safety_ClearCondition(COND_TEMP_WARN); safety_SetCondition(COND_TEMP_ERR); } else if (mg_u8WarningCnt > 0U) { safety_SetCondition(COND_TEMP_WARN); safety_ClearCondition(COND_TEMP_ERR); } else { safety_ClearCondition(COND_TEMP_WARN); safety_ClearCondition(COND_TEMP_ERR); } }
Here is the call graph for this function:
![]()
Here is the caller graph for this function:
![]() |