summaryrefslogtreecommitdiff
path: root/code/fe310/eos/eos.c
diff options
context:
space:
mode:
Diffstat (limited to 'code/fe310/eos/eos.c')
-rw-r--r--code/fe310/eos/eos.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/code/fe310/eos/eos.c b/code/fe310/eos/eos.c
index 40b680c..292e3c6 100644
--- a/code/fe310/eos/eos.c
+++ b/code/fe310/eos/eos.c
@@ -1,6 +1,7 @@
#include "event.h"
#include "interrupt.h"
#include "timer.h"
+#include "power.h"
#include "i2s.h"
#include "uart.h"
#include "spi.h"
@@ -12,9 +13,14 @@
#include "eos.h"
-uint32_t touch_transform[6] = {0xfa46,0xfffffcf6,0x422fe,0xffffff38,0x10002,0xf3cb0};
+uint32_t eve_touch[6] = {0xfa46,0xfffffcf6,0x422fe,0xffffff38,0x10002,0xf3cb0};
+
+#include <stdio.h>
void eos_init(void) {
+ uint8_t wake_src = eos_power_cause_wake();
+ printf("WAKE SRC:%d\n", wake_src);
+
eos_evtq_init();
eos_intr_init();
eos_timer_init();
@@ -22,12 +28,17 @@ void eos_init(void) {
eos_uart_init();
eos_spi_init();
eos_net_init();
+ eos_power_init();
eos_wifi_init();
eos_cell_init();
eos_sock_init();
eos_spi_dev_init();
+ int rv = eos_net_wake(wake_src);
+ printf("NET WAKE:%d\n", wake_src);
+
+ eve_set_touch_calibration(eve_touch);
eos_spi_dev_start(EOS_DEV_DISP);
- eve_init(touch_transform);
+ eve_init(wake_src == EOS_PWR_WAKE_RESET);
eos_spi_dev_stop();
}