summaryrefslogtreecommitdiffstats
path: root/quantum/audio/audio.c
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2017-07-21 05:57:11 +0200
committerJack Humbert <jack.humb@gmail.com>2017-07-23 20:59:29 +0200
commit6a3c66776cb10888b24400526241b46deeb051a8 (patch)
tree7604aafe7087d9ab40aa0bb6bc603975e31d7e2e /quantum/audio/audio.c
parent8edb67b08242f2ab641d7e658a0a7adb579bbae2 (diff)
downloadqmk_firmware-6a3c66776cb10888b24400526241b46deeb051a8.tar.gz
qmk_firmware-6a3c66776cb10888b24400526241b46deeb051a8.tar.xz
clean-up planck and preonic keymaps, move audio stuff around
Diffstat (limited to 'quantum/audio/audio.c')
-rw-r--r--quantum/audio/audio.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c
index c924f2bd5..5b8563093 100644
--- a/quantum/audio/audio.c
+++ b/quantum/audio/audio.c
@@ -13,6 +13,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
#include <stdio.h>
#include <string.h>
//#include <math.h>
@@ -119,9 +120,17 @@ audio_config_t audio_config;
uint16_t envelope_index = 0;
bool glissando = true;
+#ifndef STARTUP_SONG
+ #define STARTUP_SONG SONG(STARTUP_SOUND)
+#endif
+float startup_song[][2] = STARTUP_SONG;
+
void audio_init()
{
+ if (audio_initialized)
+ return;
+
// Check EEPROM
if (!eeconfig_is_enabled())
{
@@ -169,6 +178,11 @@ void audio_init()
#endif
audio_initialized = true;
+
+ if (audio_config.enable) {
+ PLAY_NOTE_ARRAY(startup_song, false, LEGATO);
+ }
+
}
void stop_all_notes()