int main(void) { // Set the clock to run at 40MhZ using the PLL and 16MHz external crystal SysCtlClockSet(SYSCTL_SYSDIV_5 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); TERMIO_Init(); clrScrn(); ES_Return_t ErrorType; // When doing testing, it is useful to announce just which program // is running. puts("\rStarting Test Harness for \r"); printf("the 2nd Generation Events & Services Framework V2.2\r\n"); printf("%s %s\n",__TIME__, __DATE__); printf("\n\r\n"); printf("Press any key to post key-stroke events to Service 0\n\r"); printf("Press 'd' to test event deferral \n\r"); printf("Press 'r' to test event recall \n\r"); // Your hardware initialization function calls go here InitUart1(); // now initialize the Events and Services Framework and start it running ErrorType = ES_Initialize(ES_Timer_RATE_1mS); if ( ErrorType == Success ) { ErrorType = ES_Run(); } //if we got to here, there was an error switch (ErrorType){ case FailedPost: printf("Failed on attempt to Post\n"); break; case FailedPointer: printf("Failed on NULL pointer\n"); break; case FailedInit: printf("Failed Initialization\n"); break; default: printf("Other Failure\n"); break; } for(;;) ; }
int main(void) { PortFunctionInit(); TERMIO_Init(); clrScrn(); // When doing testing, it is useful to announce just which program // is running. puts("\rStarting Test Harness for \r"); printf("the 2nd Generation Events & Services Framework V2.2\r\n"); printf("%s %s\n",__TIME__, __DATE__); printf("\n\r\n"); printf("Press any key to post key-stroke events to Service 0\n\r"); printf("Press 'd' to test event deferral \n\r"); printf("Press 'r' to test event recall \n\n\r"); }
int main (void) { ES_Return_t ErrorType; // Your hardware initialization function calls go here // Set the clock to run at 40MhZ using the PLL and 16MHz external crystal SysCtlClockSet(SYSCTL_SYSDIV_5 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); // Initialize the terminal for puts/printf debugging TERMIO_Init(); clrScrn(); // When doing testing, it is useful to announce just which program // is running. puts("\rStarting Test Harness for \r"); printf("the 2nd Generation Events & Services Framework V2.2\r\n"); printf("Template for HSM implementation\r\n"); printf("%s %s\n",__TIME__, __DATE__); printf("\n\r\n"); // now initialize the Events and Services Framework and start it running ErrorType = ES_Initialize(ES_Timer_RATE_10mS); if ( ErrorType == Success ) { ErrorType = ES_Run(); } //if we got to here, there was an error switch (ErrorType){ case FailedPointer: puts("Failed on NULL pointer"); break; case FailedInit: puts("Failed Initialization"); break; default: puts("Other Failure"); break; } for(;;) // hang after reporting error ; }