merged changes
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user