/* WiFi station Example This example code is in the Public Domain (or CC0 licensed, at your option.) Unless required by applicable law or agreed to in writing, this software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ #include #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/event_groups.h" #include "esp_system.h" #include "esp_wifi.h" #include "esp_event.h" #include "esp_log.h" #include "nvs_flash.h" #include "driver/ledc.h" #include "lwip/err.h" #include "lwip/sys.h" #include "adc_measure.h" #include "servo.h" #include "wifi_station.h" static const char *TAG = "wheel"; extern void can_init(void); extern void ModBusTCPSlave_init(void); extern void lis3dsh_fifo_stream(void); extern void bdc_control_main(void); extern void bdc_motor_init_all(void); extern void twai_init(void); void app_main(void) { // 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); wifi_init_sta(); ModBusTCPSlave_init(); twai_init(); bdc_motor_init_all(); servo_ledc_init(); // adc_measure_init(); while (1) { vTaskDelay(pdMS_TO_TICKS(100)); } }