X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fdrv%2Fkbd.c;h=b36a5a4801c0806103cc2895eec84424e8e4c9cc;hb=4cc44c9888a0336b9d01121ec0b7ad95f4a76195;hp=f54ebf91f06ebf9a2b66f334d950fdcaa1961805;hpb=791e167e053bdd9250d34a9a5ccae6ccde4d6679;p=bertos.git diff --git a/bertos/drv/kbd.c b/bertos/drv/kbd.c index f54ebf91..b36a5a48 100644 --- 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/) - * Copyright 1999, 2003 Bernardo Innocenti + * Copyright 1999, 2003 Bernie Innocenti * * --> * + * \brief Keyboard driver (implementation) + * * \version $Id$ * - * \author Bernardo Innocenti + * \author Bernie Innocenti * \author Stefano Fedrigo * \author Francesco Sacchi * - * \brief Keyboard driver (implementation) */ -#include +#include "hw/hw_kbd.h" + +#include "cfg/cfg_kbd.h" +#include +#include #include #include -#include -#include -#include /* 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 @@ -152,19 +154,8 @@ static void kbd_softint(UNUSED_ARG(iptr_t, arg)) 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 */ @@ -486,14 +477,9 @@ void kbd_init(void) 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" + #endif MOD_INIT(kbd);