aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-12-07 13:58:46 -0700
committerJosh Rahm <joshuarahm@gmail.com>2024-12-07 13:58:46 -0700
commit546a5ccdba66dd8d8c19ce6d8486f46c84637cf2 (patch)
tree95b52da91414c1bfbad745c6b55617011012813e /CMakeLists.txt
parent9182b65ae2045c5087257751d30409deecf9520a (diff)
downloadch573-546a5ccdba66dd8d8c19ce6d8486f46c84637cf2.tar.gz
ch573-546a5ccdba66dd8d8c19ce6d8486f46c84637cf2.tar.bz2
ch573-546a5ccdba66dd8d8c19ce6d8486f46c84637cf2.zip
Add way to toggle the default pattern and a way to switch the pattern.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d30b125..be194aa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,17 @@ cmake_minimum_required(VERSION 3.10)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
+if (NOT DEFINED PATTERN)
+ set(PATTERN "CandyCane")
+endif()
+
+if (NOT DEFINED LED_BYTE_ORDER)
+ set(LED_BYTE_ORDER "GRB")
+endif()
+
+set(PATTERN ${PATTERN} CACHE STRING "Define the default pattern to use.")
+set(LED_BYTE_ORDER ${LED_BYTE_ORDER} CACHE STRING "The byte order to use. This should either be RGB or GRB")
+
set(TC_PREFIX riscv32-picolibc-elf-)
# Set compiler and tools
set(CMAKE_C_COMPILER "${TC_PREFIX}gcc" CACHE INTERNAL "C Compiler")
@@ -23,6 +34,10 @@ endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
file(REAL_PATH "stubs/libgloss_stub.c" LIBGLOSS_STUB)
+add_compile_definitions(DEFAULT_PATTERN=${PATTERN})
+
+add_compile_definitions(LED_BYTE_ORDER=${LED_BYTE_ORDER})
+
# Configure for Bare Metal.
set(CMAKE_SYSTEM_NAME Generic)