From 3a66ae51c3f34108428e582ef693866d71496d16 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 28 Aug 2020 15:25:37 +0200 Subject: Expose configuration via Kconfig --- src/arch/esp8266/Kconfig | 11 +++++++++++ src/arch/esp8266/Makefile.inc | 27 ++++++++++++++++++++++++--- src/arch/esp8266/prompt | 1 + 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 src/arch/esp8266/Kconfig create mode 100644 src/arch/esp8266/prompt (limited to 'src/arch/esp8266') diff --git a/src/arch/esp8266/Kconfig b/src/arch/esp8266/Kconfig new file mode 100644 index 0000000..5542dd5 --- /dev/null +++ b/src/arch/esp8266/Kconfig @@ -0,0 +1,11 @@ +config arch_esp8266_driver_counter +bool "Cycle Counter" +select meta_driver_counter + +config arch_esp8266_driver_stdin +bool "UART Input" +select meta_driver_stdin + +config arch_esp8266_driver_uptime +bool "Uptime Counter" +select meta_driver_uptime diff --git a/src/arch/esp8266/Makefile.inc b/src/arch/esp8266/Makefile.inc index c1bb621..44a3cd7 100644 --- a/src/arch/esp8266/Makefile.inc +++ b/src/arch/esp8266/Makefile.inc @@ -22,7 +22,7 @@ CXXFLAGS = -std=c++11 -fno-rtti -fno-threadsafe-statics LDFLAGS += -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static CXX_TARGETS += src/arch/esp8266/arch.cc src/arch/esp8266/driver/gpio.cc -CXX_TARGETS += src/arch/esp8266/driver/stdout.cc src/arch/esp8266/driver/uptime.cc +CXX_TARGETS += src/arch/esp8266/driver/stdout.cc OBJECTS = ${CXX_TARGETS:.cc=.o} ${C_TARGETS:.c=.o} @@ -30,14 +30,35 @@ ifeq (${esp8266_led2}, 1) COMMON_FLAGS += -DLED_ON_GPIO16 endif +# Commandline + +ifneq ($(findstring counter,${arch_drivers}), ) + CONFIG_arch_esp8266_driver_counter = y +endif + ifneq ($(findstring stdin,${arch_drivers}), ) - CXX_TARGETS += src/arch/esp8266/driver/stdin.cc + CONFIG_arch_esp8266_driver_stdin = y endif -ifneq ($(findstring counter,${arch_drivers}), ) +ifeq (${timer_s}, 1) + CONFIG_arch_esp8266_driver_uptime = y +endif + +# Kconfig + +ifdef CONFIG_arch_esp8266_driver_counter CXX_TARGETS += src/arch/esp8266/driver/counter.cc endif +ifdef CONFIG_arch_esp8266_driver_stdin + CXX_TARGETS += src/arch/esp8266/driver/stdin.cc +endif + +ifdef CONFIG_arch_esp8266_driver_uptime + COMMON_FLAGS += -DTIMER_S + CXX_TARGETS += src/arch/esp8266/driver/uptime.cc +endif + .cc.o: ${QUIET}${CXX} ${INCLUDES} ${COMMON_FLAGS} ${CXXFLAGS} -c -o $@ ${@:.o=.cc} ${QUIET}${OBJCOPY} --rename-section .text=.irom0.text --rename-section .literal=.irom0.literal $@ diff --git a/src/arch/esp8266/prompt b/src/arch/esp8266/prompt new file mode 100644 index 0000000..3428bc3 --- /dev/null +++ b/src/arch/esp8266/prompt @@ -0,0 +1 @@ +ESP8266 -- cgit v1.2.3