summaryrefslogtreecommitdiff
path: root/src/arch/esp8266
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2020-08-28 15:25:37 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2020-08-28 15:25:37 +0200
commit3a66ae51c3f34108428e582ef693866d71496d16 (patch)
tree6a8ab3774af1b1077720671a92f40a92d5425bcf /src/arch/esp8266
parente12d6d528705344628568000dc2fddb919457411 (diff)
Expose configuration via Kconfig
Diffstat (limited to 'src/arch/esp8266')
-rw-r--r--src/arch/esp8266/Kconfig11
-rw-r--r--src/arch/esp8266/Makefile.inc27
-rw-r--r--src/arch/esp8266/prompt1
3 files changed, 36 insertions, 3 deletions
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