123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- #include "Hal_Wdg.h"
- volatile uint8 notificationCount = 0;
- void WdgInit(void)
- {
-
- Wdg_43_Instance0_Init(&Wdg_Config_0_VS_0);
-
- Wdg_43_Instance0_SetTriggerCondition(5000);
-
- Wdg_43_Instance0_SetMode(WDGIF_FAST_MODE);
-
- Wdg_43_Instance0_SetTriggerCondition(15000);
- }
- void WdgDeInit(void)
- {
- Wdg_43_Instance0_SetMode(WDGIF_OFF_MODE);
- }
- void Wdg_CallBackNotification1(void)
- {
- notificationCount = 1U;
- }
- static void HAL_1msPeriod(void)
- {
- uint16 cntTmp = 0u;
-
- cntTmp = hal_1ms_TimerCounter + 1u;
- if (0u != cntTmp)
- {
- hal_1ms_TimerCounter++;
- }
- cntTmp = hal_100ms_TimerCounter + 1u;
- if (0u != cntTmp)
- {
- hal_100ms_TimerCounter++;
- }
- }
- void vTimer1msCallback(TimerHandle_t pxTimer)
- {
- uint32 ulTimerID;
- ulTimerID = (uint32)pvTimerGetTimerID(pxTimer);
- if(ulTimerID==0)
- {
- HAL_1msPeriod();
- }
- }
- boolean HAL_Is1msTickTimeout(void)
- {
- boolean result = FALSE;
- if (hal_1ms_TimerCounter)
- {
- result = TRUE;
- hal_1ms_TimerCounter--;
- }
- return result;
- }
- boolean HAL_Is100msTickTimeout(void)
- {
- boolean result = FALSE;
- if (hal_100ms_TimerCounter >= 100u)
- {
- result = TRUE;
- hal_100ms_TimerCounter -= 100u;
- }
- return result;
- }
- uint32 HAL_GetTimerTickCnt(void)
- {
-
- uint32 hardwareTimerTickCnt;
- uint32 timerTickCnt;
- #if 0
-
- hardwareTimerTickCnt = LPTMR_DRV_GetCounterValueByCount(INST_LPTMR1);
- #endif
- #pragma GCC diagnostic ignored "-Wuninitialized"
- timerTickCnt = ((hardwareTimerTickCnt & 0xFFFFu)) | (timerTickCnt << 16u);
- return timerTickCnt;
- }
- void WATCHDOG_HAL_Feed(void)
- {
- Wdg_43_Instance0_SetTriggerCondition(500);
- }
- void DoResetECUWithWdg(void)
- {
- IsFeedWdg = FALSE;
- Wdg_43_Instance0_SetTriggerCondition(0);
- }
|