Fix #1465 - rename LL_* constants, introduce MG_* log macros

This commit is contained in:
Sergey Lyubka committed 2022-02-12 18:17:25 +00:00
1 parent da72dafbfb
commit 969b84043c
40 files changed
+361 -372

No files matched your search

+6 -6
View File
@@ -33,14 +33,14 @@ static void event_handler(void *arg, esp_event_base_t event_base,
if (s_retry_num < 3) {
esp_wifi_connect();
s_retry_num++;
LOG(LL_DEBUG, ("retry to connect to the AP"));
MG_DEBUG(("retry to connect to the AP"));
} else {
xEventGroupSetBits(s_wifi_event_group, WIFI_FAIL_BIT);
}
LOG(LL_ERROR, ("connect to the AP fail"));
MG_ERROR(("connect to the AP fail"));
} else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) {
ip_event_got_ip_t *event = (ip_event_got_ip_t *) event_data;
LOG(LL_INFO, ("got ip:%s", ip4addr_ntoa(&event->ip_info.ip)));
MG_INFO(("got ip:%s", ip4addr_ntoa(&event->ip_info.ip)));
s_retry_num = 0;
xEventGroupSetBits(s_wifi_event_group, WIFI_CONNECTED_BIT);
}
@@ -71,11 +71,11 @@ void wifi_init(const char *ssid, const char *pass) {
pdFALSE, pdFALSE, portMAX_DELAY);
if (bits & WIFI_CONNECTED_BIT) {
LOG(LL_INFO, ("connected to ap SSID:%s password:%s", ssid, pass));
MG_INFO(("connected to ap SSID:%s password:%s", ssid, pass));
} else if (bits & WIFI_FAIL_BIT) {
LOG(LL_ERROR, ("Failed to connect to SSID:%s, password:%s", ssid, pass));
MG_ERROR(("Failed to connect to SSID:%s, password:%s", ssid, pass));
} else {
LOG(LL_ERROR, ("UNEXPECTED EVENT"));
MG_ERROR(("UNEXPECTED EVENT"));
}
ESP_ERROR_CHECK(esp_event_handler_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP,