From: bernie Date: Fri, 17 Feb 2006 21:15:42 +0000 (+0000) Subject: Add MOD_CHECK() checks. X-Git-Tag: 1.0.0~722 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=8e431405692569d59b74509919eaec2f23df407f;p=bertos.git Add MOD_CHECK() checks. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@519 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/drv/buzzer.c b/drv/buzzer.c index 4383ed79..f5d047b6 100755 --- a/drv/buzzer.c +++ b/drv/buzzer.c @@ -17,6 +17,9 @@ /*#* *#* $Log$ + *#* Revision 1.18 2006/02/17 21:15:25 bernie + *#* Add MOD_CHECK() checks. + *#* *#* Revision 1.17 2006/02/10 12:30:18 bernie *#* Push interrupt protection inside hw module. *#* @@ -53,6 +56,7 @@ #include #include +#include /* Local vars */ @@ -147,14 +151,19 @@ void buz_repeat_stop(void) IRQ_RESTORE(flags); } +MOD_DEFINE(buzzer) /*! * Initialize buzzer. */ void buz_init(void) { + MOD_CHECK(timer); + BUZZER_HW_INIT; /* Init software interrupt. */ timer_set_event_softint(&buz_timer, (Hook)buz_softint, 0); + + MOD_INIT(buzzer); } diff --git a/drv/kbd.c b/drv/kbd.c index e70114b1..e2315365 100755 --- a/drv/kbd.c +++ b/drv/kbd.c @@ -17,6 +17,9 @@ /*#* *#* $Log$ + *#* Revision 1.3 2006/02/17 21:15:42 bernie + *#* Add MOD_CHECK() checks. + *#* *#* Revision 1.2 2006/02/10 12:36:20 bernie *#* Add preliminary FreeRTOS support; Enforce CONFIG_* definitions. *#* @@ -32,6 +35,7 @@ #include #include +#include /* Configuration sanity checks */ #if !defined(CONFIG_KBD_POLL) || (CONFIG_KBD_POLL != KBD_POLL_SOFTINT && CONFIG_KBD_POLL != CONFIG_POLL_FREERTOS) @@ -379,12 +383,15 @@ static keymask_t kbd_rptHandlerFunc(keymask_t key) } +MOD_DEFINE(kbd) /*! * Initialize keyboard ports and softtimer */ void kbd_init(void) { + MOD_CHECK(buzzer); + KBD_HW_INIT; /* Init handlers lists */ @@ -405,29 +412,35 @@ void kbd_init(void) kbd_addHandler(&kbd_lngHandler); #endif - /* Add repeat keyboard handler */ kbd_rptHandler.hook = kbd_rptHandlerFunc; kbd_rptHandler.pri = 80; /* high priority */ kbd_rptHandler.flags = KHF_RAWKEYS; kbd_addHandler(&kbd_rptHandler); - /* Add default keyboard handler */ kbd_defHandler.hook = kbd_defHandlerFunc; kbd_defHandler.pri = -128; /* lowest priority */ kbd_addHandler(&kbd_defHandler); #if CONFIG_KBD_POLL == KBD_POLL_SOFTINT + + MOD_CHECK(timer); + /* Add kbd handler to soft timers list */ event_initSoftInt(&kbd_timer.expire, kbd_softint, 0); 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_poll, "kbd_poll", CONFIG_STACK_KBD, NULL, CONFIG_PRI_KBD, NULL); + #else #error "Define keyboard poll method" #endif + + MOD_INIT(kbd); }