summaryrefslogtreecommitdiff
path: root/board/discovery-stm32f072
diff options
context:
space:
mode:
authorAnton Staaf <robotboy@chromium.org>2014-11-03 15:31:24 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-11-04 21:34:39 +0000
commit8513e23df17be689c42b6d904d57694fbe2ffd88 (patch)
tree2ca7b8c54d8a4ec0c809eaacfae93dec26d6104d /board/discovery-stm32f072
parentbde06f7697fcbe09d061e1c77515f962ef09452b (diff)
downloadchrome-ec-8513e23df17be689c42b6d904d57694fbe2ffd88.tar.gz
USB: Remove special case for iVersion string descriptor
Previously the version string was special cased in the USB stack because the build system prevented the inclusion of ec_version.h in any file other than common/version.c. This lead to common/version.c being the only place that the USB version string could be computed and thus the special case of filling in the version string descriptor at run time. This made the USB stack more complex, and lead to the common/version.c file including usb.h, which is actually STM32 specific. Now, the portion of ec_version.h that is deterministic is only updated when something in the tree actually changes (by way of a conditional in the makefile), and ec_version.h no longer has to depend on all object files (other than the special version.o). This allows anyone to include ec_version.h as needed. In particular, each board that wants to define a USB version string can directly include ec_version.h and do so. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=make buildall -j touch files and verify rebuilds happen correctly Change-Id: Ic84d0b9da90f82ebb4630fb550ec841071e25a49 Reviewed-on: https://chromium-review.googlesource.com/227211 Tested-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org>
Diffstat (limited to 'board/discovery-stm32f072')
-rw-r--r--board/discovery-stm32f072/board.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/board/discovery-stm32f072/board.c b/board/discovery-stm32f072/board.c
index 2d9d15005a..8beae33e74 100644
--- a/board/discovery-stm32f072/board.c
+++ b/board/discovery-stm32f072/board.c
@@ -5,6 +5,7 @@
/* STM32F072-discovery board configuration */
#include "common.h"
+#include "ec_version.h"
#include "gpio.h"
#include "hooks.h"
#include "registers.h"
@@ -45,7 +46,7 @@ const void *const usb_strings[] = {
[USB_STR_DESC] = usb_string_desc,
[USB_STR_VENDOR] = USB_STRING_DESC("Google Inc."),
[USB_STR_PRODUCT] = USB_STRING_DESC("discovery-stm32f072"),
- [USB_STR_VERSION] = NULL /* filled at runtime */,
+ [USB_STR_VERSION] = USB_STRING_DESC(CROS_EC_VERSION32),
[USB_STR_STREAM_NAME] = USB_STRING_DESC("Echo"),
[USB_STR_CONSOLE_NAME] = USB_STRING_DESC("Shell"),
};