Esempio n. 1
0
File: fy.c Progetto: AndTH/GCA
/*
 * the program start
 */
void main(void) {
  unsigned char state = STATE_STARTUP;

  /* state machine */
  while(1) { /* Loop forever */

    switch( state ) {
      case STATE_STARTUP:
        startup();
        state = STATE_INIT;
        break;

      case STATE_INIT:
        state = STATE_OPERATE;
        break;

      case STATE_SETUP:
        setup();
        state = STATE_INIT;
        break;

      case STATE_OPERATE:
        if( buttonSetup == BUTTON_ON ) {
          state = STATE_SETUP;
        }
        else {
          automode();
          manualmode();
        }
        break;

    } // end switch

  }; // end while

}
Esempio n. 2
0
void mode2()
{
	automode();
}