From: lottaviano Date: Wed, 8 Jul 2009 07:38:46 +0000 (+0000) Subject: Fix keyboard input in desktop demo. X-Git-Tag: 2.2.0~218 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=fdc5aa1653976ab015f72373711d3364d8de4d74;p=bertos.git Fix keyboard input in desktop demo. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2750 38d2e660-2303-0410-9eaa-f027e97ec537 --- 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 */