feature: alarm

This commit is contained in:
Mikkeli Matlock
2026-02-15 21:11:33 +09:00
parent 12dbbd8942
commit dca989a01b
14 changed files with 543 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
#include "alert.h"
#include "audio_client.h"
#include "codec_bsp.h"
#include "i2c_bsp.h"
#include <esp_log.h>
@@ -84,6 +85,7 @@ void alert_trigger(alert_type_t type)
if (type >= ALERT_TYPE_COUNT) return;
if (s_muted) return;
if (!s_tone_buf || !s_codec) return;
if (audio_client_get_state() == AUDIO_PLAYING) return; /* don't fight over codec */
if (xSemaphoreTake(s_alert_mutex, pdMS_TO_TICKS(50)) != pdTRUE) return;