Example #1
0
void KEYDBNC_Process(void) {
  /** \todo call DBNC_Process(&KEYDBNC_FSMdata);
   * But be careful: only if we are not debouncing, and if we have a key press if we are polling
   */
  if (KEYDBNC_FSMdata.state==DBNC_KEY_IDLE && KEYDBNC_GetKeys()!=0) { /* a key is pressed and we are not debouncing */
  #if PL_HAS_KBI
    KEY_DisableInterrupts(); /* disable interrupts for all keys */
  #endif
    DBNC_Process(&KEYDBNC_FSMdata); /* starts the state machine */
  }
}
void KEYDBNC_Scan(void) {

	if (KEYDBNC_FSMdata.state == DBNC_KEY_IDLE && KEYDBNC_GetKeys() != 0) {
#if PL_HAS_KBI
		KEY_DisableInterrupts();
#endif
		DBNC_Process(&KEYDBNC_FSMdata);
	}

	/** \todo call DBNC_Scan(&KEYDBNC_FSMdata);
	 * But be careful: only if we are not debouncing, and if we have a key press if we are polling.
	 * And you will need to disable the keyboard interrupts too!
	 */
}