InfiniTime.git

commit 69b9d30a3057ea2d7170d15edbae15f4e56cdcc3

Author: FintasticMan <finlay.neon.kid@gmail.com>

p8: Fix build when building for P8 variants

Building with a TARGET_DEVICE set to any of the P8 variants' names
caused the build to fail, because they contained hyphens.
The build defines a macro `TARGET_DEVICE_$VARIANT`, which fails if
`$VARIANT` contains a hyphen.

 doc/buildAndProgram.md | 2 +-
 src/CMakeLists.txt | 8 ++++----


diff --git a/doc/buildAndProgram.md b/doc/buildAndProgram.md
index 3b4ed22c0d5515c8c02a27c2435f9b888bd377df..69e4bfd836efbaf44f1a569dae08852a3b69c4da 100644
--- a/doc/buildAndProgram.md
+++ b/doc/buildAndProgram.md
@@ -43,7 +43,7 @@ **NRF5_SDK_PATH**|path to the NRF52 SDK|`-DNRF5_SDK_PATH=/home/jf/nrf52/Pinetime/sdk`|
 **CMAKE_BUILD_TYPE (\*)**| Build type (Release or Debug). Release is applied by default if this variable is not specified.|`-DCMAKE_BUILD_TYPE=Debug`
 **BUILD_DFU (\*\*)**|Build DFU files while building (needs [adafruit-nrfutil](https://github.com/adafruit/Adafruit_nRF52_nrfutil)).|`-DBUILD_DFU=1`
 **BUILD_RESOURCES (\*\*)**| Generate external resource while building (needs [lv_font_conv](https://github.com/lvgl/lv_font_conv) and [python3-pil/pillow](https://pillow.readthedocs.io) module). |`-DBUILD_RESOURCES=1`
-**TARGET_DEVICE**|Target device, used for hardware configuration. Allowed: `PINETIME, MOY-TFK5, MOY-TIN5, MOY-TON5, MOY-UNK`|`-DTARGET_DEVICE=PINETIME` (Default)
+**TARGET_DEVICE**|Target device, used for hardware configuration. Allowed: `PINETIME, MOY_TFK5, MOY_TIN5, MOY_TON5, MOY_UNK`|`-DTARGET_DEVICE=PINETIME` (Default)
 
 #### (\*) Note about **CMAKE_BUILD_TYPE**
 By default, this variable is set to *Release*. It compiles the code with size and speed optimizations. We use this value for all the binaries we publish when we [release](https://github.com/InfiniTimeOrg/InfiniTime/releases) new versions of InfiniTime.




diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index dc718bab13b41fb735fe3b5a6d90187d3ad965f5..4207161e36435123580ea333187743fabd6174de 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -805,18 +805,18 @@ add_definitions(-DTARGET_DEVICE_NAME="${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
+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
+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
+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
+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)