123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #include <stdio.h>
- #include "sdkconfig.h"
- #include "freertos/FreeRTOS.h"
- #include "freertos/task.h"
- #include "esp_system.h"
- #include "esp_spi_flash.h"
- #include "freertos/queue.h"
- #include "esp_attr.h"
- #include "esp_log.h"
- #include "config.h"
- #include "wifi.h"
- #include "serial.h"
- #include "displayAndSend.h"
- #include "pcnt_functions.h"
- // Chip info:
- // This is esp32 chip with 2 CPU cores, WiFi/BT/BLE, silicon revision 1, 4MB external flash
- void app_main(void)
- {
- ESP_LOGI("MAIN", "HomeEnergyMeter ESP32");
- #ifdef WIFI_ENABLED
- initWifi(); // Init WIFI
- #endif
- #ifdef MQTT_ENABLED
- mqtt_init();
- #endif
- #ifdef CCFG_PCNT
- initPCNT();
- #endif
- #ifdef SERIAL_ENABLED
- initSerial();
- #endif
- initDisplayAndSend();
- vTaskDelete(NULL);
- }
|