main.c 631 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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");
  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 SERIAL_ENABLED
  24. initSerial();
  25. #endif
  26. initDisplayAndSend();
  27. vTaskDelete(NULL);
  28. }