コード例 #1
0
ファイル: Events.c プロジェクト: infotronik/sumo
/*
** ===================================================================
**     Event       :  SW_A_OnInterrupt (module Events)
**
**     Component   :  SW_A [ExtInt]
**     Description :
**         This event is called when an active signal edge/level has
**         occurred.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
void SW_A_OnInterrupt(void)
{
    #if PL_HAS_KBI
        if(KEY1_Get()){
            KEY_OnInterrupt(KEY_BTN1);
        }
    #endif
}
コード例 #2
0
ファイル: Remote.c プロジェクト: infotronik/sumo
static uint8_t APP_GetKeys(uint8_t *keys) {
    *keys = KEY1_Get() << KEY_BTN1 |
            KEY2_Get() << KEY_BTN2 |
            KEY3_Get() << KEY_BTN3 |
            KEY4_Get() << KEY_BTN4 |
            KEY5_Get() << KEY_BTN5 |
            KEY6_Get() << KEY_BTN6 |
            KEY7_Get() << KEY_BTN7 ;
}
コード例 #3
0
ファイル: Events.c プロジェクト: ivoEBV/INTRO_SUMOCRUSER
/*
** ===================================================================
**     Event       :  SW1_OnInterrupt (module Events)
**
**     Component   :  SW1 [ExtInt]
**     Description :
**         This event is called when an active signal edge/level has
**         occurred.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
void SW1_OnInterrupt(void)
{
  /* Write your code here ... */
#if PL_HAS_KBI
  if (KEY1_Get()) {
    KEY_OnInterrupt(KEY_BTN1);
  }
#endif
}
コード例 #4
0
ファイル: Keys.c プロジェクト: danstadelmann/INTRO_CW
void KEY_Scan(void) {
  /*! check handling all keys */
#if PL_CONFIG_HAS_DEBOUNCE
  KEYDBNC_Process();
#else
  #if PL_CONFIG_NOF_KEYS >= 1
    if (KEY1_Get()) { /* key pressed */
      EVNT_SetEvent(EVNT_SW1_PRESSED);
    }
  #endif
  #if PL_CONFIG_NOF_KEYS >= 2
    if (KEY2_Get()) { /* key pressed */
      EVNT_SetEvent(EVNT_SW2_PRESSED);
    }
  #endif
  #if PL_CONFIG_NOF_KEYS >= 3
    if (KEY3_Get()) { /* key pressed */
      EVNT_SetEvent(EVNT_SW3_PRESSED);
    }
  #endif
  #if PL_CONFIG_NOF_KEYS >= 4
    if (KEY4_Get()) { /* key pressed */
      EVNT_SetEvent(EVNT_SW4_PRESSED);
    }
  #endif
  #if PL_CONFIG_NOF_KEYS >= 5
    if (KEY5_Get()) { /* key pressed */
      EVNT_SetEvent(EVNT_SW5_PRESSED);
    }
  #endif
  #if PL_CONFIG_NOF_KEYS >= 6
    if (KEY6_Get()) { /* key pressed */
      EVNT_SetEvent(EVNT_SW6_PRESSED);
    }
  #endif
  #if PL_CONFIG_NOF_KEYS >= 7
    if (KEY7_Get()) { /* key pressed */
      EVNT_SetEvent(EVNT_SW7_PRESSED);
    }
  #endif
#endif
}
コード例 #5
0
/*!
 * \brief Returns the state of the keys. This directly reflects the value of the port
 * \return Port bits
 */
static DBNC_KeySet KEYDBNC_GetKeys(void) {
  DBNC_KeySet keys = 0;

#if PL_CONFIG_NOF_KEYS >= 1
  if (KEY1_Get()) {
    keys |= (1<<0);
  }
#endif
#if PL_CONFIG_NOF_KEYS >= 2
  if (KEY2_Get()) {
    keys |= (1<<1);
  }
#endif
#if PL_CONFIG_NOF_KEYS >= 3
  if (KEY3_Get()) {
    keys |= (1<<2);
  }
#endif
#if PL_CONFIG_NOF_KEYS >= 4
  if (KEY4_Get()) {
    keys |= (1<<3);
  }
#endif
#if PL_CONFIG_NOF_KEYS >= 5
  if (KEY5_Get()) {
    keys |= (1<<4);
  }
#endif
#if PL_CONFIG_NOF_KEYS >= 6
  if (KEY6_Get()) {
    keys |= (1<<5);
  }
#endif
#if PL_CONFIG_NOF_KEYS >= 7
  if (KEY7_Get()) {
    keys |= (1<<6);
  }
#endif
  return keys;
}
コード例 #6
0
ファイル: Events.c プロジェクト: chregubr85/42
void SW1_OnInterrupt(void)
{
	if(KEY1_Get()){
		KEY_OnInterrupt(KEY_BTN1);
	}
}