summaryrefslogtreecommitdiff
path: root/quantum/audio
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/audio')
-rw-r--r--quantum/audio/audio.c5
-rw-r--r--quantum/audio/audio.h10
2 files changed, 11 insertions, 4 deletions
diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c
index ca78a483ad..2570ad9cd1 100644
--- a/quantum/audio/audio.c
+++ b/quantum/audio/audio.c
@@ -18,6 +18,7 @@
#include "eeconfig.h"
#include "timer.h"
#include "wait.h"
+#include "util.h"
/* audio system:
*
@@ -112,6 +113,10 @@ static bool audio_initialized = false;
static bool audio_driver_stopped = true;
audio_config_t audio_config;
+void eeconfig_update_audio_current(void) {
+ eeconfig_update_audio(audio_config.raw);
+}
+
void audio_init(void) {
if (audio_initialized) {
return;
diff --git a/quantum/audio/audio.h b/quantum/audio/audio.h
index fe23cf3ed1..75016a1100 100644
--- a/quantum/audio/audio.h
+++ b/quantum/audio/audio.h
@@ -43,10 +43,7 @@ typedef union {
};
} audio_config_t;
-// AVR/LUFA has a MIN, arm/chibios does not
-#ifndef MIN
-# define MIN(a, b) (((a) < (b)) ? (a) : (b))
-#endif
+_Static_assert(sizeof(audio_config_t) == sizeof(uint8_t), "Audio EECONFIG out of spec.");
/*
* a 'musical note' is represented by pitch and duration; a 'musical tone' adds intensity and timbre
@@ -64,6 +61,11 @@ typedef struct {
// public interface
/**
+ * @brief Save the current choices to the eeprom
+ */
+void eeconfig_update_audio_current(void);
+
+/**
* @brief one-time initialization called by quantum/quantum.c
* @details usually done lazy, when some tones are to be played
*