summaryrefslogtreecommitdiff
path: root/src/arch/esp8266
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2017-12-11 10:28:25 +0100
committerDaniel Friesel <derf@finalrewind.org>2017-12-11 10:28:25 +0100
commit2253c912c86b5196e17657ee067abfc7afa4d652 (patch)
treec10d2722e0c44355bded196209bfba6d5827d06c /src/arch/esp8266
parent540974f8f109aa8874f032eddf59819c76eb018e (diff)
Add basic uptime getter, improve loop support
Diffstat (limited to 'src/arch/esp8266')
-rw-r--r--src/arch/esp8266/Makefile.inc2
-rw-r--r--src/arch/esp8266/driver/uptime.cc12
2 files changed, 13 insertions, 1 deletions
diff --git a/src/arch/esp8266/Makefile.inc b/src/arch/esp8266/Makefile.inc
index 9a08678..3b1c8cb 100644
--- a/src/arch/esp8266/Makefile.inc
+++ b/src/arch/esp8266/Makefile.inc
@@ -17,7 +17,7 @@ CXXFLAGS = -std=c++11
LDFLAGS += -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static
TARGETS += src/arch/esp8266/arch.cc src/arch/esp8266/driver/gpio.cc
-TARGETS += src/arch/esp8266/driver/stdout.cc
+TARGETS += src/arch/esp8266/driver/stdout.cc src/arch/esp8266/driver/uptime.cc
OBJECTS = ${TARGETS:.cc=.o}
diff --git a/src/arch/esp8266/driver/uptime.cc b/src/arch/esp8266/driver/uptime.cc
new file mode 100644
index 0000000..51cc617
--- /dev/null
+++ b/src/arch/esp8266/driver/uptime.cc
@@ -0,0 +1,12 @@
+#include "driver/uptime.h"
+extern "C" {
+#include "osapi.h"
+#include "user_interface.h"
+}
+
+uint32_t Uptime::get()
+{
+ return system_get_time();
+}
+
+Uptime uptime;