Files @ e4270e6d9529
Branch filter:

Location: protofusion-esp32-template/main/main.c

Ethan Zonca
Clean up LED strip implementation, add single LED chase
//
// Protofusion ESP32S3 Template
//

#include <stdint.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "esp_system.h"
#include "esp_event.h"
#include "esp_log.h"
#include "nvs_flash.h"
#include "sdkconfig.h"
#include "osc_control.h"
#include "wifi.h"
// #include "usb_cdc.h"
#include "can.h"
#include "display.h"
#include "ledstrip.h"
#include "display_gui.h"


// Private variables
static const char *TAG = "main";


// Application entry point
void app_main(void)
{
    // Initialize usb-cdc interface
    // usb_cdc_init();

    // Initialize NVS
    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);

    // Initialize display
    display_init();
    display_gui_homescreen();

    // Connect to wifi
    wifi_init();

    ledstrip_init();


    // Initialize OSC
    osc_init();


    // Initialize canbus
    //can_init();


    while(1)
    {
        display_gui_process();
        ledstrip_refresh();
        vTaskDelay(pdMS_TO_TICKS(10));
    }

}