This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS570LS3137: TPS65381 (about spna176a) example

Part Number: TMS570LS3137

Tool/software: Code Composer Studio

Hello 

example code

I dont understand these code 

void rtiNotification(uint32_t notification)
{
/* enter user code between the USER CODE BEGIN and USER CODE END. */
/* USER CODE BEGIN (9) */
short WdgFailCount;
switch(notification)
{
case 4 :
switch (WDWindow)
{
/** send three answers during open window */
case ECMP_WINDOW_OPEN :
WdgFailCount = ecmpGetWdgFailCount();
if(WdgFailCount == 0)
{
switch (Curr_Sta)
{
case 0:
if(ecmpEnableWdg()) Curr_Sta++;
ecmpLockRegisters();
break;
case 1:
if(ecmpLeaveDiagnosticState()) Curr_Sta++;
break;
default:
break;
}
}
ecmpSendWdgAnswer();
ecmpSendWdgAnswer();
ecmpSendWdgAnswer();
/* set next RTI IRQ */
rtiREG1->CMP[2U].UDCPx = TrgPulseOpen;
WDWindow = ECMP_WINDOW_CLOSE;
while((scilinREG->FLR & 0x00000100) ==0);
scilinREG->TD = WdgFailCount+'0';
break;

/** send last answer during close window */
case ECMP_WINDOW_CLOSE :
ecmpSendWdgAnswer();
rtiREG1->CMP[2U].UDCPx = TrgPulseClose;
WDWindow = ECMP_WINDOW_OPEN;
break;
}
if((*(volatile unsigned int *) 0xFFF7BC58) & (1<<7)) ( *(volatile unsigned int *)0xFFF7BC64 ) = 1<<7;
else (*( volatile unsigned int *)0xFFF7BC60 ) = 1<<7;
}
return;
/* USER CODE END */
}

which

{

case 0:
if(ecmpEnableWdg()) Curr_Sta++;
ecmpLockRegisters();

}

I means :

if (WdgFailCount!=0) the watchdog doesn't enable.There will be hidden dangers.

unless when watchdog doesn't enable,The program knows.

How to know if the watchdog has started?

Best