diff options
| author | Christoph Honal <christoph.honal@web.de> | 2022-05-10 21:46:36 +0200 |
|---|---|---|
| committer | Riku Isokoski <riksu9000@gmail.com> | 2022-06-27 08:28:48 +0300 |
| commit | 8b0559c4812d74b6307757135622975523c5a88d (patch) | |
| tree | ad5a5f2e328f8d406a24e74c0d31d9ba2b723671 /src/CMakeLists.txt | |
| parent | bab86633a00c58ff01b7866cc600aabb2208b6e3 (diff) | |
Add basic hardware configuration options for P8
This enables the configuration of the LFCLK source,
as well as the target hardware board pin configuration.
Diffstat (limited to 'src/CMakeLists.txt')
| -rw-r--r-- | src/CMakeLists.txt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index db0612ff..3b7503fd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -779,6 +779,35 @@ add_definitions(-DFREERTOS) add_definitions(-D__STACK_SIZE=1024) add_definitions(-D__HEAP_SIZE=4096) +# Note: Only use this for debugging +# Derive the low frequency clock from the main clock (SYNT) +# add_definitions(-DCLOCK_CONFIG_LF_SRC=2) + +# Target hardware configuration options +add_definitions(-DTARGET_DEVICE_${TARGET_DEVICE}) +if(TARGET_DEVICE STREQUAL "PINETIME") + add_definitions(-DDRIVER_PINMAP_PINETIME) + add_definitions(-DCLOCK_CONFIG_LF_SRC=1) # XTAL +elseif(TARGET_DEVICE STREQUAL "MOY-TFK5") # P8a + add_definitions(-DDRIVER_PINMAP_P8) + add_definitions(-DCLOCK_CONFIG_LF_SRC=1) # XTAL +elseif(TARGET_DEVICE STREQUAL "MOY-TIN5") # P8a variant 2 + add_definitions(-DDRIVER_PINMAP_P8) + add_definitions(-DCLOCK_CONFIG_LF_SRC=1) # XTAL +elseif(TARGET_DEVICE STREQUAL "MOY-TON5") # P8b + add_definitions(-DDRIVER_PINMAP_P8) + add_definitions(-DCLOCK_CONFIG_LF_SRC=0) # RC + add_definitions(-DMYNEWT_VAL_BLE_LL_SCA=500) + add_definitions(-DCLOCK_CONFIG_LF_CAL_ENABLED=1) +elseif(TARGET_DEVICE STREQUAL "MOY-UNK") # P8b mirrored + add_definitions(-DDRIVER_PINMAP_P8) + add_definitions(-DCLOCK_CONFIG_LF_SRC=0) # RC + add_definitions(-DMYNEWT_VAL_BLE_LL_SCA=500) + add_definitions(-DCLOCK_CONFIG_LF_CAL_ENABLED=1) +else() + message(FATAL_ERROR "Invalid TARGET_DEVICE") +endif() + # Debug configuration if (${CMAKE_BUILD_TYPE} STREQUAL "Debug") add_definitions(-DDEBUG) |
