diff --git a/CMakeLists.txt b/CMakeLists.txt index df9c32faf6..bbc8d0ee1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -116,6 +116,9 @@ add_compile_options(-Wall include(compile_proto.cmake) compile_proto() +include(patch_board_config.cmake) +patch_board_config() + #pull in tinyUSB set(PICO_TINYUSB_PATH "${CMAKE_CURRENT_LIST_DIR}/lib/tinyusb") diff --git a/compile_proto.cmake b/compile_proto.cmake index 89966923ff..2a35563e63 100644 --- a/compile_proto.cmake +++ b/compile_proto.cmake @@ -13,6 +13,7 @@ function (compile_proto) DEPENDS ${CMAKE_SOURCE_DIR}/lib/nanopb/extra/requirements.txt COMMAND ${Python3_EXECUTABLE} -m venv ${VENV} COMMAND ${VENV_BIN_DIR}/pip --disable-pip-version-check install -r ${CMAKE_SOURCE_DIR}/lib/nanopb/extra/requirements.txt + COMMAND ${VENV_BIN_DIR}/pip --disable-pip-version-check install gp2040ce-binary-tools COMMAND ${VENV_BIN_DIR}/pip freeze > ${VENV_FILE} OUTPUT ${VENV_FILE} COMMENT "Setting up Python Virtual Environment" diff --git a/configs/BentoBox/board-config.json b/configs/BentoBox/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/BentoBox/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/FightboardV3/board-config.json b/configs/FightboardV3/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/FightboardV3/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/FightboardV3Mirrored/board-config.json b/configs/FightboardV3Mirrored/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/FightboardV3Mirrored/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/FlatboxRev4/board-config.json b/configs/FlatboxRev4/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/FlatboxRev4/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/FlatboxRev5/board-config.json b/configs/FlatboxRev5/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/FlatboxRev5/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/FlatboxRev5RGB/board-config.json b/configs/FlatboxRev5RGB/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/FlatboxRev5RGB/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/FlatboxRev5Southpaw/board-config.json b/configs/FlatboxRev5Southpaw/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/FlatboxRev5Southpaw/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/Granola/board-config.json b/configs/Granola/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/Granola/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/Haute42COSMOX/board-config.json b/configs/Haute42COSMOX/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/Haute42COSMOX/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/KB2040/board-config.json b/configs/KB2040/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/KB2040/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/KeyboardConverter/board-config.json b/configs/KeyboardConverter/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/KeyboardConverter/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/Liatris/board-config.json b/configs/Liatris/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/Liatris/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/Mavercade/board-config.json b/configs/Mavercade/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/Mavercade/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/OpenCore0/board-config.json b/configs/OpenCore0/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/OpenCore0/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/OpenCore0WASD/board-config.json b/configs/OpenCore0WASD/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/OpenCore0WASD/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/Pico/board-config.json b/configs/Pico/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/Pico/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/PicoAnn/board-config.json b/configs/PicoAnn/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/PicoAnn/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/PicoFightingBoard/board-config.json b/configs/PicoFightingBoard/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/PicoFightingBoard/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/PicoW/board-config.json b/configs/PicoW/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/PicoW/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/RP2040AdvancedBreakoutBoard/board-config.json b/configs/RP2040AdvancedBreakoutBoard/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/RP2040AdvancedBreakoutBoard/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/RP2040AdvancedBreakoutBoardUSBPassthrough/board-config.json b/configs/RP2040AdvancedBreakoutBoardUSBPassthrough/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/RP2040AdvancedBreakoutBoardUSBPassthrough/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/RP2040MiniBreakoutBoard/board-config.json b/configs/RP2040MiniBreakoutBoard/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/RP2040MiniBreakoutBoard/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/RanaTadpole/board-config.json b/configs/RanaTadpole/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/RanaTadpole/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/ReflexCtrlSNES/board-config.json b/configs/ReflexCtrlSNES/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/ReflexCtrlSNES/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/ReflexEncodeV1.2/board-config.json b/configs/ReflexEncodeV1.2/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/ReflexEncodeV1.2/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/ReflexEncodeV2.0/board-config.json b/configs/ReflexEncodeV2.0/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/ReflexEncodeV2.0/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/SGFBridget/board-config.json b/configs/SGFBridget/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/SGFBridget/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/SGFFaust/board-config.json b/configs/SGFFaust/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/SGFFaust/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/SparkFunProMicro/board-config.json b/configs/SparkFunProMicro/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/SparkFunProMicro/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/Stress/board-config.json b/configs/Stress/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/Stress/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/configs/WaveshareZero/board-config.json b/configs/WaveshareZero/board-config.json new file mode 100644 index 0000000000..00bf892c9b --- /dev/null +++ b/configs/WaveshareZero/board-config.json @@ -0,0 +1,3 @@ +{ + "boardVersion": "v0.7.8" +} diff --git a/patch_board_config.cmake b/patch_board_config.cmake new file mode 100644 index 0000000000..d8bd68e57d --- /dev/null +++ b/patch_board_config.cmake @@ -0,0 +1,29 @@ +function (patch_board_config) + find_package(Python3 REQUIRED COMPONENTS Interpreter) + + set(VENV ${CMAKE_CURRENT_BINARY_DIR}/venv) + if(CMAKE_HOST_WIN32) + set(VENV_BIN_DIR ${VENV}/Scripts) + else() + set(VENV_BIN_DIR ${VENV}/bin) + endif() + + add_custom_target( + PatchBoardConfig ALL + DEPENDS ${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + COMMAND ${VENV_BIN_DIR}/concatenate + -P ./proto + -P ./lib/nanopb/generator/proto + ./build/${PROJECT_NAME}_${CMAKE_PROJECT_VERSION}_${GP2040_BOARDCONFIG}.bin + --json-board-config-filename ./configs/${GP2040_BOARDCONFIG}/board-config.json + --new-filename ./build/${PROJECT_NAME}_${CMAKE_PROJECT_VERSION}_${GP2040_BOARDCONFIG}.uf2 + COMMAND ${VENV_BIN_DIR}/concatenate + -P ./proto + -P ./lib/nanopb/generator/proto + ./build/${PROJECT_NAME}_${CMAKE_PROJECT_VERSION}_${GP2040_BOARDCONFIG}.bin + --json-board-config-filename ./configs/${GP2040_BOARDCONFIG}/board-config.json + --new-filename ./build/${PROJECT_NAME}_${CMAKE_PROJECT_VERSION}_${GP2040_BOARDCONFIG}.bin + COMMENT "Patching binary with board config" + ) +endfunction()