summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-12-05 13:32:55 +0700
committerhathach <[email protected]>2018-12-05 13:32:55 +0700
commit734b3ada8a57ca4c8c90a7502c5547a891886481 (patch)
tree50411de91abbd898b9f191932dc256dd30637bd6 /examples
parenta73017fdc23f7bedf38e754cba3a4ffbcf8d4c27 (diff)
fix travis build error
Diffstat (limited to 'examples')
-rw-r--r--examples/device/cdc_msc_hid/Makefile3
-rw-r--r--examples/device/cdc_msc_hid/src/msc_disk_ram.c6
-rw-r--r--examples/device/cdc_msc_hid_freertos/src/msc_disk_ram.c6
3 files changed, 7 insertions, 8 deletions
diff --git a/examples/device/cdc_msc_hid/Makefile b/examples/device/cdc_msc_hid/Makefile
index 4fddc1a14..11c05ad26 100644
--- a/examples/device/cdc_msc_hid/Makefile
+++ b/examples/device/cdc_msc_hid/Makefile
@@ -80,8 +80,7 @@ LIB_SOURCE += \
src/class/cdc/cdc_device.c \
src/class/hid/hid_device.c \
src/tusb.c \
- src/portable/$(VENDOR)/$(CHIP_FAMILY)/dcd_$(CHIP_FAMILY).c \
- src/portable/$(VENDOR)/$(CHIP_FAMILY)/hal_$(CHIP_FAMILY).c
+ src/portable/$(VENDOR)/$(CHIP_FAMILY)/dcd_$(CHIP_FAMILY).c
SRC_C += $(LIB_SOURCE)
diff --git a/examples/device/cdc_msc_hid/src/msc_disk_ram.c b/examples/device/cdc_msc_hid/src/msc_disk_ram.c
index 477f8ed17..93a863c12 100644
--- a/examples/device/cdc_msc_hid/src/msc_disk_ram.c
+++ b/examples/device/cdc_msc_hid/src/msc_disk_ram.c
@@ -44,7 +44,7 @@
// Some MCU doesn't have enough 8KB SRAM to store the whole disk
// We will use Flash as read-only disk
#if CFG_TUSB_MCU == OPT_MCU_LPC13XX
-#define DISK_READONLY 1
+#define DISK_READONLY
#endif
#define README_CONTENTS \
@@ -58,7 +58,7 @@ enum
DISK_BLOCK_SIZE = 512
};
-#if DISK_READONLY
+#ifdef DISK_READONLY
const
#endif
static uint8_t msc_disk[DISK_BLOCK_NUM][DISK_BLOCK_SIZE] =
@@ -120,7 +120,7 @@ int32_t tud_msc_write10_cb(uint8_t lun, uint32_t lba, uint32_t offset, uint8_t*
{
(void) lun;
-#if !DISK_READONLY
+#ifndef DISK_READONLY
uint8_t* addr = msc_disk[lba] + offset;
memcpy(addr, buffer, bufsize);
#endif
diff --git a/examples/device/cdc_msc_hid_freertos/src/msc_disk_ram.c b/examples/device/cdc_msc_hid_freertos/src/msc_disk_ram.c
index 645cbc873..03a87043c 100644
--- a/examples/device/cdc_msc_hid_freertos/src/msc_disk_ram.c
+++ b/examples/device/cdc_msc_hid_freertos/src/msc_disk_ram.c
@@ -44,7 +44,7 @@
// Some MCU doesn't have enough 8KB SRAM to store the whole disk
// We will use Flash as read-only disk
#if CFG_TUSB_MCU == OPT_MCU_LPC13XX
-#define DISK_READONLY 1
+#define DISK_READONLY
#endif
#define README_CONTENTS \
@@ -58,7 +58,7 @@ enum
DISK_BLOCK_SIZE = 512
};
-#if DISK_READONLY
+#ifdef DISK_READONLY
const
#endif
static uint8_t msc_disk[DISK_BLOCK_NUM][DISK_BLOCK_SIZE] =
@@ -120,7 +120,7 @@ int32_t tud_msc_write10_cb(uint8_t lun, uint32_t lba, uint32_t offset, uint8_t*
{
(void) lun;
-#if !DISK_READONLY
+#ifndef DISK_READONLY
uint8_t* addr = msc_disk[lba] + offset;
memcpy(addr, buffer, bufsize);
#endif