From dcf21364774daa9d9308592afa02884504fa6ca2 Mon Sep 17 00:00:00 2001 From: Dhruva Gole Date: Wed, 14 Sep 2022 20:43:39 +0530 Subject: [PATCH 1/3] Kconfig: Update to use imply and rid module.conf * Kconfig now has all the deps enabled so we can get rid of the hacky module.conf * deletes module.conf from all CMakelists as it will no longer be used Signed-off-by: Dhruva Gole --- Kconfig | 8 +++++++- module.conf | 8 -------- samples/blinky_arduino/CMakeLists.txt | 1 - samples/button_press_led/CMakeLists.txt | 1 - samples/hello_arduino/CMakeLists.txt | 1 - samples/i2cdemo/CMakeLists.txt | 1 - 6 files changed, 7 insertions(+), 13 deletions(-) delete mode 100644 module.conf diff --git a/Kconfig b/Kconfig index 592146ab..e740512f 100644 --- a/Kconfig +++ b/Kconfig @@ -6,7 +6,13 @@ config ARDUINO_API bool "ARDUINO_API" - depends on CPLUSPLUS + imply CPLUSPLUS + imply GPIO + imply CPLUSPLUS + imply I2C + imply NEWLIB_LIBC_FLOAT_PRINTF + imply CBPRINTF_FP_SUPPORT + imply RING_BUFFER default n if ARDUINO_API diff --git a/module.conf b/module.conf deleted file mode 100644 index fef1844c..00000000 --- a/module.conf +++ /dev/null @@ -1,8 +0,0 @@ -CONFIG_GPIO=y -CONFIG_CPLUSPLUS=y -CONFIG_ARDUINO_API=y -CONFIG_I2C=y -CONFIG_NEWLIB_LIBC=y -CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y -CONFIG_CBPRINTF_FP_SUPPORT=y -CONFIG_RING_BUFFER=y \ No newline at end of file diff --git a/samples/blinky_arduino/CMakeLists.txt b/samples/blinky_arduino/CMakeLists.txt index e58c3b58..58cf0b3b 100644 --- a/samples/blinky_arduino/CMakeLists.txt +++ b/samples/blinky_arduino/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.20.0) -set(CONF_FILE $ENV{ZEPHYR_BASE}/../modules/lib/Arduino-Zephyr-API/module.conf) set(DTC_OVERLAY_FILE $ENV{ZEPHYR_BASE}/../modules/lib/Arduino-Zephyr-API/variants/${BOARD}/${BOARD}.overlay) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/samples/button_press_led/CMakeLists.txt b/samples/button_press_led/CMakeLists.txt index e58c3b58..58cf0b3b 100644 --- a/samples/button_press_led/CMakeLists.txt +++ b/samples/button_press_led/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.20.0) -set(CONF_FILE $ENV{ZEPHYR_BASE}/../modules/lib/Arduino-Zephyr-API/module.conf) set(DTC_OVERLAY_FILE $ENV{ZEPHYR_BASE}/../modules/lib/Arduino-Zephyr-API/variants/${BOARD}/${BOARD}.overlay) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/samples/hello_arduino/CMakeLists.txt b/samples/hello_arduino/CMakeLists.txt index bc8ef8af..72fb0743 100644 --- a/samples/hello_arduino/CMakeLists.txt +++ b/samples/hello_arduino/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.20.0) -set(CONF_FILE $ENV{ZEPHYR_BASE}/../modules/lib/Arduino-Zephyr-API/module.conf) set(DTC_OVERLAY_FILE $ENV{ZEPHYR_BASE}/../modules/lib/Arduino-Zephyr-API/variants/${BOARD}/${BOARD}.overlay) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/samples/i2cdemo/CMakeLists.txt b/samples/i2cdemo/CMakeLists.txt index 408bdd6c..664bc247 100644 --- a/samples/i2cdemo/CMakeLists.txt +++ b/samples/i2cdemo/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.20.0) -set(CONF_FILE $ENV{ZEPHYR_BASE}/../modules/lib/Arduino-Zephyr-API/module.conf) set(DTC_OVERLAY_FILE $ENV{ZEPHYR_BASE}/../modules/lib/Arduino-Zephyr-API/variants/${BOARD}/${BOARD}.overlay) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) From e291a92d8b250d786c4550492cea082cdc4c8a81 Mon Sep 17 00:00:00 2001 From: Dhruva Gole Date: Wed, 14 Sep 2022 21:01:47 +0530 Subject: [PATCH 2/3] Kconfig: Update copyright and debloat * Updates copyright because the file is now almost completely different from original KConfig made by Toita, Horishi. * Deletes all unused options Signed-off-by: Dhruva Gole --- Kconfig | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/Kconfig b/Kconfig index e740512f..61c43ecf 100644 --- a/Kconfig +++ b/Kconfig @@ -1,5 +1,5 @@ # -# Copyright (c) 2020 Toita, Hiroshi +# Copyright (c) 2022 Dhruva Gole # # SPDX-License-Identifier: Apache-2.0 # @@ -17,26 +17,6 @@ config ARDUINO_API if ARDUINO_API -config ARDUINO_MAIN_LOOP - bool "ARDUINO_MAIN_LOOP" - default n - -config ARDUINO_GPIO - bool "ARDUINO_API" - depends on GPIO - default y - -config ARDUINO_QUERY_PIN_CONFIG - bool - depends on ARDUINO_GPIO - default n - -config ARDUINO_UART - bool "ARDUINO_API" - depends on SERIAL - depends on UART_INTERRUPT_DRIVEN - default y - config QEMU_ICOUNT bool "QEMU icount mode" default n From 67b622da1c88b56eefc0e56a71d6330c3b8a57ce Mon Sep 17 00:00:00 2001 From: Dhruva Gole Date: Wed, 14 Sep 2022 22:11:42 +0530 Subject: [PATCH 3/3] CMakelists: conditionally add subdir if ARDUINO en * Conditionally include sub directories specific to the ARDUINO_API module in CMAkelists * Solve https://github.com/zephyrproject-rtos/gsoc-2022-arduino-core/issues/46 Signed-off-by: Dhruva Gole --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fdaa39a..1931cfc2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,8 @@ # SPDX-License-Identifier: Apache-2.0 +if (CONFIG_ARDUINO_API) add_subdirectory(cores) add_subdirectory(variants) add_subdirectory(libraries) +endif() +