diff --git a/Kconfig b/Kconfig index 64ccf3a8..27f9fb3c 100644 --- a/Kconfig +++ b/Kconfig @@ -26,4 +26,8 @@ config ARDUINO_API_SERIAL_BUFFER_SIZE int "Buffer size for Arduino Serial API" default 64 +config ARDUINO_ENTRY + bool "Provide arduino setup and loop entry points" + default y + endif diff --git a/cores/arduino/CMakeLists.txt b/cores/arduino/CMakeLists.txt index b3b1af15..193fd3c1 100644 --- a/cores/arduino/CMakeLists.txt +++ b/cores/arduino/CMakeLists.txt @@ -7,7 +7,10 @@ if(NOT DEFINED ARDUINO_BUILD_PATH) zephyr_sources(zephyrPrint.cpp) zephyr_sources(zephyrSerial.cpp) zephyr_sources(zephyrCommon.cpp) + +if(DEFINED CONFIG_ARDUINO_ENTRY) zephyr_sources(main.cpp) +endif() endif()