/**
* \file
* <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction. Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License. This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
* Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
* Copyright 1999, 2003 Bernardo Innocenti
- * This file is part of DevLib - See README.devlib for information.
+ *
* -->
*
* \version $Id$
/*#*
*#* $Log$
+ *#* Revision 1.9 2006/09/13 18:25:45 bernie
+ *#* Merge CONFIG_KBD_LONGPRESS.
+ *#*
*#* Revision 1.8 2006/07/19 12:56:25 bernie
*#* Convert to new Doxygen style.
*#*
#if !defined(CONFIG_KBD_OBSERVER) || (CONFIG_KBD_OBSERVER != 0 && CONFIG_KBD_OBSERVER != 1)
#error CONFIG_KBD_OBSERVER must be defined to either 0 or 1
#endif
+#if !defined(CONFIG_KBD_LONGPRESS) || (CONFIG_KBD_LONGPRESS != 0 && CONFIG_KBD_LONGPRESS != 1)
+ #error CONFIG_KBD_LONGPRESS must be defined to either 0 or 1
+#endif
#if CONFIG_KBD_BEEP
#include <drv/buzzer.h>
static KbdHandler kbd_defHandler; /**< The default keyboard handler */
static KbdHandler kbd_debHandler; /**< The debounce keyboard handler */
static KbdHandler kbd_rptHandler; /**< Auto-repeat keyboard handler */
-#ifdef K_LNG_MASK
+
+#if CONFIG_KBD_LONGPRESS
static KbdHandler kbd_lngHandler; /**< Long pression keys handler */
#endif
* is returned only after the time specified with KBD_REPAT_DELAY to
* avoid too fast keyboard repeat.
*
+ * \note Calls \c schedule() internally.
+ *
* \note This function is \b not interrupt safe!
*
* \return The mask of depressed keys or 0 if no keys are depressed.
{
keymask_t key = 0;
-// FIXME
+// FIXME: make it optional
/* Let other tasks run for a while */
extern void schedule(void);
schedule();
return new_key;
}
-#ifdef K_LNG_MASK
+#if CONFIG_KBD_LONGPRESS
/**
* Handle long pression keys.
*/
kbd_debHandler.flags = KHF_RAWKEYS;
kbd_addHandler(&kbd_debHandler);
- #ifdef K_LNG_MASK
+ #if CONFIG_KBD_LONGPRESS
/* Add long pression keyboard handler */
kbd_lngHandler.hook = kbd_lngHandlerFunc;
kbd_lngHandler.pri = 90; /* high priority */
MOD_CHECK(timer);
/* Add kbd handler to soft timers list */
- event_initSoftInt(&kbd_timer.expire, kbd_softint, 0);
+ event_initSoftInt(&kbd_timer.expire, kbd_softint, NULL);
timer_setDelay(&kbd_timer, ms_to_ticks(KBD_CHECK_INTERVAL));
timer_add(&kbd_timer);