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

@@ -19,7 +19,11 @@
onclick={() => collapsed = !collapsed} onclick={() => collapsed = !collapsed}
title={collapsed ? 'Expand' : 'Collapse'} title={collapsed ? 'Expand' : 'Collapse'}
> >
{collapsed ? '▶' : '◀'} <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</button> </button>
</div> </div>
@@ -55,6 +59,10 @@
width: 56px; width: 56px;
} }
.sidebar.collapsed .sidebar-header {
justify-content: center;
}
.sidebar-header { .sidebar-header {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -79,13 +87,20 @@
border: none; border: none;
color: var(--color-text-secondary); color: var(--color-text-secondary);
cursor: pointer; cursor: pointer;
padding: 4px; padding: 6px;
font-size: 10px; display: flex;
border-radius: 4px; align-items: center;
transition: color 0.15s, background 0.15s; justify-content: center;
border-radius: 6px;
transition: all 0.2s;
flex-shrink: 0; flex-shrink: 0;
} }
.collapse-btn svg {
width: 18px;
height: 18px;
}
.collapse-btn:hover { .collapse-btn:hover {
color: var(--color-text-primary); color: var(--color-text-primary);
background: var(--color-bg-card-hover); background: var(--color-bg-card-hover);

View File

@@ -1,5 +1,5 @@
{ {
"major": 0, "major": 0,
"minor": 1, "minor": 1,
"revision": 13 "revision": 14
} }

View File

@@ -24,6 +24,13 @@ menu "CalendarInk Network Configuration"
help help
Number of times to retry the WiFi connection before failing completely. 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 endmenu
menu "Calendink Web Server" menu "Calendink Web Server"

View File

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

View File

@@ -58,6 +58,7 @@ internal void set_led_status(led_status status)
} }
led_strip_refresh(led_strip); 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) internal void led_blink_number(int n, uint8_t r, uint8_t g, uint8_t b)
{ {
if (n <= 0) 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)); vTaskDelay(pdMS_TO_TICKS(1000));
} }
#endif

View File

@@ -11,8 +11,10 @@
#include "freertos/task.h" #include "freertos/task.h"
#include "nvs.h" #include "nvs.h"
#include "nvs_flash.h" #include "nvs_flash.h"
#include "sdkconfig.h"
#include "soc/gpio_num.h" #include "soc/gpio_num.h"
// Project headers // Project headers
#include "appstate.hpp" #include "appstate.hpp"
#include "types.hpp" #include "types.hpp"