main.c 704 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #include "freertos/FreeRTOS.h"
  2. #include "freertos/task.h"
  3. #include "esp_log.h"
  4. #include "config.h"
  5. #include "wifi.h"
  6. #include "serial.h"
  7. #include "displayAndSend.h"
  8. #include "pcnt_functions.h"
  9. // Chip info:
  10. // This is esp32 chip with 2 CPU cores, WiFi/BT/BLE, silicon revision 1, 4MB external flash
  11. void app_main(void)
  12. {
  13. ESP_LOGI("MAIN", "HomeEnergyMeter ESP32. Core:%d",xPortGetCoreID());
  14. #ifdef WIFI_ENABLED
  15. initWifi(); // Init WIFI
  16. #endif
  17. #ifdef MQTT_ENABLED
  18. mqtt_init();
  19. #endif
  20. #ifdef CCFG_PCNT
  21. initPCNT();
  22. #endif
  23. #ifdef CCFG_GEN_PULSE
  24. ledc_init();
  25. #endif
  26. #ifdef SERIAL_ENABLED
  27. initSerial();
  28. #endif
  29. initDisplayAndSend();
  30. vTaskDelete(NULL);
  31. }