summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2015-06-03 11:31:49 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-06-04 02:40:38 +0000
commit09f8a93bb854fc9e2cbb2b2ccf7eea09cb2e6036 (patch)
tree374fb591c5363d1cc78ae8dce05bea9460e40132
parent1de5ac02ec5558f118e64a354967a83d6994d9c4 (diff)
downloadchrome-ec-09f8a93bb854fc9e2cbb2b2ccf7eea09cb2e6036.tar.gz
Cr50: Fix compilation without CONFIG_USB_HID defined.
Just a minor tweak to #ifdef a bit of code that is only meaningful if CONFIG_USB_HID is defined. BUG=none BRANCH=none TEST=make buildall -j Change-Id: I3491f67d7145d7c4a7e4f6ad3944172f0f49327c Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/275130 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--board/cr50/board.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/board/cr50/board.c b/board/cr50/board.c
index a811ad345f..4e122b56aa 100644
--- a/board/cr50/board.c
+++ b/board/cr50/board.c
@@ -24,6 +24,7 @@
#include "gpio_list.h"
+#ifdef CONFIG_USB_HID
static void send_hid_event(void)
{
#if !defined(CHIP_VARIANT_CR50_A1)
@@ -45,6 +46,7 @@ static void send_hid_event(void)
#endif
}
DECLARE_DEFERRED(send_hid_event);
+#endif
/* Interrupt handler for button pushes */
void button_event(enum gpio_signal signal)
@@ -57,7 +59,9 @@ void button_event(enum gpio_signal signal)
signal -= (GPIO_SW_N_ - GPIO_SW_N);
v = gpio_get_level(signal);
+#ifdef CONFIG_USB_HID
send_hid_event();
+#endif
ccprintf("Button %d = %d\n", signal, v);
gpio_set_level(signal - GPIO_SW_N + GPIO_LED_4, v);
}