diff -r c18d2951e8d7 -r 34da2d2b12d5 main/config.h --- a/main/config.h Tue Sep 26 14:59:06 2023 +0200 +++ b/main/config.h Tue Sep 26 15:10:25 2023 +0200 @@ -4,8 +4,8 @@ * spiffs filesystem in a flash partition. */ -#ifndef _CONFIG_H -#define _CONFIG_H +#ifndef _G_CONFIG_H +#define _G_CONFIG_H // Global includes for the project @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -25,21 +26,25 @@ #include "freertos/event_groups.h" #include "freertos/queue.h" #include "driver/gpio.h" -#include "driver/adc.h" #include "driver/rtc_io.h" #include "soc/sens_periph.h" #include "soc/rtc.h" -#include "esp_adc_cal.h" +#include "esp_adc/adc_oneshot.h" +#include "esp_adc/adc_cali.h" +#include "esp_adc/adc_cali_scheme.h" #include "esp_log.h" #include "esp_spiffs.h" #include "esp_vfs.h" #include "esp_system.h" +#include "esp_chip_info.h" +#include "esp_mac.h" #include "esp_wifi.h" #include "esp_wpa2.h" #include "esp_event.h" -#include "esp_spi_flash.h" +#include "esp_timer.h" #include "esp_ota_ops.h" #include "esp_http_client.h" +#include "esp_app_format.h" #include "nvs_flash.h" #include "lwip/sockets.h" #include "lwip/dns.h" @@ -115,7 +120,7 @@ /** * @brief Global configuration. File /spiffs/config.conf */ -struct strConfig { +typedef struct { uint8_t Version; ///< Record version number for updates. char ntp_server[32]; ///< Preffered NTP server. char hostname[32]; ///< Our hostname. @@ -125,7 +130,7 @@ uint16_t mqtt_port; ///< MQTT TCP port. char mqtt_user[32]; ///< MQTT user name if needed. char mqtt_pwd[62]; ///< MQTT password. -} config; ///< Config record. +} strConfig_t; ///< Config record. /** @@ -144,11 +149,12 @@ /** * @brief Records with WiFi stations we have succesfully connected. */ -struct strStations { +typedef struct { char SSID[32]; ///< Station SSID char Password[64]; ///< Station password bool xhide; ///< Hide from AP scan. -} wifiStation; ///< Station record. +} wifiStation_t; ///< Station record. + /** * @brief Add a new station record. @@ -176,7 +182,7 @@ /** * @brief Records that describes the carbonation units, */ -typedef struct strUnit { +typedef struct { char uuid[37]; ///< Unit uuid char alias[33]; ///< Alias name 'unit1' int temperature_state; ///< Reading status