Files @ 75e9d12deff7
Branch filter:

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

Ethan Zonca
Move wifi and cdc to new files
//
// 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"

// User defines from menuconfig
#include "sdkconfig.h"

#include "wifi.h"
#include "usb_cdc.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);


    // Connect to wifi
    wifi_init();



}