diff options
| author | Ha Thach <[email protected]> | 2021-02-01 14:25:58 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-02-01 14:25:58 +0700 |
| commit | 26caddae239a9b2657121a8da81337cf14d85bc0 (patch) | |
| tree | 34b85bdb2853c173a1d9c29dff9df65f2621801e /examples | |
| parent | 78f50518a48f55fe3a4d921895c5d6c400c355b0 (diff) | |
| parent | 0799a910730a3aa881f6292b2c7cbbc784690e7a (diff) | |
Merge pull request #621 from hathach/rp2040-logger-enumfix
Rp2040 logger and enum fix
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/device/audio_test/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/device/board_test/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/device/cdc_dual_ports/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/device/cdc_msc/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/device/dfu_rt/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/device/dynamic_configuration/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/device/hid_composite/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/device/hid_generic_inout/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/device/hid_multiple_interface/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/device/midi_test/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/device/msc_dual_lun/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/device/net_lwip_webserver/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/device/uac2_headset/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/device/usbtmc/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/device/webusb_serial/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/make.mk | 7 | ||||
| -rw-r--r-- | examples/rules.mk | 25 |
17 files changed, 36 insertions, 26 deletions
diff --git a/examples/device/audio_test/CMakeLists.txt b/examples/device/audio_test/CMakeLists.txt index 645d57157..a10473b79 100644 --- a/examples/device/audio_test/CMakeLists.txt +++ b/examples/device/audio_test/CMakeLists.txt @@ -33,7 +33,7 @@ if(FAMILY STREQUAL "rp2040") CFG_TUSB_OS=OPT_OS_PICO ) - target_link_libraries(${PROJECT} pico_stdlib) + target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration) pico_add_extra_outputs(${PROJECT}) else() diff --git a/examples/device/board_test/CMakeLists.txt b/examples/device/board_test/CMakeLists.txt index 573f026f3..b8b7e7297 100644 --- a/examples/device/board_test/CMakeLists.txt +++ b/examples/device/board_test/CMakeLists.txt @@ -37,7 +37,7 @@ elseif(FAMILY STREQUAL "rp2040") CFG_TUSB_OS=OPT_OS_PICO ) - target_link_libraries(${PROJECT} pico_stdlib) + target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration) pico_add_extra_outputs(${PROJECT}) else() diff --git a/examples/device/cdc_dual_ports/CMakeLists.txt b/examples/device/cdc_dual_ports/CMakeLists.txt index c358eddab..f4bf75c26 100644 --- a/examples/device/cdc_dual_ports/CMakeLists.txt +++ b/examples/device/cdc_dual_ports/CMakeLists.txt @@ -33,7 +33,7 @@ if(FAMILY STREQUAL "rp2040") CFG_TUSB_OS=OPT_OS_PICO ) - target_link_libraries(${PROJECT} pico_stdlib) + target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration) pico_add_extra_outputs(${PROJECT}) else() diff --git a/examples/device/cdc_msc/CMakeLists.txt b/examples/device/cdc_msc/CMakeLists.txt index 5f4d9ba4e..9e0d1f790 100644 --- a/examples/device/cdc_msc/CMakeLists.txt +++ b/examples/device/cdc_msc/CMakeLists.txt @@ -39,7 +39,7 @@ elseif(FAMILY STREQUAL "rp2040") CFG_TUSB_OS=OPT_OS_PICO ) - target_link_libraries(${PROJECT} pico_stdlib) + target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration) pico_add_extra_outputs(${PROJECT}) else() diff --git a/examples/device/dfu_rt/CMakeLists.txt b/examples/device/dfu_rt/CMakeLists.txt index c358eddab..f4bf75c26 100644 --- a/examples/device/dfu_rt/CMakeLists.txt +++ b/examples/device/dfu_rt/CMakeLists.txt @@ -33,7 +33,7 @@ if(FAMILY STREQUAL "rp2040") CFG_TUSB_OS=OPT_OS_PICO ) - target_link_libraries(${PROJECT} pico_stdlib) + target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration) pico_add_extra_outputs(${PROJECT}) else() diff --git a/examples/device/dynamic_configuration/CMakeLists.txt b/examples/device/dynamic_configuration/CMakeLists.txt index a759e56e8..b4c95652a 100644 --- a/examples/device/dynamic_configuration/CMakeLists.txt +++ b/examples/device/dynamic_configuration/CMakeLists.txt @@ -34,7 +34,7 @@ if(FAMILY STREQUAL "rp2040") CFG_TUSB_OS=OPT_OS_PICO ) - target_link_libraries(${PROJECT} pico_stdlib) + target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration) pico_add_extra_outputs(${PROJECT}) else() diff --git a/examples/device/hid_composite/CMakeLists.txt b/examples/device/hid_composite/CMakeLists.txt index c358eddab..f4bf75c26 100644 --- a/examples/device/hid_composite/CMakeLists.txt +++ b/examples/device/hid_composite/CMakeLists.txt @@ -33,7 +33,7 @@ if(FAMILY STREQUAL "rp2040") CFG_TUSB_OS=OPT_OS_PICO ) - target_link_libraries(${PROJECT} pico_stdlib) + target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration) pico_add_extra_outputs(${PROJECT}) else() diff --git a/examples/device/hid_generic_inout/CMakeLists.txt b/examples/device/hid_generic_inout/CMakeLists.txt index c358eddab..f4bf75c26 100644 --- a/examples/device/hid_generic_inout/CMakeLists.txt +++ b/examples/device/hid_generic_inout/CMakeLists.txt @@ -33,7 +33,7 @@ if(FAMILY STREQUAL "rp2040") CFG_TUSB_OS=OPT_OS_PICO ) - target_link_libraries(${PROJECT} pico_stdlib) + target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration) pico_add_extra_outputs(${PROJECT}) else() diff --git a/examples/device/hid_multiple_interface/CMakeLists.txt b/examples/device/hid_multiple_interface/CMakeLists.txt index c358eddab..f4bf75c26 100644 --- a/examples/device/hid_multiple_interface/CMakeLists.txt +++ b/examples/device/hid_multiple_interface/CMakeLists.txt @@ -33,7 +33,7 @@ if(FAMILY STREQUAL "rp2040") CFG_TUSB_OS=OPT_OS_PICO ) - target_link_libraries(${PROJECT} pico_stdlib) + target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration) pico_add_extra_outputs(${PROJECT}) else() diff --git a/examples/device/midi_test/CMakeLists.txt b/examples/device/midi_test/CMakeLists.txt index c358eddab..f4bf75c26 100644 --- a/examples/device/midi_test/CMakeLists.txt +++ b/examples/device/midi_test/CMakeLists.txt @@ -33,7 +33,7 @@ if(FAMILY STREQUAL "rp2040") CFG_TUSB_OS=OPT_OS_PICO ) - target_link_libraries(${PROJECT} pico_stdlib) + target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration) pico_add_extra_outputs(${PROJECT}) else() diff --git a/examples/device/msc_dual_lun/CMakeLists.txt b/examples/device/msc_dual_lun/CMakeLists.txt index f0e050f9c..6032308f2 100644 --- a/examples/device/msc_dual_lun/CMakeLists.txt +++ b/examples/device/msc_dual_lun/CMakeLists.txt @@ -34,7 +34,7 @@ if(FAMILY STREQUAL "rp2040") CFG_TUSB_OS=OPT_OS_PICO ) - target_link_libraries(${PROJECT} pico_stdlib) + target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration) pico_add_extra_outputs(${PROJECT}) else() diff --git a/examples/device/net_lwip_webserver/CMakeLists.txt b/examples/device/net_lwip_webserver/CMakeLists.txt index ec4996086..e3c8190f4 100644 --- a/examples/device/net_lwip_webserver/CMakeLists.txt +++ b/examples/device/net_lwip_webserver/CMakeLists.txt @@ -80,7 +80,7 @@ if(FAMILY STREQUAL "rp2040") HTTPD_USE_CUSTOM_FSDATA=0 ) - target_link_libraries(${PROJECT} pico_stdlib) + target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration) pico_add_extra_outputs(${PROJECT}) else() diff --git a/examples/device/uac2_headset/CMakeLists.txt b/examples/device/uac2_headset/CMakeLists.txt index c358eddab..f4bf75c26 100644 --- a/examples/device/uac2_headset/CMakeLists.txt +++ b/examples/device/uac2_headset/CMakeLists.txt @@ -33,7 +33,7 @@ if(FAMILY STREQUAL "rp2040") CFG_TUSB_OS=OPT_OS_PICO ) - target_link_libraries(${PROJECT} pico_stdlib) + target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration) pico_add_extra_outputs(${PROJECT}) else() diff --git a/examples/device/usbtmc/CMakeLists.txt b/examples/device/usbtmc/CMakeLists.txt index 686e8dc2d..9a4aa382b 100644 --- a/examples/device/usbtmc/CMakeLists.txt +++ b/examples/device/usbtmc/CMakeLists.txt @@ -34,7 +34,7 @@ if(FAMILY STREQUAL "rp2040") CFG_TUSB_OS=OPT_OS_PICO ) - target_link_libraries(${PROJECT} pico_stdlib) + target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration) pico_add_extra_outputs(${PROJECT}) else() diff --git a/examples/device/webusb_serial/CMakeLists.txt b/examples/device/webusb_serial/CMakeLists.txt index c358eddab..f4bf75c26 100644 --- a/examples/device/webusb_serial/CMakeLists.txt +++ b/examples/device/webusb_serial/CMakeLists.txt @@ -33,7 +33,7 @@ if(FAMILY STREQUAL "rp2040") CFG_TUSB_OS=OPT_OS_PICO ) - target_link_libraries(${PROJECT} pico_stdlib) + target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration) pico_add_extra_outputs(${PROJECT}) else() diff --git a/examples/make.mk b/examples/make.mk index e820989b7..5387a4ec4 100644 --- a/examples/make.mk +++ b/examples/make.mk @@ -112,13 +112,18 @@ endif # Log level is mapped to TUSB DEBUG option ifneq ($(LOG),) + CMAKE_DEFSYM += -DLOG=$(LOG) CFLAGS += -DCFG_TUSB_DEBUG=$(LOG) endif # Logger: default is uart, can be set to rtt or swo +ifneq ($(LOGGER),) + CMAKE_DEFSYM += -DLOGGER=$(LOGGER) +endif + ifeq ($(LOGGER),rtt) - RTT_SRC = lib/SEGGER_RTT CFLAGS += -DLOGGER_RTT -DSEGGER_RTT_MODE_DEFAULT=SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL + RTT_SRC = lib/SEGGER_RTT INC += $(TOP)/$(RTT_SRC)/RTT SRC_C += $(RTT_SRC)/RTT/SEGGER_RTT.c else ifeq ($(LOGGER),swo) diff --git a/examples/rules.mk b/examples/rules.mk index aac0fbb38..5dded759c 100644 --- a/examples/rules.mk +++ b/examples/rules.mk @@ -11,30 +11,30 @@ ifeq ($(FAMILY),esp32s2) .PHONY: all clean flash all: - idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) build + idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) build build: all clean: - idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) clean + idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) clean fullclean: - idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) fullclean + idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) fullclean flash: - idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) flash + idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) flash bootloader-flash: - idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) bootloader-flash + idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) bootloader-flash app-flash: - idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) app-flash + idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) app-flash erase: - idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) erase_flash + idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) erase_flash monitor: - idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) monitor + idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) monitor UF2_FAMILY_ID = 0xbfdd4eee $(BUILD)/$(PROJECT).uf2: $(BUILD)/$(PROJECT).hex @@ -43,13 +43,18 @@ $(BUILD)/$(PROJECT).uf2: $(BUILD)/$(PROJECT).hex else ifeq ($(FAMILY),rp2040) -all: - [ -d $(BUILD) ] || cmake -S . -B $(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) -DPICO_BUILD_DOCS=0 +$(BUILD): + cmake -S . -B $(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) -DPICO_BUILD_DOCS=0 $(CMAKE_DEFSYM) + +all: $(BUILD) $(MAKE) -C $(BUILD) clean: $(RM) -rf $(BUILD) +flash: + @$(CP) $(BUILD)/$(PROJECT).uf2 /media/$(USER)/RPI-RP2 + else # GNU Make build system |
