summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-05-15 18:21:41 +0700
committerGitHub <[email protected]>2019-05-15 18:21:41 +0700
commitc4b153925012e7c4fe28c745e5022820798a160d (patch)
tree01c7d3ee839746922ddade2a372310c6fa055999 /examples
parent449a631a4a888146e8f68b6960f7fdb579fc5edf (diff)
parent6e9324e29c3c2cc7ae36c0d7cbdb037e92ec9614 (diff)
Merge pull request #66 from hathach/develop
support makefile device example for all boards
Diffstat (limited to 'examples')
-rw-r--r--examples/device/cdc_msc_hid/Makefile3
-rw-r--r--examples/device/cdc_msc_hid/ses/lpc11u6x/lpc11u6x.emProject1
-rw-r--r--examples/device/cdc_msc_hid/ses/lpc13xx/lpc13xx.emProject1
-rw-r--r--examples/device/cdc_msc_hid/src/main.c2
-rw-r--r--examples/device/cdc_msc_hid/src/msc_disk.c2
-rw-r--r--examples/device/cdc_msc_hid/src/tusb_config.h6
-rw-r--r--examples/device/cdc_msc_hid/src/usb_descriptors.c4
-rw-r--r--examples/device/cdc_msc_hid_freertos/Makefile3
-rw-r--r--examples/device/cdc_msc_hid_freertos/src/freertos_hook.c2
-rw-r--r--examples/device/cdc_msc_hid_freertos/src/main.c2
-rw-r--r--examples/device/cdc_msc_hid_freertos/src/msc_disk.c2
-rw-r--r--examples/device/cdc_msc_hid_freertos/src/tusb_config.h6
-rw-r--r--examples/device/cdc_msc_hid_freertos/src/usb_descriptors.c2
-rw-r--r--examples/device/hid_generic_inout/Makefile3
-rw-r--r--examples/device/hid_generic_inout/src/main.c2
-rw-r--r--examples/device/hid_generic_inout/src/tusb_config.h6
-rw-r--r--examples/device/hid_generic_inout/src/usb_descriptors.c2
-rw-r--r--examples/device/msc_dual_lun/Makefile3
-rw-r--r--examples/device/msc_dual_lun/src/main.c2
-rw-r--r--examples/device/msc_dual_lun/src/msc_disk_dual.c2
-rw-r--r--examples/device/msc_dual_lun/src/tusb_config.h6
-rw-r--r--examples/device/msc_dual_lun/src/usb_descriptors.c4
-rw-r--r--examples/host/cdc_msc_hid/src/main.c2
-rw-r--r--examples/host/cdc_msc_hid/src/msc_app.c2
-rw-r--r--examples/host/cdc_msc_hid/src/tusb_config.h6
-rw-r--r--examples/make.mk5
-rw-r--r--examples/obsolete/host/src/app_os_prio.h2
-rw-r--r--examples/obsolete/host/src/cdc_serial_host_app.c2
-rw-r--r--examples/obsolete/host/src/cdc_serial_host_app.h2
-rw-r--r--examples/obsolete/host/src/keyboard_host_app.c2
-rw-r--r--examples/obsolete/host/src/keyboard_host_app.h2
-rw-r--r--examples/obsolete/host/src/main.c2
-rw-r--r--examples/obsolete/host/src/mouse_host_app.c2
-rw-r--r--examples/obsolete/host/src/mouse_host_app.h2
-rw-r--r--examples/obsolete/host/src/msc_cli.c2
-rw-r--r--examples/obsolete/host/src/msc_cli.h2
-rw-r--r--examples/obsolete/host/src/msc_host_app.c2
-rw-r--r--examples/obsolete/host/src/msc_host_app.h2
-rw-r--r--examples/obsolete/host/src/rndis_host_app.c2
-rw-r--r--examples/obsolete/host/src/rndis_host_app.h2
-rw-r--r--examples/obsolete/host/src/tusb_config.h4
-rw-r--r--examples/rules.mk3
42 files changed, 58 insertions, 58 deletions
diff --git a/examples/device/cdc_msc_hid/Makefile b/examples/device/cdc_msc_hid/Makefile
index 4ff3371dc..69b633fea 100644
--- a/examples/device/cdc_msc_hid/Makefile
+++ b/examples/device/cdc_msc_hid/Makefile
@@ -9,7 +9,4 @@ INC += \
EXAMPLE_SOURCE += $(wildcard src/*.c)
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-# Board source
-SRC_C += hw/bsp/$(BOARD)/board_$(BOARD).c
-
include ../../rules.mk
diff --git a/examples/device/cdc_msc_hid/ses/lpc11u6x/lpc11u6x.emProject b/examples/device/cdc_msc_hid/ses/lpc11u6x/lpc11u6x.emProject
index 3904cda3b..fce8041e7 100644
--- a/examples/device/cdc_msc_hid/ses/lpc11u6x/lpc11u6x.emProject
+++ b/examples/device/cdc_msc_hid/ses/lpc11u6x/lpc11u6x.emProject
@@ -91,7 +91,6 @@
<file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_11u6x/src/gpio_11u6x.c" />
<file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_11u6x/src/syscon_11u6x.c" />
<file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_11u6x/src/sysinit_11u6x.c" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_11u6x/src/uart_0_11u6x.c" />
<file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_11u6x/src/iocon_11u6x.c" />
</folder>
</folder>
diff --git a/examples/device/cdc_msc_hid/ses/lpc13xx/lpc13xx.emProject b/examples/device/cdc_msc_hid/ses/lpc13xx/lpc13xx.emProject
index a3a59af71..791944a16 100644
--- a/examples/device/cdc_msc_hid/ses/lpc13xx/lpc13xx.emProject
+++ b/examples/device/cdc_msc_hid/ses/lpc13xx/lpc13xx.emProject
@@ -81,7 +81,6 @@
<file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_13xx/src/gpio_13xx_1.c" />
<file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_13xx/src/sysctl_13xx.c" />
<file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_13xx/src/sysinit_13xx.c" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_13xx/src/uart_13xx.c" />
<file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_13xx/src/iocon_13xx.c" />
</folder>
</folder>
diff --git a/examples/device/cdc_msc_hid/src/main.c b/examples/device/cdc_msc_hid/src/main.c
index f743026c2..ce81767cf 100644
--- a/examples/device/cdc_msc_hid/src/main.c
+++ b/examples/device/cdc_msc_hid/src/main.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/device/cdc_msc_hid/src/msc_disk.c b/examples/device/cdc_msc_hid/src/msc_disk.c
index ff7cb8d51..ff74ff463 100644
--- a/examples/device/cdc_msc_hid/src/msc_disk.c
+++ b/examples/device/cdc_msc_hid/src/msc_disk.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/device/cdc_msc_hid/src/tusb_config.h b/examples/device/cdc_msc_hid/src/tusb_config.h
index e909a0d4a..8981077d3 100644
--- a/examples/device/cdc_msc_hid/src/tusb_config.h
+++ b/examples/device/cdc_msc_hid/src/tusb_config.h
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -46,7 +46,9 @@
#endif
#define CFG_TUSB_OS OPT_OS_NONE
-#define CFG_TUSB_DEBUG 2
+
+// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
+// #define CFG_TUSB_DEBUG 0
/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
* Tinyusb use follows macros to declare transferring memory so that they can be put
diff --git a/examples/device/cdc_msc_hid/src/usb_descriptors.c b/examples/device/cdc_msc_hid/src/usb_descriptors.c
index f887571e5..8cd6062be 100644
--- a/examples/device/cdc_msc_hid/src/usb_descriptors.c
+++ b/examples/device/cdc_msc_hid/src/usb_descriptors.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -136,7 +136,7 @@ uint8_t const desc_configuration[] =
#if CFG_TUD_MSC
// Interface number, string index, EP Out & EP In address, EP size
- TUD_MSC_DESCRIPTOR(ITF_NUM_MSC, 5, EPNUM_MSC, 0x80 | EPNUM_MSC, 64), // highspeed 512
+ TUD_MSC_DESCRIPTOR(ITF_NUM_MSC, 5, EPNUM_MSC, 0x80 | EPNUM_MSC, (CFG_TUSB_RHPORT0_MODE & OPT_MODE_HIGH_SPEED) ? 512 : 64),
#endif
#if CFG_TUD_HID
diff --git a/examples/device/cdc_msc_hid_freertos/Makefile b/examples/device/cdc_msc_hid_freertos/Makefile
index 3a39f4601..7401f355a 100644
--- a/examples/device/cdc_msc_hid_freertos/Makefile
+++ b/examples/device/cdc_msc_hid_freertos/Makefile
@@ -11,9 +11,6 @@ INC += \
EXAMPLE_SOURCE += $(wildcard src/*.c)
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-# Board source
-SRC_C += hw/bsp/$(BOARD)/board_$(BOARD).c
-
# FreeRTOS source
SRC_C += \
lib/FreeRTOS/Source/list.c \
diff --git a/examples/device/cdc_msc_hid_freertos/src/freertos_hook.c b/examples/device/cdc_msc_hid_freertos/src/freertos_hook.c
index 71bad3ddf..474e808a9 100644
--- a/examples/device/cdc_msc_hid_freertos/src/freertos_hook.c
+++ b/examples/device/cdc_msc_hid_freertos/src/freertos_hook.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/device/cdc_msc_hid_freertos/src/main.c b/examples/device/cdc_msc_hid_freertos/src/main.c
index b912c23e8..56ea3a7a3 100644
--- a/examples/device/cdc_msc_hid_freertos/src/main.c
+++ b/examples/device/cdc_msc_hid_freertos/src/main.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/device/cdc_msc_hid_freertos/src/msc_disk.c b/examples/device/cdc_msc_hid_freertos/src/msc_disk.c
index c2a62e035..36c997748 100644
--- a/examples/device/cdc_msc_hid_freertos/src/msc_disk.c
+++ b/examples/device/cdc_msc_hid_freertos/src/msc_disk.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/device/cdc_msc_hid_freertos/src/tusb_config.h b/examples/device/cdc_msc_hid_freertos/src/tusb_config.h
index c377798c1..dfa8be629 100644
--- a/examples/device/cdc_msc_hid_freertos/src/tusb_config.h
+++ b/examples/device/cdc_msc_hid_freertos/src/tusb_config.h
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -46,7 +46,9 @@
#endif
#define CFG_TUSB_OS OPT_OS_FREERTOS
-#define CFG_TUSB_DEBUG 2
+
+// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
+// #define CFG_TUSB_DEBUG 0
/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
* Tinyusb use follows macros to declare transferring memory so that they can be put
diff --git a/examples/device/cdc_msc_hid_freertos/src/usb_descriptors.c b/examples/device/cdc_msc_hid_freertos/src/usb_descriptors.c
index 333d07ba4..b60615ca7 100644
--- a/examples/device/cdc_msc_hid_freertos/src/usb_descriptors.c
+++ b/examples/device/cdc_msc_hid_freertos/src/usb_descriptors.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/device/hid_generic_inout/Makefile b/examples/device/hid_generic_inout/Makefile
index 4ff3371dc..69b633fea 100644
--- a/examples/device/hid_generic_inout/Makefile
+++ b/examples/device/hid_generic_inout/Makefile
@@ -9,7 +9,4 @@ INC += \
EXAMPLE_SOURCE += $(wildcard src/*.c)
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-# Board source
-SRC_C += hw/bsp/$(BOARD)/board_$(BOARD).c
-
include ../../rules.mk
diff --git a/examples/device/hid_generic_inout/src/main.c b/examples/device/hid_generic_inout/src/main.c
index 650df1ce2..d64598675 100644
--- a/examples/device/hid_generic_inout/src/main.c
+++ b/examples/device/hid_generic_inout/src/main.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/device/hid_generic_inout/src/tusb_config.h b/examples/device/hid_generic_inout/src/tusb_config.h
index baf418d94..acd23f954 100644
--- a/examples/device/hid_generic_inout/src/tusb_config.h
+++ b/examples/device/hid_generic_inout/src/tusb_config.h
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -46,7 +46,9 @@
#endif
#define CFG_TUSB_OS OPT_OS_NONE
-#define CFG_TUSB_DEBUG 2
+
+// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
+// #define CFG_TUSB_DEBUG 0
/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
* Tinyusb use follows macros to declare transferring memory so that they can be put
diff --git a/examples/device/hid_generic_inout/src/usb_descriptors.c b/examples/device/hid_generic_inout/src/usb_descriptors.c
index a9f84b988..28a487549 100644
--- a/examples/device/hid_generic_inout/src/usb_descriptors.c
+++ b/examples/device/hid_generic_inout/src/usb_descriptors.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/device/msc_dual_lun/Makefile b/examples/device/msc_dual_lun/Makefile
index 59eeacf4d..5a455078e 100644
--- a/examples/device/msc_dual_lun/Makefile
+++ b/examples/device/msc_dual_lun/Makefile
@@ -9,7 +9,4 @@ INC += \
EXAMPLE_SOURCE += $(wildcard src/*.c)
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
-# Board source
-SRC_C += hw/bsp/$(BOARD)/board_$(BOARD).c
-
include ../../rules.mk
diff --git a/examples/device/msc_dual_lun/src/main.c b/examples/device/msc_dual_lun/src/main.c
index 39a8b4725..54cd3d5bf 100644
--- a/examples/device/msc_dual_lun/src/main.c
+++ b/examples/device/msc_dual_lun/src/main.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/device/msc_dual_lun/src/msc_disk_dual.c b/examples/device/msc_dual_lun/src/msc_disk_dual.c
index fd6347300..718e0d6eb 100644
--- a/examples/device/msc_dual_lun/src/msc_disk_dual.c
+++ b/examples/device/msc_dual_lun/src/msc_disk_dual.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/device/msc_dual_lun/src/tusb_config.h b/examples/device/msc_dual_lun/src/tusb_config.h
index 939919739..fe30fbf20 100644
--- a/examples/device/msc_dual_lun/src/tusb_config.h
+++ b/examples/device/msc_dual_lun/src/tusb_config.h
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -46,7 +46,9 @@
#endif
#define CFG_TUSB_OS OPT_OS_NONE
-#define CFG_TUSB_DEBUG 2
+
+// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
+// #define CFG_TUSB_DEBUG 0
/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
* Tinyusb use follows macros to declare transferring memory so that they can be put
diff --git a/examples/device/msc_dual_lun/src/usb_descriptors.c b/examples/device/msc_dual_lun/src/usb_descriptors.c
index 8cc63da64..24bed9ecf 100644
--- a/examples/device/msc_dual_lun/src/usb_descriptors.c
+++ b/examples/device/msc_dual_lun/src/usb_descriptors.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -79,7 +79,7 @@ uint8_t const desc_configuration[] =
TUD_CONFIG_DESCRIPTOR(ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
// Interface number, string index, EP Out & EP In address, EP size
- TUD_MSC_DESCRIPTOR(ITF_NUM_MSC, 0, EPNUM_MSC, 0x80 | EPNUM_MSC, 64), // highspeed 512
+ TUD_MSC_DESCRIPTOR(ITF_NUM_MSC, 0, EPNUM_MSC, 0x80 | EPNUM_MSC, (CFG_TUSB_RHPORT0_MODE & OPT_MODE_HIGH_SPEED) ? 512 : 64),
};
// Invoked when received GET DEVICE DESCRIPTOR
diff --git a/examples/host/cdc_msc_hid/src/main.c b/examples/host/cdc_msc_hid/src/main.c
index 1c9a5ded2..a5e95159b 100644
--- a/examples/host/cdc_msc_hid/src/main.c
+++ b/examples/host/cdc_msc_hid/src/main.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/host/cdc_msc_hid/src/msc_app.c b/examples/host/cdc_msc_hid/src/msc_app.c
index 00e451093..3001a5f46 100644
--- a/examples/host/cdc_msc_hid/src/msc_app.c
+++ b/examples/host/cdc_msc_hid/src/msc_app.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/host/cdc_msc_hid/src/tusb_config.h b/examples/host/cdc_msc_hid/src/tusb_config.h
index aa081f9db..144efa519 100644
--- a/examples/host/cdc_msc_hid/src/tusb_config.h
+++ b/examples/host/cdc_msc_hid/src/tusb_config.h
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -46,9 +46,11 @@
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_HOST
#endif
-#define CFG_TUSB_DEBUG 2
#define CFG_TUSB_OS OPT_OS_NONE
+// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
+// #define CFG_TUSB_DEBUG 0
+
/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
* Tinyusb use follows macros to declare transferring memory so that they can be put
* into those specific section.
diff --git a/examples/make.mk b/examples/make.mk
index d76f611fb..444b22310 100644
--- a/examples/make.mk
+++ b/examples/make.mk
@@ -31,6 +31,9 @@ BUILD = build-$(BOARD)
# Board specific
include $(TOP)/hw/bsp/$(BOARD)/board.mk
+# Include all source C in board folder
+SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/hw/bsp/$(BOARD)/*.c))
+
# Compiler Flags
CFLAGS += \
-fsingle-precision-constant \
@@ -59,7 +62,7 @@ CFLAGS += \
# Debugging/Optimization
ifeq ($(DEBUG), 1)
- CFLAGS += -O0 -ggdb
+ CFLAGS += -O0 -ggdb -DCFG_TUSB_DEBUG=1
else
CFLAGS += -flto -Os
endif
diff --git a/examples/obsolete/host/src/app_os_prio.h b/examples/obsolete/host/src/app_os_prio.h
index b14c730d2..a9e964a70 100644
--- a/examples/obsolete/host/src/app_os_prio.h
+++ b/examples/obsolete/host/src/app_os_prio.h
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/obsolete/host/src/cdc_serial_host_app.c b/examples/obsolete/host/src/cdc_serial_host_app.c
index 28f7075a3..a70ac09bb 100644
--- a/examples/obsolete/host/src/cdc_serial_host_app.c
+++ b/examples/obsolete/host/src/cdc_serial_host_app.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/obsolete/host/src/cdc_serial_host_app.h b/examples/obsolete/host/src/cdc_serial_host_app.h
index 2759ecae8..0e6bc5150 100644
--- a/examples/obsolete/host/src/cdc_serial_host_app.h
+++ b/examples/obsolete/host/src/cdc_serial_host_app.h
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/obsolete/host/src/keyboard_host_app.c b/examples/obsolete/host/src/keyboard_host_app.c
index e9e3f0866..1dc714108 100644
--- a/examples/obsolete/host/src/keyboard_host_app.c
+++ b/examples/obsolete/host/src/keyboard_host_app.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/obsolete/host/src/keyboard_host_app.h b/examples/obsolete/host/src/keyboard_host_app.h
index be87f9635..12d7fdedd 100644
--- a/examples/obsolete/host/src/keyboard_host_app.h
+++ b/examples/obsolete/host/src/keyboard_host_app.h
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/obsolete/host/src/main.c b/examples/obsolete/host/src/main.c
index e02072b13..59860b782 100644
--- a/examples/obsolete/host/src/main.c
+++ b/examples/obsolete/host/src/main.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/obsolete/host/src/mouse_host_app.c b/examples/obsolete/host/src/mouse_host_app.c
index fa6631292..6fd6bcdba 100644
--- a/examples/obsolete/host/src/mouse_host_app.c
+++ b/examples/obsolete/host/src/mouse_host_app.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/obsolete/host/src/mouse_host_app.h b/examples/obsolete/host/src/mouse_host_app.h
index 86abec9a5..0193a9146 100644
--- a/examples/obsolete/host/src/mouse_host_app.h
+++ b/examples/obsolete/host/src/mouse_host_app.h
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/obsolete/host/src/msc_cli.c b/examples/obsolete/host/src/msc_cli.c
index f46730f6b..c15bcda39 100644
--- a/examples/obsolete/host/src/msc_cli.c
+++ b/examples/obsolete/host/src/msc_cli.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/obsolete/host/src/msc_cli.h b/examples/obsolete/host/src/msc_cli.h
index 0dc55ceb4..de90bebd1 100644
--- a/examples/obsolete/host/src/msc_cli.h
+++ b/examples/obsolete/host/src/msc_cli.h
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/obsolete/host/src/msc_host_app.c b/examples/obsolete/host/src/msc_host_app.c
index 9eb97c87f..77747b536 100644
--- a/examples/obsolete/host/src/msc_host_app.c
+++ b/examples/obsolete/host/src/msc_host_app.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/obsolete/host/src/msc_host_app.h b/examples/obsolete/host/src/msc_host_app.h
index 59ff81dcc..7a160e078 100644
--- a/examples/obsolete/host/src/msc_host_app.h
+++ b/examples/obsolete/host/src/msc_host_app.h
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/obsolete/host/src/rndis_host_app.c b/examples/obsolete/host/src/rndis_host_app.c
index 9dd8a57a6..66da33d06 100644
--- a/examples/obsolete/host/src/rndis_host_app.c
+++ b/examples/obsolete/host/src/rndis_host_app.c
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/obsolete/host/src/rndis_host_app.h b/examples/obsolete/host/src/rndis_host_app.h
index e7b4abf6b..97ff6e27f 100644
--- a/examples/obsolete/host/src/rndis_host_app.h
+++ b/examples/obsolete/host/src/rndis_host_app.h
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/examples/obsolete/host/src/tusb_config.h b/examples/obsolete/host/src/tusb_config.h
index c7dd89e07..d88da4bb4 100644
--- a/examples/obsolete/host/src/tusb_config.h
+++ b/examples/obsolete/host/src/tusb_config.h
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2018, hathach (tinyusb.org)
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -54,7 +54,7 @@
//--------------------------------------------------------------------+
// COMMON CONFIGURATION
//--------------------------------------------------------------------+
-#define CFG_TUSB_DEBUG 2
+#define CFG_TUSB_DEBUG 1
//#define CFG_TUSB_OS OPT_OS_NONE // defined using eclipse build
//#define CFG_TUD_TASK_PRIO 0 // defined using eclipse build
diff --git a/examples/rules.mk b/examples/rules.mk
index df9ffb7e5..d2d5012aa 100644
--- a/examples/rules.mk
+++ b/examples/rules.mk
@@ -22,6 +22,7 @@ INC += $(TOP)/src
#
CFLAGS += $(addprefix -I,$(INC))
LDFLAGS += $(CFLAGS) -fshort-enums -Wl,-T,$(TOP)/$(LD_FILE) -Wl,[email protected] -Wl,-cref -Wl,-gc-sections -specs=nosys.specs -specs=nano.specs
+ASFLAGS += $(CFLAGS)
# Assembly files can be name with upper case .S, convert it to .s
SRC_S := $(SRC_S:.S=.s)
@@ -108,4 +109,4 @@ flash-jlink: $(BUILD)/$(BOARD)-firmware.hex
@echo r >> $(BUILD)/$(BOARD).jlink
@echo go >> $(BUILD)/$(BOARD).jlink
@echo exit >> $(BUILD)/$(BOARD).jlink
- $(JLINKEXE) -device $(JLINK_DEVICE) -if $(JLINK_IF) -speed auto -CommandFile $(BUILD)/$(BOARD).jlink
+ $(JLINKEXE) -device $(JLINK_DEVICE) -if $(JLINK_IF) -JTAGConf -1,-1 -speed auto -CommandFile $(BUILD)/$(BOARD).jlink