Exemplo n.º 1
0
void main(void)
{
   int p;
   puts("\rStarting, should delay for 10 seconds\r");
   EF_Timer_Init(EF_Timer_RATE_8MS);
   EF_Timer_InitTimer(0, TIME_OUT_DELAY); /* TIME_OUT_DELAY  = 10s w/ 8.19mS interval */
   EF_Timer_InitTimer(1, TIME_OUT_DELAY);
   EF_Timer_InitTimer(2, TIME_OUT_DELAY);
   EF_Timer_InitTimer(3, TIME_OUT_DELAY);
   EF_Timer_InitTimer(4, TIME_OUT_DELAY);
   EF_Timer_InitTimer(5, TIME_OUT_DELAY);
   EF_Timer_InitTimer(6, TIME_OUT_DELAY);
   EF_Timer_InitTimer(7, TIME_OUT_DELAY);
   while(EF_Timer_IsTimerExpired(0) != EF_Timer_EXPIRED)
      ;
   puts("Timed Out\r");

   EF_Timer_InitTimer(7, TIME_OUT_DELAY);
   for (p=0;p<10000;p++ ); /* kill some time */
   EF_Timer_StopTimer(7);
   if (EF_Timer_IsTimerActive(7) != EF_Timer_NOT_ACTIVE)
      puts("Timer Stop Failed\r");
   else
      puts("Timer Stop Succeded, restarting timeout\r");
   EF_Timer_StartTimer(7);
   while(EF_Timer_IsTimerExpired(7) != EF_Timer_EXPIRED)
      ;

   puts("Timed Out Again\r");

   DisableInterrupts;
}
Exemplo n.º 2
0
void main( void) {
EF_Return_t ErrorType;

puts("Starting Remote Lock State Machine using the Event Framework\r");
puts(" Press 'u' to unlock or 'l' to locks\n\r");

// Your hardware initialization function calls go here
EF_Timer_Init(EF_Timer_RATE_1MS);

// now initialize the state machines and start them running
ErrorType = EF_Initialize();
if ( ErrorType == Success ) {

  ErrorType = EF_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(;;);

};