summaryrefslogtreecommitdiff
path: root/chip/stm32/usb_hw.h
diff options
context:
space:
mode:
authorBrian J. Nemec <bnemec@chromium.org>2020-05-23 23:04:31 -0700
committerCommit Bot <commit-bot@chromium.org>2020-06-04 14:49:43 +0000
commit11b912091e133568483e92b5aa7fadbf882e5e92 (patch)
tree92d5786eb1fd01fbb66a131ef5b9a6855968c09f /chip/stm32/usb_hw.h
parentf5e6ae210518bae0dc9a577d98c80a805b764fce (diff)
downloadchrome-ec-11b912091e133568483e92b5aa7fadbf882e5e92.tar.gz
ec: Minor cleanup of magic number commonly used in STM32 USB
Minor cleanup of a commonly used magic number in the STM32 USB interface. BUG=none BRANCH=none TEST=Builds Signed-off-by: Brian Nemec <bnemec@chromium.org> Change-Id: I2c0b7947810aae651e452db42ac27221ab19b99b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2224763 Tested-by: Brian Nemec <bnemec@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Brian Nemec <bnemec@chromium.org>
Diffstat (limited to 'chip/stm32/usb_hw.h')
-rw-r--r--chip/stm32/usb_hw.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/chip/stm32/usb_hw.h b/chip/stm32/usb_hw.h
index be2a88661e..0c75322a7d 100644
--- a/chip/stm32/usb_hw.h
+++ b/chip/stm32/usb_hw.h
@@ -34,6 +34,9 @@ extern usb_uint __usb_ram_start[];
/* Attribute to define a buffer variable in USB RAM */
#define __usb_ram __attribute__((section(".usb_ram.99_data")))
+/* Mask for the rx_count to identify the number of bytes in the buffer. */
+#define RX_COUNT_MASK (0x3ff)
+
struct stm32_endpoint {
volatile usb_uint tx_addr;
volatile usb_uint tx_count;