aboutsummaryrefslogtreecommitdiff
path: root/lib/pbdrv/drv/arduino/include.cmake
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-06-18 17:29:25 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-06-18 17:29:25 +0200
commit3f3bef9c6bf0b9143da80e4b4363eb0362fb91c9 (patch)
treec4344b281fd589690b6b82bc6b5c2e91a4f2a13f /lib/pbdrv/drv/arduino/include.cmake
parentc1007f50de3ad7284d4a1afa6bfb3b6e427c3556 (diff)
clean up code for getting main controller compiling again
Diffstat (limited to 'lib/pbdrv/drv/arduino/include.cmake')
-rw-r--r--lib/pbdrv/drv/arduino/include.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/pbdrv/drv/arduino/include.cmake b/lib/pbdrv/drv/arduino/include.cmake
new file mode 100644
index 0000000..50f56d6
--- /dev/null
+++ b/lib/pbdrv/drv/arduino/include.cmake
@@ -0,0 +1,12 @@
+if(NOT DEFINED ARDUINO)
+ return()
+endif()
+
+target_compile_definitions(pbdrv-mod PRIVATE PB_TARGET_FREERTOS)
+target_sources(pbdrv-mod PRIVATE "${CMAKE_CURRENT_LIST_DIR}/mod.cpp")
+target_link_arduino_libraries(pbdrv-mod core Wire)
+
+# freertos is used to defer the handling of i2c messages outside the receive
+# interrupt service routine
+include("${CMAKE_CURRENT_LIST_DIR}/../../ext/freertos/include.cmake")
+