summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/eos.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2021-11-17 20:42:47 +0100
committerUros Majstorovic <majstor@majstor.org>2021-11-17 20:42:47 +0100
commitb0e84c72d7a533f62ca750a73445da7fcebe8d18 (patch)
treed091c2307cd667fc9dd1c22e7c80e9ab9ceed445 /fw/fe310/eos/eos.c
parent9d1721008fe1d35abdedbff063ef29d35996124c (diff)
wakeup cause added to init functions
Diffstat (limited to 'fw/fe310/eos/eos.c')
-rw-r--r--fw/fe310/eos/eos.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/fw/fe310/eos/eos.c b/fw/fe310/eos/eos.c
index 929a66f..e394862 100644
--- a/fw/fe310/eos/eos.c
+++ b/fw/fe310/eos/eos.c
@@ -24,31 +24,34 @@ void eos_init(void) {
uint8_t wakeup_cause = eos_power_wakeup_cause();
uint32_t touch_matrix[6] = {0xfa46,0xfffffcf6,0x422fe,0xffffff38,0x10002,0xf3cb0};
int touch_calibrate = 0;
+ int rst = (wakeup_cause == EOS_PWR_WAKE_RST);
printf("WAKE:%d\n", wakeup_cause);
- eos_evtq_init();
- eos_intr_init();
- eos_timer_init();
- eos_i2s_init();
- eos_uart_init();
- eos_spi_init();
- eos_spi_dev_init();
- eos_sdc_init();
- eos_net_init();
- eos_power_init();
- eos_wifi_init();
- eos_cell_init();
- eos_sock_init();
- eos_bq25895_init();
-
- eos_net_start(wakeup_cause);
-
- int rv = eve_init(wakeup_cause == EOS_PWR_WAKE_RST, touch_calibrate, touch_matrix, EVE_GPIO_DIR);
+ eos_evtq_init(wakeup_cause);
+ eos_intr_init(wakeup_cause);
+ eos_timer_init(wakeup_cause);
+ eos_i2s_init(wakeup_cause);
+ eos_uart_init(wakeup_cause);
+ eos_spi_init(wakeup_cause);
+ eos_spi_dev_init(wakeup_cause);
+ eos_sdc_init(wakeup_cause);
+ eos_net_init(wakeup_cause);
+ eos_power_init(wakeup_cause);
+ eos_bq25895_init(wakeup_cause);
+ int rv = eve_init(wakeup_cause, touch_calibrate, touch_matrix, EVE_GPIO_DIR);
printf("EVE INIT: %d\n", rv);
if (touch_calibrate) {
printf("TOUCH MATRIX:\n");
printf("uint32_t touch_matrix[6] = {0x%x,0x%x,0x%x,0x%x,0x%x,0x%x}\n", touch_matrix[0], touch_matrix[1], touch_matrix[2], touch_matrix[3], touch_matrix[4], touch_matrix[5]);
}
+ eos_start(wakeup_cause);
+}
+
+void eos_start(uint8_t wakeup_cause) {
+ eos_wifi_init();
+ eos_cell_init();
+ eos_sock_init();
+ eos_net_start(wakeup_cause);
}