From fdc5aa1653976ab015f72373711d3364d8de4d74 Mon Sep 17 00:00:00 2001 From: lottaviano Date: Wed, 8 Jul 2009 07:38:46 +0000 Subject: [PATCH] Fix keyboard input in desktop demo. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2750 38d2e660-2303-0410-9eaa-f027e97ec537 --- examples/demo/hw/hw_kbd.h | 68 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 examples/demo/hw/hw_kbd.h diff --git a/examples/demo/hw/hw_kbd.h b/examples/demo/hw/hw_kbd.h new file mode 100644 index 00000000..12f7ddd1 --- /dev/null +++ b/examples/demo/hw/hw_kbd.h @@ -0,0 +1,68 @@ +/** + * \file + * + * + * \brief Keyboard hardware-specific definitions + * + * \version $Id$ + * + * \author Francesco Sacchi + * \author Stefano Fedrigo + */ + +#ifndef HW_KBD_H +#define HW_KBD_H + +#include "hw/kbd_map.h" + +#include + +#define K_RPT_MASK (K_UP | K_DOWN | K_OK | K_CANCEL) + +#define KBD_HW_INIT \ + do { \ + /* Put here code to init hw */ \ + } while (0) + +EXTERN_C int emul_kbdReadCols(void); + +/** + * Read the keyboard ports and return the mask of + * depressed keys. + */ +INLINE keymask_t kbd_readkeys(void) +{ + // This is specific for the demo + return (keymask_t)emul_kbdReadCols(); +} + +#endif /* HW_KBD_H */ -- 2.25.1