removed the blinking light after connection as it was taking a lot of iteration time.

Made the sidebar icon use the famous burger
This commit is contained in:
2026-03-07 23:55:43 -05:00
parent ac95358561
commit 72e031a99d
6 changed files with 44 additions and 8 deletions

View File

@@ -18,9 +18,11 @@
#include "types.hpp"
// Forward declarations
#if CONFIG_CALENDINK_BLINK_IP
internal esp_err_t get_ip_info(esp_netif_ip_info_t *ip_info);
internal void led_blink_number(int n, uint8_t r, uint8_t g, uint8_t b);
internal void blink_last_ip_octet();
#endif
// Internal states
internal esp_netif_ip_info_t s_current_ip_info = {};
@@ -161,7 +163,9 @@ internal esp_err_t connect_ethernet(bool blockUntilIPAcquired)
{
ESP_LOGI(kLogEthernet, "Waiting for IP address.");
xSemaphoreTake(s_semph_get_ip_addrs, portMAX_DELAY);
#if CONFIG_CALENDINK_BLINK_IP
blink_last_ip_octet();
#endif
}
return ESP_OK;
@@ -205,7 +209,9 @@ internal esp_err_t check_ethernet_connection(uint32_t timeoutSeconds)
if (xSemaphoreTake(s_semph_get_ip_addrs,
pdMS_TO_TICKS(timeoutSeconds * 1000)))
{
#if CONFIG_CALENDINK_BLINK_IP
blink_last_ip_octet();
#endif
return ESP_OK;
}
else
@@ -342,7 +348,9 @@ internal esp_err_t connect_wifi(const char *ssid, const char *password,
{
ESP_LOGI(kLogWifi, "Waiting for IP address.");
xSemaphoreTake(s_semph_get_wifi_ip_addrs, portMAX_DELAY);
#if CONFIG_CALENDINK_BLINK_IP
blink_last_ip_octet();
#endif
}
return ESP_OK;
@@ -390,7 +398,9 @@ internal esp_err_t check_wifi_connection(uint32_t timeoutSeconds)
if (xSemaphoreTake(s_semph_get_wifi_ip_addrs,
pdMS_TO_TICKS(timeoutSeconds * 1000)))
{
#if CONFIG_CALENDINK_BLINK_IP
blink_last_ip_octet();
#endif
return ESP_OK;
}
else
@@ -399,14 +409,13 @@ internal esp_err_t check_wifi_connection(uint32_t timeoutSeconds)
}
}
#if CONFIG_CALENDINK_BLINK_IP
internal esp_err_t get_ip_info(esp_netif_ip_info_t *ip_info)
{
*ip_info = s_current_ip_info;
return ESP_OK;
}
internal void led_blink_number(int n, uint8_t r, uint8_t g, uint8_t b);
internal void blink_last_ip_octet()
{
esp_netif_ip_info_t ip_info;
@@ -431,3 +440,4 @@ internal void blink_last_ip_octet()
led_blink_number(u, 255, 255, 255);
}
}
#endif