Energy Micro IEC60355 Library Project 1.037 GCC-Version
IEC60355 Library documentation and API

iec60335_class_b_post.c

Go to the documentation of this file.
00001 /***************************************************************************/
00030 #include "iec60335_class_b.h"
00031 
00041 #if defined (__ICCARM__)
00042     #pragma section="IEC60335_code"
00043 #else
00044 __attribute__((section(".IEC60335_code")))
00045 #endif
00046 
00047 void IEC60335_ClassB_POST(void)
00048 {
00049   volatile testResult_t result = IEC60335_testFailed;   /* variable is located in the stack */
00050 #if ((TEST_POST_WDOG == 1) || (TESSY))
00051 
00052   result = IEC60335_ClassB_Force_WDT_Reset();           /* test WDOG with reset */
00053 
00054   if (result == IEC60335_testInProgress)
00055   {
00056     /* enable LED0 */
00057     DVK_SPI(0);                                         /* enable SPI */
00058     DVK_SPI(1);                                         /* enable LED0 */
00059   }
00060   if (result != IEC60335_testPassed)
00061   {
00062     LoopForever();                                      /* remains until WDOG test passes */
00063   }
00064   /* enable LED0 and LED1 */
00065   DVK_SPI(0);                                           /* enable SPI */
00066   DVK_SPI(2);                                           /* enable LED0,1 */
00068 #endif
00069 
00070 #if (TEST_POST_FLASH == 1)
00071 
00072   result = IEC60335_testFailed;
00073   result = IEC60335_ClassB_FLASHtest_POST();            /* test FLASH content */
00074 
00075 /* TODO : insert correct CRC value to line 80 in iec60355_class_b_flash_test.h */
00076   if (result != IEC60335_testPassed)
00077   {
00078     LoopForever();                                      /* remains if Flash content is not consistent */
00079   }
00081 #endif
00082 
00083 #if (TEST_POST_RAM == 1)
00084 
00085   result = IEC60335_testFailed;
00086   result = IEC60335_ClassB_RAMtest_POST();              /* stack is not tested here */
00087 
00088   if (result != IEC60335_testPassed)
00089   {
00090     LoopForever();                                      /* remains if RAM test fails */
00091   }
00093 #endif
00094 #if (TEST_POST_CPUREG == 1)
00095 
00096   result = IEC60335_testFailed;
00097   result = IEC60335_ClassB_CPUregTest_POST();
00098 
00099   if (result != IEC60335_testPassed)
00100   {
00101     LoopForever();                                      /* remains if registers test fails */
00102   }
00104 #endif
00105 #if (TEST_POST_PC == 1)
00106 
00107   result = IEC60335_testFailed;
00108   result = IEC60335_ClassB_PCTest_POST(PCTest_funcTable, PCTest_resultTable);
00109 
00110   if (result != IEC60335_testPassed)
00111   {
00112     LoopForever();                                      /* remains if PC test fails */
00113   }
00115 #endif
00116 }
00117 
00122 /************************************** EOF *********************************/