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:
@@ -24,6 +24,13 @@ menu "CalendarInk Network Configuration"
|
||||
help
|
||||
Number of times to retry the WiFi connection before failing completely.
|
||||
|
||||
config CALENDINK_BLINK_IP
|
||||
bool "Blink last IP digit on connect"
|
||||
default n
|
||||
help
|
||||
If enabled, the LED will blink the last digit of the IP address
|
||||
acquired to assist in debugging.
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Calendink Web Server"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -58,6 +58,7 @@ internal void set_led_status(led_status status)
|
||||
}
|
||||
led_strip_refresh(led_strip);
|
||||
}
|
||||
#if CONFIG_CALENDINK_BLINK_IP
|
||||
internal void led_blink_number(int n, uint8_t r, uint8_t g, uint8_t b)
|
||||
{
|
||||
if (n <= 0)
|
||||
@@ -85,3 +86,4 @@ internal void led_blink_number(int n, uint8_t r, uint8_t g, uint8_t b)
|
||||
}
|
||||
vTaskDelay(pdMS_TO_TICKS(1000));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -11,8 +11,10 @@
|
||||
#include "freertos/task.h"
|
||||
#include "nvs.h"
|
||||
#include "nvs_flash.h"
|
||||
#include "sdkconfig.h"
|
||||
#include "soc/gpio_num.h"
|
||||
|
||||
|
||||
// Project headers
|
||||
#include "appstate.hpp"
|
||||
#include "types.hpp"
|
||||
|
||||
Reference in New Issue
Block a user