summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-11-17 12:40:23 +0700
committerhathach <[email protected]>2018-11-17 12:40:23 +0700
commit027d9ef4bda78ff2baff1181682b61e4fa328f94 (patch)
tree1c32f8b82bf0efcc36eb4defbf3a0177c2799593 /examples
parentcb37b819d90ad54a7e6b7c7edb83c9a8333876d7 (diff)
pass mcu option from compiler
Diffstat (limited to 'examples')
-rw-r--r--examples/device/device_composite/ses/device_composite.emProject4
-rw-r--r--examples/device/device_composite/src/tusb_config.h7
-rw-r--r--examples/device/nrf52840_freertos/segger/nrf5x_freertos.emProject2
3 files changed, 9 insertions, 4 deletions
diff --git a/examples/device/device_composite/ses/device_composite.emProject b/examples/device/device_composite/ses/device_composite.emProject
index 35463b25d..f2f052ed2 100644
--- a/examples/device/device_composite/ses/device_composite.emProject
+++ b/examples/device/device_composite/ses/device_composite.emProject
@@ -19,7 +19,7 @@
arm_target_device_name="nRF52840_xxAA"
arm_target_interface_type="SWD"
build_treat_warnings_as_errors="Yes"
- c_preprocessor_definitions="NRF52840_XXAA;__nRF_FAMILY;ARM_MATH_CM4;FLASH_PLACEMENT=1;BOARD_PCA10056"
+ c_preprocessor_definitions="NRF52840_XXAA;__nRF_FAMILY;ARM_MATH_CM4;FLASH_PLACEMENT=1;BOARD_PCA10056;CFG_TUSB_MCU=OPT_MCU_NRF5X"
c_user_include_directories="../src;$(rootDir)/hw/cmsis/Include;$(rootDir)/hw;$(rootDir)/src;$(nrfxDir)/..;$(nrfxDir);$(nrfxDir)/mdk;$(nrfxDir)/hal;$(nrfxDir)/drivers/include"
debug_register_definition_file="ses_nrf5x/nrf52840_Registers.xml"
debug_target_connection="J-Link"
@@ -118,7 +118,7 @@
arm_target_device_name="ATSAMD51J19"
arm_target_interface_type="SWD"
build_treat_warnings_as_errors="Yes"
- c_preprocessor_definitions="__SAME51_FAMILY;__SAMD51J19A__;ARM_MATH_CM4;FLASH_PLACEMENT=1;BOARD_METRO_M4_EXPRESS;USE_SIMPLE_ASSERT"
+ c_preprocessor_definitions="__SAME51_FAMILY;__SAMD51J19A__;ARM_MATH_CM4;FLASH_PLACEMENT=1;USE_SIMPLE_ASSERT;BOARD_METRO_M4_EXPRESS;CFG_TUSB_MCU=OPT_MCU_SAMD51"
c_user_include_directories="../src;$(rootDir)/hw/cmsis/Include;$(rootDir)/hw;$(rootDir)/src;$(asf4Dir);$(asf4Dir)/include;$(asf4Dir)/hri;$(asf4Dir)/hal/include;$(asf4Dir)/hal/utils/include;$(asf4Dir)/hpl/port"
debug_register_definition_file="ses_samd51/ATSAME51J19A_Registers.xml"
debug_target_connection="J-Link"
diff --git a/examples/device/device_composite/src/tusb_config.h b/examples/device/device_composite/src/tusb_config.h
index 680036859..b802a4131 100644
--- a/examples/device/device_composite/src/tusb_config.h
+++ b/examples/device/device_composite/src/tusb_config.h
@@ -48,7 +48,12 @@
//--------------------------------------------------------------------
// COMMON CONFIGURATION
//--------------------------------------------------------------------
-#define CFG_TUSB_MCU OPT_MCU_NRF5X
+
+// defined by compiler flags for flexibility
+#ifndef CFG_TUSB_MCU
+ #error CFG_TUSB_MCU should be defined using compiler flags
+#endif
+
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE
#define CFG_TUSB_DEBUG 2
diff --git a/examples/device/nrf52840_freertos/segger/nrf5x_freertos.emProject b/examples/device/nrf52840_freertos/segger/nrf5x_freertos.emProject
index 661dc12a6..f36a76fed 100644
--- a/examples/device/nrf52840_freertos/segger/nrf5x_freertos.emProject
+++ b/examples/device/nrf52840_freertos/segger/nrf5x_freertos.emProject
@@ -19,7 +19,7 @@
arm_target_device_name="nRF52840_xxAA"
arm_target_interface_type="SWD"
build_treat_warnings_as_errors="Yes"
- c_preprocessor_definitions="NRF52840_XXAA;__nRF_FAMILY;ARM_MATH_CM4;FLASH_PLACEMENT=1;BOARD_PCA10056"
+ c_preprocessor_definitions="NRF52840_XXAA;__nRF_FAMILY;ARM_MATH_CM4;FLASH_PLACEMENT=1;BOARD_PCA10056;CFG_TUSB_MCU=OPT_MCU_NRF5X"
c_user_include_directories="../src;$(tusbDir)/hw/cmsis/Include;$(tusbDir)/hw;$(tusbDir)/src;$(nrfxDir)/..;$(nrfxDir);$(nrfxDir)/mdk;$(nrfxDir)/hal;$(nrfxDir)/drivers/include;$(freertosDir)/Source/include;$(freertosDir)/Source/portable/GCC/ARM_CM4F"
debug_register_definition_file="$(ProjectDir)/nrf52840_Registers.xml"
debug_target_connection="J-Link"