merged changes

This commit is contained in:
Mikkeli Matlock
2026-02-16 20:55:12 +09:00
parent b33c658885
commit 706c7ac21b
6 changed files with 73 additions and 28 deletions

View File

@@ -245,10 +245,10 @@ static void sensor_task(void *arg)
static void button_task(void *arg)
{
for (;;) {
/* Wait for GP18 button event (single click = bit 0) */
/* Wait for GP18 button event (single click = bit 0, long press = bit 2) */
EventBits_t bits = xEventGroupWaitBits(
GP18ButtonGroups,
set_bit_button(0), /* single press bit */
set_bit_button(0) | set_bit_button(2),
pdTRUE, /* clear on exit */
pdFALSE, /* any bit */
pdMS_TO_TICKS(500)
@@ -257,7 +257,12 @@ static void button_task(void *arg)
if (bits & set_bit_button(0)) {
bool muted = !alert_is_muted();
alert_mute(muted);
ESP_LOGI(TAG, "GP18 pressed: alerts %s", muted ? "muted" : "unmuted");
ESP_LOGI(TAG, "GP18 single press: alerts %s", muted ? "muted" : "unmuted");
}
if (bits & set_bit_button(2)) {
ESP_LOGI(TAG, "GP18 long press: forcing WS reconnect");
ws_client_reconnect();
}
}
}