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}
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>
</div>
@@ -55,6 +59,10 @@
width: 56px;
}
.sidebar.collapsed .sidebar-header {
justify-content: center;
}
.sidebar-header {
display: flex;
align-items: center;
@@ -79,13 +87,20 @@
border: none;
color: var(--color-text-secondary);
cursor: pointer;
padding: 4px;
font-size: 10px;
border-radius: 4px;
transition: color 0.15s, background 0.15s;
padding: 6px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 6px;
transition: all 0.2s;
flex-shrink: 0;
}
.collapse-btn svg {
width: 18px;
height: 18px;
}
.collapse-btn:hover {
color: var(--color-text-primary);
background: var(--color-bg-card-hover);

View File

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

View File

@@ -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"

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

View File

@@ -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

View File

@@ -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"