예제 #1
0
파일: main.c 프로젝트: atp42/StanleyJunior
void main( void) 
{
   ES_Return_t ErrorType;

   // When doing testing, it is usefull to annouce just which program
   // is running.
   // Your hardware initialization function calls go here

   // now initialize the Events and Services Framework and start it running
   ErrorType = ES_Initialize(ES_Timer_RATE_1MS);
   if ( ErrorType == Success ) {

     ErrorType = ES_Run();

   }
   printf("ES failed!!\r\n");
   //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(;;)
     ;  

};
예제 #2
0
파일: BotMain.c 프로젝트: friend0/panda_bot
void main(void)
{

    ES_Return_t ErrorType;
    BOARD_Init();
    //printf("Starting Intern State Machine \n");
    //printf("using the 2nd Generation Events & Services Framework\n");


    //Hardware Init
    Bot_Init();
    // Framework Init
    ErrorType = ES_Initialize();

    if (ErrorType == Success) {

        ErrorType = ES_Run();
    }

    //if we got to here, there was an error
    switch (ErrorType) {
    case FailedPointer:
        printf("Failed on NULL pointer");
        break;
    case FailedInit:
        printf("Failed Initialization");
        break;
    default:
        printf("Other Failure");
        break;
    }
    for (;;)
        ;

};
예제 #3
0
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(;;)
	  ;

}
예제 #4
0
void main( void) {
ES_Return_t ErrorType;

// Your hardware initialization function calls go here
    /***** 16F690 Code ****
     *  Internal oscillator set to 8MHz
     */
OSCCON  = 0b01110000;
    /*
     *  RC0 = heartbeat output
     */
    TRISC0  =  0;   // Output
    ANS4 = 0;       // disable A/D on RC0 so we can read it

USART_Init();

// When doing testing, it is usefull to annouce just which program
// is running.
puts("Starting Remote Lock State Machine (2) \r");
puts("using the 2nd Generation Events & Services Framework for PIC\n\r");
puts(" Press 'u' to unlock or 'l' to lock\n\r");

// 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 FailedPointer:
    puts("Failed on NULL pointer");
    break;
  case FailedInit:
    puts("Failed Initialization");
    break;
 default:
    puts("Other Failure");
    break;
}
for(;;)
  ;

};
예제 #5
0
void main(void) {

    ES_Return_t ErrorType;
    uint8_t i;
    BOARD_Init();
    // When doing testing, it is usefull to annouce just which program
    // is running.

    printf("Starting Timer Service Test Harness \r\n");
    printf("using the 2nd Generation Events & Services Framework\n\r");

    // Your hardware initialization function calls go here

    // now initialize the Events and Services Framework and start it running
    ErrorType = ES_Initialize();

    timerServiceTestingState = init;
    for (i = 0; i <= TIMERS_USED; i++) {
        ES_Timer_InitTimer(i, (i + 1)*1000); //for second scale
    }
    if (ErrorType == Success) {

        ErrorType = ES_Run();

    }
    //if we got to here, there was an error
    switch (ErrorType) {
        case FailedPointer:
            printf("Failed on NULL pointer");
            break;
        case FailedInit:
            printf("Failed Initialization");
            break;
        default:
            printf("Other Failure");
            break;
    }
    for (;;)
        ;

};
예제 #6
0
void main(void)
{
	ES_Return_t ErrorType;
	BOARD_Init();
	// When doing testing, it is useful to annouce just which program
	// is running.

	printf("Starting the Exit HSM Test Harness \r\n");
	printf("using the 2nd Generation Events & Services Framework\n\r");

	// Your hardware initialization function calls go here
	Bot_Init();
	Drive_Init();

	// now initialize the Events and Services Framework and start it running
	ErrorType = ES_Initialize();

	if (ErrorType == Success) {
		ErrorType = ES_Run();
	}

	//
	//if we got to here, there was an error
	//

	switch (ErrorType) {
	case FailedPointer:
		printf("Failed on NULL pointer");
		break;
	case FailedInit:
		printf("Failed Initialization");
		break;
	default:
		printf("Other Failure");
		break;
	}

	while (1) {
		;
	}
}
예제 #7
0
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
    ;
}