projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add the getSystemPath function that returns a list of string containig the path
[bertos.git]
/
bertos
/
drv
/
kbd.c
diff --git
a/bertos/drv/kbd.c
b/bertos/drv/kbd.c
index f54ebf91f06ebf9a2b66f334d950fdcaa1961805..3d1eca4537dc2a256301f9178fe2c5aaa47e8e0e 100644
(file)
--- a/
bertos/drv/kbd.c
+++ b/
bertos/drv/kbd.c
@@
-27,31
+27,33
@@
* the GNU General Public License.
*
* Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
* the GNU General Public License.
*
* Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
- * Copyright 1999, 2003 Bern
ardo
Innocenti
+ * Copyright 1999, 2003 Bern
ie
Innocenti
*
* -->
*
*
* -->
*
+ * \brief Keyboard driver (implementation)
+ *
* \version $Id$
*
* \version $Id$
*
- * \author Bern
ardo Innocenti <bernie@develer.com
>
+ * \author Bern
ie Innocenti <bernie@codewiz.org
>
* \author Stefano Fedrigo <aleph@develer.com>
* \author Francesco Sacchi <batt@develer.com>
*
* \author Stefano Fedrigo <aleph@develer.com>
* \author Francesco Sacchi <batt@develer.com>
*
- * \brief Keyboard driver (implementation)
*/
*/
-#include <hw_kbd.h>
+#include "hw/hw_kbd.h"
+
+#include "cfg/cfg_kbd.h"
+#include <cfg/debug.h>
+#include <cfg/module.h>
#include <drv/timer.h>
#include <drv/kbd.h>
#include <drv/timer.h>
#include <drv/kbd.h>
-#include <cfg/debug.h>
-#include <cfg/module.h>
-#include <appconfig.h>
/* Configuration sanity checks */
/* Configuration sanity checks */
-#if !defined(CONFIG_KBD_POLL) || (CONFIG_KBD_POLL != KBD_POLL_SOFTINT
&& CONFIG_KBD_POLL != CONFIG_POLL_FREERTOS
)
- #error CONFIG_KBD_POLL must be defined to either KBD_POLL_SOFTINT
or CONFIG_POLL_FREERTOS
+#if !defined(CONFIG_KBD_POLL) || (CONFIG_KBD_POLL != KBD_POLL_SOFTINT)
+ #error CONFIG_KBD_POLL must be defined to either KBD_POLL_SOFTINT
#endif
#if !defined(CONFIG_KBD_BEEP) || (CONFIG_KBD_BEEP != 0 && CONFIG_KBD_BEEP != 1)
#error CONFIG_KBD_BEEP must be defined to either 0 or 1
#endif
#if !defined(CONFIG_KBD_BEEP) || (CONFIG_KBD_BEEP != 0 && CONFIG_KBD_BEEP != 1)
#error CONFIG_KBD_BEEP must be defined to either 0 or 1
@@
-152,19
+154,8
@@
static void kbd_softint(UNUSED_ARG(iptr_t, arg))
timer_add(&kbd_timer);
}
timer_add(&kbd_timer);
}
-#elif CONFIG_KBD_POLL == CONFIG_POLL_FREERTOS
-
-#include "FreeRTOS.h"
-#include "task.h"
-
-static portTASK_FUNCTION(kbd_task, arg)
-{
- for (;;)
- {
- kbd_poll();
- timer_delay(KBD_CHECK_INTERVAL);
- }
-}
+#else
+ #error "Define keyboard poll method"
#endif /* CONFIG_KBD_POLL */
#endif /* CONFIG_KBD_POLL */
@@
-186,10
+177,11
@@
keymask_t kbd_peek(void)
{
keymask_t key = 0;
{
keymask_t key = 0;
-// FIXME: make it optional
+#if CONFIG_KBD_SCHED
/* Let other tasks run for a while */
extern void schedule(void);
schedule();
/* Let other tasks run for a while */
extern void schedule(void);
schedule();
+#endif
/* Extract an event from the keyboard buffer */
IRQ_DISABLE;
/* Extract an event from the keyboard buffer */
IRQ_DISABLE;
@@
-245,7
+237,7
@@
void kbd_addHandler(struct KbdHandler *handler)
KbdHandler *node;
List *list;
KbdHandler *node;
List *list;
- cpuflags_t flags;
+ cpu
_
flags_t flags;
IRQ_SAVE_DISABLE(flags);
/* Choose between raw and coocked handlers list */
IRQ_SAVE_DISABLE(flags);
/* Choose between raw and coocked handlers list */
@@
-482,18
+474,13
@@
void kbd_init(void)
MOD_CHECK(timer);
/* Add kbd handler to soft timers list */
MOD_CHECK(timer);
/* Add kbd handler to soft timers list */
- event_initSoft
I
nt(&kbd_timer.expire, kbd_softint, NULL);
+ event_initSoft
i
nt(&kbd_timer.expire, kbd_softint, NULL);
timer_setDelay(&kbd_timer, ms_to_ticks(KBD_CHECK_INTERVAL));
timer_add(&kbd_timer);
timer_setDelay(&kbd_timer, ms_to_ticks(KBD_CHECK_INTERVAL));
timer_add(&kbd_timer);
-#elif CONFIG_KBD_POLL == CONFIG_POLL_FREERTOS
-
- /* Create a timer specific thread */
- xTaskCreate(kbd_task, "kbd", CONFIG_STACK_KBD,
- NULL, CONFIG_PRI_KBD, NULL);
-
#else
#error "Define keyboard poll method"
#else
#error "Define keyboard poll method"
+
#endif
MOD_INIT(kbd);
#endif
MOD_INIT(kbd);