summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2024-04-04 14:35:29 +0700
committerGitHub <[email protected]>2024-04-04 14:35:29 +0700
commit177b388be0f430ef09ad2caf61cd70acd574c0d5 (patch)
tree4126a61278ccaeed3f0bacc724e0aaf8c51054a5 /hw
parent66cdf6d097d76f8d21ed4314651ac730d4023f99 (diff)
parentebe692350047b7b2a5b46de7894352934c4200aa (diff)
Merge pull request #2571 from hathach/fix-max3421-rp2040-build
fix build with rp2040 + max3421
Diffstat (limited to 'hw')
-rw-r--r--hw/bsp/family_support.cmake43
-rw-r--r--hw/bsp/rp2040/boards/feather_rp2040_max3421/board.cmake4
2 files changed, 20 insertions, 27 deletions
diff --git a/hw/bsp/family_support.cmake b/hw/bsp/family_support.cmake
index d84077ed8..4ccd6e4f2 100644
--- a/hw/bsp/family_support.cmake
+++ b/hw/bsp/family_support.cmake
@@ -79,48 +79,37 @@ set(WARNING_FLAGS_IAR "")
function(family_filter RESULT DIR)
get_filename_component(DIR ${DIR} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
- if (EXISTS "${DIR}/only.txt")
- file(READ "${DIR}/only.txt" ONLYS)
- # Replace newlines with semicolon so that it is treated as a list by CMake
- string(REPLACE "\n" ";" ONLYS_LINES ${ONLYS})
-
- # For each mcu
+ if (EXISTS "${DIR}/skip.txt")
+ file(STRINGS "${DIR}/skip.txt" SKIPS_LINES)
foreach(MCU IN LISTS FAMILY_MCUS)
# For each line in only.txt
- foreach(_line ${ONLYS_LINES})
- # If mcu:xxx exists for this mcu or board:xxx then include
- if (${_line} STREQUAL "mcu:${MCU}" OR ${_line} STREQUAL "board:${BOARD}")
- set(${RESULT} 1 PARENT_SCOPE)
+ foreach(_line ${SKIPS_LINES})
+ # If mcu:xxx exists for this mcu then skip
+ if (${_line} STREQUAL "mcu:${MCU}" OR ${_line} STREQUAL "board:${BOARD}" OR ${_line} STREQUAL "family:${FAMILY}")
+ set(${RESULT} 0 PARENT_SCOPE)
return()
endif()
endforeach()
endforeach()
+ endif ()
- # Didn't find it in only file so don't build
- set(${RESULT} 0 PARENT_SCOPE)
-
- elseif (EXISTS "${DIR}/skip.txt")
- file(READ "${DIR}/skip.txt" SKIPS)
- # Replace newlines with semicolon so that it is treated as a list by CMake
- string(REPLACE "\n" ";" SKIPS_LINES ${SKIPS})
-
- # For each mcu
+ if (EXISTS "${DIR}/only.txt")
+ file(STRINGS "${DIR}/only.txt" ONLYS_LINES)
foreach(MCU IN LISTS FAMILY_MCUS)
# For each line in only.txt
- foreach(_line ${SKIPS_LINES})
- # If mcu:xxx exists for this mcu then skip
- if (${_line} STREQUAL "mcu:${MCU}")
- set(${RESULT} 0 PARENT_SCOPE)
+ foreach(_line ${ONLYS_LINES})
+ # If mcu:xxx exists for this mcu or board:xxx then include
+ if (${_line} STREQUAL "mcu:${MCU}" OR ${_line} STREQUAL "board:${BOARD}" OR ${_line} STREQUAL "family:${FAMILY}")
+ set(${RESULT} 1 PARENT_SCOPE)
return()
endif()
endforeach()
endforeach()
- # Didn't find in skip file so build
- set(${RESULT} 1 PARENT_SCOPE)
+ # Didn't find it in only file so don't build
+ set(${RESULT} 0 PARENT_SCOPE)
else()
-
- # Didn't find skip or only file so build
+ # only.txt not exist so build
set(${RESULT} 1 PARENT_SCOPE)
endif()
endfunction()
diff --git a/hw/bsp/rp2040/boards/feather_rp2040_max3421/board.cmake b/hw/bsp/rp2040/boards/feather_rp2040_max3421/board.cmake
new file mode 100644
index 000000000..b8e5890f3
--- /dev/null
+++ b/hw/bsp/rp2040/boards/feather_rp2040_max3421/board.cmake
@@ -0,0 +1,4 @@
+set(PICO_BOARD adafruit_feather_rp2040)
+
+# Enable MAX3421E USB Host
+set(MAX3421_HOST 1)