From c5478437ae3b87dd00978e2644d635559e0a1f92 Mon Sep 17 00:00:00 2001 From: batt Date: Fri, 5 Sep 2008 16:21:53 +0000 Subject: [PATCH] Add config option for calling schedule() from kbd_peek(). git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1793 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cfg/cfg_kbd.h | 3 +++ bertos/drv/kbd.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bertos/cfg/cfg_kbd.h b/bertos/cfg/cfg_kbd.h index 2913b235..f02ac36a 100644 --- a/bertos/cfg/cfg_kbd.h +++ b/bertos/cfg/cfg_kbd.h @@ -52,5 +52,8 @@ /// Enable long pression handler for keys #define CONFIG_KBD_LONGPRESS 0 +/// Enable calling poor man's scheduler to be called inside kbd_peek +#define CONFIG_KBD_SCHED 0 + #endif /* CFG_KBD_H */ diff --git a/bertos/drv/kbd.c b/bertos/drv/kbd.c index 5028d316..3d1eca45 100644 --- a/bertos/drv/kbd.c +++ b/bertos/drv/kbd.c @@ -177,10 +177,11 @@ keymask_t kbd_peek(void) { keymask_t key = 0; -// FIXME: make it optional +#if CONFIG_KBD_SCHED /* Let other tasks run for a while */ extern void schedule(void); schedule(); +#endif /* Extract an event from the keyboard buffer */ IRQ_DISABLE; -- 2.25.1