Exemplo n.º 1
0
/*
** ===================================================================
**     Event       :  EVNT1_AppHandleEvent (module Events)
**
**     Component   :  EVNT1 [SimpleEvents]
**     Description :
**
**     Parameters  :
**         NAME            - DESCRIPTION
**         event           - Event (event number) to be processed.
**     Returns     : Nothing
** ===================================================================
*/
void EVNT1_AppHandleEvent(uint8_t event)
{
    APP_HandleEvent(event);
}
Exemplo n.º 2
0
void RTOS_HandleEvent(byte event) {
  switch(event) {
  #if PL_HAS_HW_NAV_SWITCH
    case EVNT1_BUTTON1_RELEASED:
    #if PL_HAS_HW_LCD /* rotate switch meaning depending on orientation */
      switch(GDisp1_GetDisplayOrientation()) {
        case GDisp1_ORIENTATION_LANDSCAPE180: EVNT1_SetEvent(EVNT1_BUTTON_UI_LEFT);  break;
        case GDisp1_ORIENTATION_PORTRAIT:     EVNT1_SetEvent(EVNT1_BUTTON_UI_DOWN);  break;
        case GDisp1_ORIENTATION_LANDSCAPE:    EVNT1_SetEvent(EVNT1_BUTTON_UI_RIGHT); break;
        case GDisp1_ORIENTATION_PORTRAIT180:  EVNT1_SetEvent(EVNT1_BUTTON_UI_UP);    break;
      } /* switch */
    #else
      EVNT1_SetEvent(EVNT1_BUTTON_UI_RIGHT);
    #endif
      break;
    case EVNT1_BUTTON2_RELEASED:
    #if PL_HAS_HW_LCD /* rotate switch meaning depending on orientation */
      switch(GDisp1_GetDisplayOrientation()) {
        case GDisp1_ORIENTATION_LANDSCAPE180: EVNT1_SetEvent(EVNT1_BUTTON_UI_UP);    break;
        case GDisp1_ORIENTATION_PORTRAIT:     EVNT1_SetEvent(EVNT1_BUTTON_UI_LEFT);  break;
        case GDisp1_ORIENTATION_LANDSCAPE:    EVNT1_SetEvent(EVNT1_BUTTON_UI_DOWN);  break;
        case GDisp1_ORIENTATION_PORTRAIT180:  EVNT1_SetEvent(EVNT1_BUTTON_UI_RIGHT); break;
      } /* switch */
    #else
      EVNT1_SetEvent(EVNT1_BUTTON_UI_DOWN);
    #endif
      break;
    case EVNT1_BUTTON5_RELEASED:
    #if PL_HAS_HW_LCD /* rotate switch meaning depending on orientation */
      switch(GDisp1_GetDisplayOrientation()) {
        case GDisp1_ORIENTATION_LANDSCAPE180: EVNT1_SetEvent(EVNT1_BUTTON_UI_RIGHT); break;
        case GDisp1_ORIENTATION_PORTRAIT:     EVNT1_SetEvent(EVNT1_BUTTON_UI_UP);    break;
        case GDisp1_ORIENTATION_LANDSCAPE:    EVNT1_SetEvent(EVNT1_BUTTON_UI_LEFT);  break;
        case GDisp1_ORIENTATION_PORTRAIT180:  EVNT1_SetEvent(EVNT1_BUTTON_UI_DOWN);  break;
      } /* switch */
    #else
      EVNT1_SetEvent(EVNT1_BUTTON_UI_LEFT);
    #endif
      break;
    case EVNT1_BUTTON3_PRESSED:
      EVNT1_SetEvent(EVNT1_BUTTON_UI_MIDDLE_DOWN);
      break;
    case EVNT1_BUTTON3_RELEASED:
      EVNT1_SetEvent(EVNT1_BUTTON_UI_MIDDLE);
      break;
    case EVNT1_BUTTON4_RELEASED:
    #if PL_HAS_HW_LCD /* rotate switch meaning depending on orientation */
      switch(GDisp1_GetDisplayOrientation()) {
        case GDisp1_ORIENTATION_LANDSCAPE180: EVNT1_SetEvent(EVNT1_BUTTON_UI_DOWN);  break;
        case GDisp1_ORIENTATION_PORTRAIT:     EVNT1_SetEvent(EVNT1_BUTTON_UI_RIGHT); break;
        case GDisp1_ORIENTATION_LANDSCAPE:    EVNT1_SetEvent(EVNT1_BUTTON_UI_UP);    break;
        case GDisp1_ORIENTATION_PORTRAIT180:  EVNT1_SetEvent(EVNT1_BUTTON_UI_LEFT);  break;
      } /* switch */
    #else
      EVNT1_SetEvent(EVNT1_BUTTON_UI_UP);
    #endif
      break;
  #elif (PL_BOARD_TWR_CN128 || PL_BOARD_TWR_52259) /* use the TWR SW2 and SW3, translate to navigation messages */
    case EVNT1_BUTTON1_RELEASED:      EVNT1_SetEvent(EVNT1_BUTTON_UI_LEFT);  break;
    case EVNT1_BUTTON2_RELEASED:      EVNT1_SetEvent(EVNT1_BUTTON_UI_RIGHT);  break;
    case EVNT1_BUTTON1_RELEASED_LONG: EVNT1_SetEvent(EVNT1_BUTTON_UI_MIDDLE);  break;
    case EVNT1_BUTTON2_RELEASED_LONG: EVNT1_SetEvent(EVNT1_BUTTON_UI_MIDDLE);  break;
  #endif
    case EVNT1_BUZZER_BEEP:
  #if PL_HAS_HW_SOUNDER
      BUZ_Beep();
  #endif
      break;
    default:
      break;
  } /* switch */
  /* call other event handler... */
#if PL_HAS_UI
  APP_HandleEvent(event);
#endif
#if PL_APP_MODE_I2C_LCD
  I2C_HandleEvent(event);
#endif
}
Exemplo n.º 3
0
/*
** ===================================================================
**     Event       :  EVNT1_AppHandleEvent (module Events)
**
**     Component   :  EVNT1 [SimpleEvents]
**     Description :
**         
**     Parameters  :
**         NAME            - DESCRIPTION
**         event           - Event (event number) to be processed.
**     Returns     : Nothing
** ===================================================================
*/
void EVNT1_AppHandleEvent(byte event)
{
  APP_HandleEvent(event);
}