Example #1
0
void KBD_Task(event_t events)
{
  
  mKeyState = mStateKeyIdle;
  /*Start the timer;*/
  TMR_StartIntervalTimer(mKeyScanTimerID, gKeyScanInterval_c, KeyScan);  
}
Example #2
0
/******************************************************************************
* LED_StartFlash
*
* Start one or more LEDs flashing
*******************************************************************************/
void LED_StartFlash
 (
    LED_t LEDNr /* IN: LED Number (may be an OR of the list) */
 )
{
  /* indicate which leds are flashing */
  mLedFlashingLEDs |= LEDNr;

  /* start the timer */
  TMR_StartIntervalTimer(mLEDTimerID, mLEDInterval_c, LED_FlashTimeout);
}
Example #3
0
/******************************************************************************
* Initialize the keyboard handling. Works on on Freescale demo boards.
*******************************************************************************/
void KBD_Init
(
KBDFunction_t pfCallBackAdr /* IN: Pointer to callback function */
)
{
  /* timer is used to determine short or long key press */
  mKeyScanTimerID = TMR_AllocateTimer();
  
  /* where to send the data */
  mpfKeyFunction = pfCallBackAdr;
  /* Init all the Gpio pins for keyboard*/
  KbGpioInit();
  /*Init the CRM module for external interrupt capability*/
  KbCrmInit();
  /* Create a task for switches */
  mSwTaskID = TS_CreateTask(gTsSwitchTaskPriority_c, KBD_Task);
  
  /*Start the timer to detect the center key for joystick*/
#if gJoystickSupported_d
  TMR_StartIntervalTimer(mKeyScanTimerID, gKeyScanInterval_c, KeyScan);  
#endif /* gJoystickSupported_d */
  
}