From ab2c18b0ad84aef36d6c3a5f99cf7344939b65e8 Mon Sep 17 00:00:00 2001 From: Adrian Bradianu Date: Tue, 14 Jun 2016 19:29:07 +0300 Subject: [PATCH] usb: Move LOW_BYTE and HIGH_BYTE to samples code Move LOW_BYTE and HIGH_BYTE macros from usb_common.h to samples code. Change-Id: I26296bde8c5b3991b3bfab71272c861b5360ce97 Signed-off-by: Adrian Bradianu Signed-off-by: Jesus Sanchez-Palencia --- include/usb/usb_common.h | 4 ---- samples/usb/dfu/src/usb_dfu.c | 4 ++++ usb/class/cdc_acm.c | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/usb/usb_common.h b/include/usb/usb_common.h index 8b26c1e9b48..c2918c8d884 100644 --- a/include/usb/usb_common.h +++ b/include/usb/usb_common.h @@ -78,10 +78,6 @@ */ #define USB_CONFIGURATION_ATTRIBUTES 0xC0 -/* Misc. macros */ -#define LOW_BYTE(x) ((x)&0xFF) -#define HIGH_BYTE(x) ((x)>>8) - /* Classes */ #define COMMUNICATION_DEVICE_CLASS 0x02 #define COMMUNICATION_DEVICE_CLASS_DATA 0x0A diff --git a/samples/usb/dfu/src/usb_dfu.c b/samples/usb/dfu/src/usb_dfu.c index 2fc7ffc782e..2aaad69a14e 100644 --- a/samples/usb/dfu/src/usb_dfu.c +++ b/samples/usb/dfu/src/usb_dfu.c @@ -62,6 +62,10 @@ #define DFU_FLASH_ADDR (dfu_data.flash_base_addr + \ dfu_data.alt_setting * DFU_ALT_SETTING_OFFSET) +/* Misc. macros */ +#define LOW_BYTE(x) ((x) & 0xFF) +#define HIGH_BYTE(x) ((x) >> 8) + static struct usb_cfg_data dfu_config; /* Device data structure */ diff --git a/usb/class/cdc_acm.c b/usb/class/cdc_acm.c index bf6526d2479..859ae1f4614 100644 --- a/usb/class/cdc_acm.c +++ b/usb/class/cdc_acm.c @@ -74,6 +74,10 @@ static struct uart_driver_api cdc_acm_driver_api; /* Size of the internal buffer used for storing received data */ #define CDC_ACM_BUFFER_SIZE (2 * CDC_BULK_EP_MPS) +/* Misc. macros */ +#define LOW_BYTE(x) ((x) & 0xFF) +#define HIGH_BYTE(x) ((x) >> 8) + struct device *cdc_acm_dev; /* Device data structure */