summaryrefslogtreecommitdiff
path: root/demos/device/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2014-03-07 15:31:41 +0700
committerhathach <[email protected]>2014-03-07 15:31:41 +0700
commite506f4cae2f3d06b463c28f725692165fec60727 (patch)
tree3850cd0959d3c359c14e84d9b808189523673388 /demos/device/src
parent01760794fe7f90e27fa5d3bfca4f089904f459eb (diff)
ported board_buttons API to EA4357 but device is not mounted yet
Diffstat (limited to 'demos/device/src')
-rw-r--r--demos/device/src/main.c6
-rw-r--r--demos/device/src/tusb_config.h4
2 files changed, 8 insertions, 2 deletions
diff --git a/demos/device/src/main.c b/demos/device/src/main.c
index c4e1d785e..a69a710f1 100644
--- a/demos/device/src/main.c
+++ b/demos/device/src/main.c
@@ -133,6 +133,12 @@ OSAL_TASK_FUNCTION( led_blinking_task ) (void* p_task_para)
board_leds(led_on_mask, 1 - led_on_mask);
led_on_mask = 1 - led_on_mask; // toggle
+ uint32_t btn_mask = board_buttons();
+ for(uint8_t i=0; i<32; i++)
+ {
+ if ( BIT_TEST_(btn_mask, i) ) printf("button %d is pressed\n", i);
+ }
+
OSAL_TASK_LOOP_END
}
diff --git a/demos/device/src/tusb_config.h b/demos/device/src/tusb_config.h
index e4224aa39..bfc225351 100644
--- a/demos/device/src/tusb_config.h
+++ b/demos/device/src/tusb_config.h
@@ -82,11 +82,11 @@
#define TUSB_CFG_DEVICE_FULLSPEED 1 // TODO refractor, remove
//------------- CLASS -------------//
-#define TUSB_CFG_DEVICE_HID_KEYBOARD 0
+#define TUSB_CFG_DEVICE_HID_KEYBOARD 1
#define TUSB_CFG_DEVICE_HID_MOUSE 0
#define TUSB_CFG_DEVICE_HID_GENERIC 0
#define TUSB_CFG_DEVICE_MSC 0
-#define TUSB_CFG_DEVICE_CDC 1
+#define TUSB_CFG_DEVICE_CDC 0
//--------------------------------------------------------------------+
// COMMON CONFIGURATION