Commit 3daaa940 authored by Peter Zumbruch's avatar Peter Zumbruch
Browse files

split show reset source analysis from show and moved it to api.c

git-svn-id: https://subversion.gsi.de/epics/trunk/hadcon/API-Slave@406 50339f28-a4cd-11e1-ab1f-8360dde1fe65
parent b516c81f
......@@ -265,35 +265,33 @@ void showResetSource(uint8_t startup_flag)
strncat_P(uart_message_string, PSTR(" system (re)started by: "), BUFFER_SIZE - 1);
}
if ( mcusr & (1 << JTRF) )
{
strncat_P(uart_message_string, PSTR("JTAG Reset"), BUFFER_SIZE - 1);
}
else if ( mcusr & (1 << WDRF) )
switch(resetSource)
{
case resetSource_WATCHDOG:
strncat_P(uart_message_string, PSTR("Watchdog Reset"), BUFFER_SIZE - 1);
}
else if ( mcusr & (1 << BORF) )
{
break;
case resetSource_JTAG:
strncat_P(uart_message_string, PSTR("JTAG Reset"), BUFFER_SIZE - 1);
break;
case resetSource_BROWN_OUT:
strncat_P(uart_message_string, PSTR("Brown Out Reset"), BUFFER_SIZE - 1);
}
else if ( mcusr & (1 << EXTRF) )
{
break;
case resetSource_EXTERNAL:
strncat_P(uart_message_string, PSTR("External Reset"), BUFFER_SIZE - 1);
}
else if ( mcusr & (1 << PORF) )
{
break;
case resetSource_POWER_ON:
strncat_P(uart_message_string, PSTR("Power On Reset"), BUFFER_SIZE - 1);
break;
case resetSource_UNKNOWN_REASON:
default:
strncat_P(uart_message_string, PSTR("unknown reset reason"), BUFFER_SIZE - 1);
break;
}
else
{
strncat_P(uart_message_string, PSTR("unknown reason"), BUFFER_SIZE - 1);
}
snprintf_P(uart_message_string, BUFFER_SIZE - 1, PSTR("%s (MCUSR: 0x%x)"),uart_message_string, mcusr );
UART0_Send_Message_String_p(NULL,0);
}
void showWatchdogIncarnationsCounter(uint8_t startup_flag)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment