aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
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)