Files
odroid-power-mate/main/app/odroid-power-mate.c
YoungSoo Shin 2dc5798b0a Apply modifications to mass-produced boards
- 3 channel power sensor ina3221
- io expander pca9557
- Some gpio moves
- ...

Signed-off-by: YoungSoo Shin <shinys000114@gmail.com>
2025-09-01 11:56:49 +09:00

40 lines
849 B
C

#include <stdio.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "esp_wifi.h"
#include "esp_event.h"
#include "esp_log.h"
#include "nvs_flash.h"
#include "esp_netif.h"
#include "i2cdev.h"
#include "indicator.h"
#include "nconfig.h"
#include "system.h"
#include "wifi.h"
void app_main(void)
{
ESP_ERROR_CHECK(i2cdev_init());;
init_led();
led_set(LED_BLU, BLINK_TRIPLE);
led_off(LED_BLU);
esp_err_t ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND)
{
ESP_ERROR_CHECK(nvs_flash_erase());
ret = nvs_flash_init();
}
ESP_ERROR_CHECK(ret);
ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK(esp_event_loop_create_default());
ESP_ERROR_CHECK(init_nconfig());
wifi_connect();
sync_time();
start_webserver();
}