diff options
Diffstat (limited to 'main/app_main.c')
| -rw-r--r-- | main/app_main.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/main/app_main.c b/main/app_main.c index 3c30497..8b91537 100644 --- a/main/app_main.c +++ b/main/app_main.c @@ -1,7 +1,9 @@ -#include <esp_log.h> -#include <esp_event.h> -#include <esp_netif.h> -#include <nvs_flash.h> +#include "net_eth.h" + +#include "esp_event.h" +#include "esp_log.h" +#include "esp_netif.h" +#include "nvs_flash.h" static const char *TAG = "viewport"; @@ -13,10 +15,19 @@ void app_main(void) ESP_LOGI(TAG, "Scrypted Viewport boot"); - // TODO: Ethernet (ESP32-P4 EMAC + Waveshare PoE PHY) - // TODO: mDNS _scrypted-viewport._tcp.local - // TODO: HTTP server: /state /config /frame - // TODO: MIPI-DSI panel init (800x480 IPS, default portrait 480x800) - // TODO: JPEG decode -> framebuffer - // TODO: Capacitive touch -> outbound /state POST + ESP_ERROR_CHECK(net_eth_init()); + if (net_eth_wait_for_ip(30 * 1000) == ESP_OK) { + ESP_LOGI(TAG, "online at %s", net_eth_get_ip_str()); + } else { + ESP_LOGW(TAG, "no DHCP lease after 30s, will keep retrying in the background"); + } + + // TODO M2: mDNS _scrypted-viewport._tcp.local + // TODO M2: HTTP server: GET /state + // TODO M3: MIPI-DSI panel init (800x480 IPS, default portrait 480x800) + // TODO M4: /config persistence (NVS) + // TODO M5: /frame JPEG decode -> framebuffer + // TODO M6: /state POST + idle timer + // TODO M7: Capacitive touch -> outbound /state POST + // TODO M8: Local screens (IP, loading) + BOOT button } |
