feature: alarm
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user