Skip to content

Commit

Permalink
Take version from board overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
Kampi committed Jul 25, 2024
1 parent d540a61 commit 3ddf4ce
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 18 deletions.
11 changes: 8 additions & 3 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ endforeach()

string(REGEX MATCH "zswatch_nrf5340_cpuapp(_ns)?@([0-9]+)$" ZSWATCH_BOARD "${BOARD}")
if(ZSWATCH_BOARD)
set(ZSWATCH_REV ${CMAKE_MATCH_2})
if(${ZSWATCH_REV} EQUAL 2)
set(VERSION_STRING "${CMAKE_MATCH_2}")
add_definitions(-CONFIG_ZSWATCH_PCB_REV=${CMAKE_MATCH_2})
add_definitions(-CONFIG_BT_DIS_HW_REV_STR=${VERSION_STRING})

message("PCB revision: " ${CONFIG_ZSWATCH_PCB_REV})

if(CONFIG_ZSWATCH_PCB_REV EQUAL 2)
set(DFU_BUILD true)
set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/partition_mcuboot.yml)
set(OVERLAY_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/boards/dfu.conf)
set(mcuboot_DTC_OVERLAY_FILE ${CMAKE_CURRENT_SOURCE_DIR}/overlays/mcuboot.overlay)
elseif(${ZSWATCH_REV} GREATER_EQUAL 3)
elseif(CONFIG_ZSWATCH_PCB_REV GREATER_EQUAL 3)
set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/partition_external.yml)
else()
set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/partition_internal.yml)
Expand Down
3 changes: 0 additions & 3 deletions app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_1.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
CONFIG_ZSWATCH_PCB_REV=1
CONFIG_BT_DIS_HW_REV_STR="1"

CONFIG_DEBUG_COREDUMP_BACKEND_LOGGING=y
3 changes: 0 additions & 3 deletions app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_2.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
CONFIG_ZSWATCH_PCB_REV=2
CONFIG_BT_DIS_HW_REV_STR="2"

CONFIG_DEBUG_COREDUMP_BACKEND_LOGGING=y
3 changes: 0 additions & 3 deletions app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_3.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
CONFIG_ZSWATCH_PCB_REV=3
CONFIG_BT_DIS_HW_REV_STR="3"

#---------------
# FLASH
#-----------------
Expand Down
3 changes: 0 additions & 3 deletions app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_4.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
CONFIG_ZSWATCH_PCB_REV=4
CONFIG_BT_DIS_HW_REV_STR="4"

#---------------
# FLASH
#-----------------
Expand Down
3 changes: 0 additions & 3 deletions app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_5.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
CONFIG_ZSWATCH_PCB_REV=5
CONFIG_BT_DIS_HW_REV_STR="5"

# FLASH
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
Expand Down

0 comments on commit 3ddf4ce

Please sign in to comment.