Example #1
0
/*  MENU SELECTION */
void menu_select(void){
  int i;
  int choice = 1;
  char button_read = 0;

  //choice = 1; 
  show_choice(choice);

  while(alive && state == MENU_SELECT){
    while(!button && alive && state == MENU_SELECT){ // Just Wait 
      usleep(SLEEP);
    }
    if(state == EMERGENCY) break; // Get out if there's an emergency
    button_read = button;
    
    switch(button_read){
    case '1':
    case '2':
    case '3':
    case '4':
      choice = button_read - '0';
      show_choice(choice);
      break;
    case '5':
    case '6':
    case '7':
    case '8':  
    case '9':
    case '0':
      break;
    case ACCEPT_PLAY:
      break;
    
    case ENTER_MENU:
      break;

    case CANCEL:
      reset_buffer();
      state = WAITING_LOGGED_IN; // Go back to waiting
      break;

    case FORWARD:
      if(++choice == MENU_STR_NUM){
        choice = 1;
      }
      show_choice(choice);
      break;
      
    case BACK:
      if(--choice == 0){
        choice = MENU_STR_NUM - 1;
      }
      show_choice(choice);
      break;
      
    case DELETE:
    default:
      break;
    }
  }
}
Example #2
0
static void
show_precision (variable * v)
{
  show_choice (v, precision);
}
Example #3
0
static void
show_signal (variable * v)
{
  show_choice (v, signal_choices);
}
Example #4
0
static void
show_round (variable * v)
{
  show_choice (v, rounding);
}