summaryrefslogtreecommitdiff
path: root/fw/esp32/components/eos/app_main.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2025-07-28 23:37:45 +0200
committerUros Majstorovic <majstor@majstor.org>2025-07-28 23:37:45 +0200
commitfc70c6f78f43dbeda91d47b2d2071d4da4082121 (patch)
treec104744b62d3ea2c1a4a05eaab8283f368215300 /fw/esp32/components/eos/app_main.c
parent58f41971b1e801ad2fbcea08e5152afa2b18ca73 (diff)
upgrade to ESP-IDF v5; fixed SPI net and app protocoles; reimplemented power management;
Diffstat (limited to 'fw/esp32/components/eos/app_main.c')
-rw-r--r--fw/esp32/components/eos/app_main.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/fw/esp32/components/eos/app_main.c b/fw/esp32/components/eos/app_main.c
new file mode 100644
index 0000000..e096a23
--- /dev/null
+++ b/fw/esp32/components/eos/app_main.c
@@ -0,0 +1,58 @@
+#include <freertos/FreeRTOS.h>
+#include <freertos/task.h>
+
+#include <driver/gpio.h>
+#include <esp_system.h>
+
+#include <esp_event.h>
+#include <esp_netif.h>
+#include <esp_err.h>
+#include <esp_log.h>
+
+#include "i2c.h"
+#include "cell.h"
+#include "net.h"
+#include "wifi.h"
+#include "sock.h"
+#include "rng.h"
+#include "app.h"
+#include "tun.h"
+#include "power.h"
+
+#define ESP_INTR_FLAG_DEFAULT 0
+
+/* main application */
+void app_main() {
+ esp_err_t ret;
+
+ ret = esp_netif_init();
+ assert(ret == ESP_OK);
+
+ ret = esp_event_loop_create_default();
+ assert(ret == ESP_OK);
+
+ ret = gpio_install_isr_service(ESP_INTR_FLAG_DEFAULT);
+ assert(ret == ESP_OK);
+
+ eos_power_init();
+
+ eos_net_init();
+ eos_app_init();
+ eos_tun_init();
+
+ eos_modem_init();
+ eos_cell_init();
+ eos_cell_pcm_init();
+
+ eos_wifi_init();
+ eos_sock_init();
+ eos_rng_init();
+
+ eos_power_run();
+ eos_net_run();
+ eos_app_run();
+ eos_modem_run();
+ eos_cell_run();
+ eos_wifi_run();
+ eos_sock_run();
+}