summaryrefslogtreecommitdiff
path: root/board/discovery-stm32f072
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2015-05-19 00:00:23 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-06-18 05:07:55 +0000
commitb72a5f5e8e97ba86736c1e26b4204fc6d0c215da (patch)
tree155559713f9432bbc849bbe18a12983a672db5c6 /board/discovery-stm32f072
parentdd1987051b473e74dab3490921d0cc77c76fcac3 (diff)
downloadchrome-ec-b72a5f5e8e97ba86736c1e26b4204fc6d0c215da.tar.gz
discovery-stm32f072: Blink the LEDs
This just makes the LEDs blink continually, because I have a development board sitting on my desk and I like to see it doing something. You can still force the GPIOs on and off using the tool in extra/usb_gpio/. BUG=none BRANCH=none TEST=make buildall Try it: sudo make BOARD=discovery-stm32f072 flash The LEDs blink. Force them on and off with: cd extra/usb_gpio make ./usb_gpio write -1 0 ./usb_gpio write 0 -1 ./usb_gpio write 2 0 ./usb_gpio write 4 2 To resume blinking, use ./usb_gpio write 0 0 Change-Id: Iadbe7436c02de5b6eae81885d95bad154ca3692c Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/274131 Reviewed-by: Anton Staaf <robotboy@chromium.org>
Diffstat (limited to 'board/discovery-stm32f072')
-rw-r--r--board/discovery-stm32f072/board.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/board/discovery-stm32f072/board.c b/board/discovery-stm32f072/board.c
index c6a9b3c8a3..8303aa6a27 100644
--- a/board/discovery-stm32f072/board.c
+++ b/board/discovery-stm32f072/board.c
@@ -39,10 +39,22 @@ static enum gpio_signal const usb_gpio_list[] = {
GPIO_LED_R,
};
+/*
+ * This instantiates struct usb_gpio_config const usb_gpio, plus several other
+ * variables, all named something beginning with usb_gpio_
+ */
USB_GPIO_CONFIG(usb_gpio,
usb_gpio_list,
USB_IFACE_GPIO,
- USB_EP_GPIO)
+ USB_EP_GPIO);
+
+void usb_gpio_tick(void)
+{
+ if (usb_gpio.state->set_mask || usb_gpio.state->clear_mask)
+ return;
+ button_event(0);
+}
+DECLARE_HOOK(HOOK_TICK, usb_gpio_tick, HOOK_PRIO_DEFAULT);
const void *const usb_strings[] = {
[USB_STR_DESC] = usb_string_desc,