]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - quantum/keymap_common.c
Add support for Atreus running on A-Star
[qmk_firmware.git] / quantum / keymap_common.c
index 6cc7adf51fdeb768738457bbc08918290a4eb9b4..7068ca4f3152e78d8d6af5fd4d9b51b7c790ee38 100644 (file)
@@ -26,6 +26,20 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "backlight.h"
 #include "keymap_midi.h"
 
+#include <stdio.h>
+#include <inttypes.h>
+#ifdef AUDIO_ENABLE
+    #include "audio.h"
+
+    float goodbye[][2] = {
+        {440.0*pow(2.0,(67)/12.0), 400},
+        {0, 50},
+        {440.0*pow(2.0,(60)/12.0), 400},
+        {0, 50},
+        {440.0*pow(2.0,(55)/12.0), 600},
+    };
+#endif
+
 static action_t keycode_to_action(uint16_t keycode);
 
 /* converts key to action */
@@ -50,7 +64,7 @@ action_t action_for_key(uint8_t layer, keypos_t key)
        action.code = ACTION_MACRO(keycode & 0xFF);
        return action;
 #ifdef BACKLIGHT_ENABLE
-       } else if (keycode >= BL_0 & keycode <= BL_15) {
+       } else if (keycode >= BL_0 && keycode <= BL_15) {
         action_t action;
         action.code = ACTION_BACKLIGHT_LEVEL(keycode & 0x000F);
         return action;
@@ -73,7 +87,13 @@ action_t action_for_key(uint8_t layer, keypos_t key)
 #endif
     } else if (keycode == RESET) { // RESET is 0x5000, which is why this is here
         clear_keyboard();
+        #ifdef AUDIO_ENABLE
+            play_notes(&goodbye, 5, false);
+        #endif
         _delay_ms(250);
+        #ifdef ATREUS_ASTAR
+            *(uint16_t *)0x0800 = 0x7777; // these two are a-star-specific
+        #endif
         bootloader_jump();
         return;
     } else if (keycode == DEBUG) { // DEBUG is 0x5001