]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
changes to play_notes, goodbye
authorJack Humbert <jack.humb@gmail.com>
Sun, 17 Apr 2016 03:07:50 +0000 (23:07 -0400)
committerJack Humbert <jack.humb@gmail.com>
Sun, 17 Apr 2016 03:07:50 +0000 (23:07 -0400)
keyboard/planck/keymaps/default/keymap.c
keyboard/preonic/Makefile
keyboard/preonic/config.h
keyboard/preonic/keymaps/default/keymap.c
quantum/audio.c
quantum/keymap_common.c

index a6edefefd9d7c12bb9592d8dedbe0b93a386103b..5591b337dd1588941b750efb87532376e31dce7e 100644 (file)
@@ -194,7 +194,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
         case _QW:
           if (record->event.pressed) {
             #ifdef AUDIO_ENABLE
-              play_notes(&tone_qw, 4, false, 0);
+              play_notes(&tone_qw, false, 0);
             #endif
             default_layer_set(1UL<<_QW);
           }
@@ -202,7 +202,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
         case _CM:
           if (record->event.pressed) {
             #ifdef AUDIO_ENABLE
-              play_notes(&tone_cm, 6, false, 0);
+              play_notes(&tone_cm, false, 0);
             #endif
             default_layer_set(1UL<<_CM);
           }
@@ -210,7 +210,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
         case _DV:
           if (record->event.pressed) {
             #ifdef AUDIO_ENABLE
-              play_notes(&tone_dv, 8, false, 0);
+              play_notes(&tone_dv, false, 0);
             #endif
             default_layer_set(1UL<<_DV);
           }
@@ -254,7 +254,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
           if (record->event.pressed) {
             #ifdef AUDIO_ENABLE
               audio_on();
-              play_notes(&start_up, 5, false, 0);
+              play_notes(&start_up, false, 0);
             #endif
           }
         break;
@@ -265,6 +265,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
 void matrix_init_user(void) {
   #ifdef AUDIO_ENABLE
     init_notes();
-    play_notes(&start_up, 5, false, 0);
+    play_notes(&start_up, false, 0);
   #endif
 }
index 9199968c3d4b88d4d49b24482a9101840a6bb19a..3504e27201b7c021dd57fda1404016b45662ee96 100644 (file)
@@ -133,7 +133,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
 BOOTMAGIC_ENABLE = no       # Virtual DIP switch configuration(+1000)
 MOUSEKEY_ENABLE = yes       # Mouse keys(+4700)
 EXTRAKEY_ENABLE = yes       # Audio control and System control(+450)
-CONSOLE_ENABLE = yes        # Console for debug(+400)
+CONSOLE_ENABLE = no        # Console for debug(+400)
 COMMAND_ENABLE = yes        # Commands for debug and configuration
 NKRO_ENABLE = no            # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
 BACKLIGHT_ENABLE = yes      # Enable keyboard backlight functionality
index 5528667fa726187d1743571b4b343476a71cfcb7..bb9d29dab771309978ac5e3208dc943b9abd3bf1 100644 (file)
@@ -73,10 +73,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 /* disable debug print */
-#define NO_DEBUG
+// #define NO_DEBUG
 
 /* disable print */
-#define NO_PRINT
+// #define NO_PRINT
 
 /* disable action features */
 //#define NO_ACTION_LAYER
index 1223793cfa0f88fbe1bafc5944173d85eb2322ac..c7b6b89f2c91be2e0e8dba0c20b117ef53a19e2b 100644 (file)
@@ -242,7 +242,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
         case _QWERTY:
           if (record->event.pressed) {
             #ifdef AUDIO_ENABLE
-              play_notes(&tone_qwerty, 4, false, 0);
+              play_notes(&tone_qwerty, false, 0);
             #endif
             persistant_default_layer_set(1UL<<_QWERTY);
           }
@@ -250,7 +250,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
         case _COLEMAK:
           if (record->event.pressed) {
             #ifdef AUDIO_ENABLE
-              play_notes(&tone_colemak, 6, false, 1);
+              play_notes(&tone_colemak, false, 0);
             #endif
             persistant_default_layer_set(1UL<<_COLEMAK);
           }
@@ -258,7 +258,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
         case _DVORAK:
           if (record->event.pressed) {
             #ifdef AUDIO_ENABLE
-              play_notes(&tone_dvorak, 8, false, 10);
+              play_notes(&tone_dvorak, false, 0);
             #endif
             persistant_default_layer_set(1UL<<_DVORAK);
           }
@@ -302,7 +302,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
           if (record->event.pressed) {
             #ifdef AUDIO_ENABLE
               audio_on();
-              play_notes(&start_up, 4, false, 0);
+              play_notes(&start_up, false, 0);
             #endif
           }
         break;
@@ -317,7 +317,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
         case 9:
           if (record->event.pressed) {
             #ifdef AUDIO_ENABLE
-              play_notes(&tone_music, 8, false, 0);
+              play_notes(&tone_music, false, 0);
               layer_on(_MUSIC);
             #endif
           }
@@ -344,6 +344,6 @@ void process_action_user(keyrecord_t *record) {
 void matrix_init_user(void) {
   #ifdef AUDIO_ENABLE
     init_notes();
-    play_notes(&start_up, 4, false, 0);
+    play_notes(&start_up, false, 0);
   #endif
 }
index 40d09d62fd7257fd6423dcf69de6f67f6c4a3b4c..773edfd8eedf6fbe9bd9d6e5580e65790f98becb 100644 (file)
@@ -318,7 +318,7 @@ ISR(TIMER3_COMPA_vect) {
                     return;
                 }
             }
-            if (!note_resting && ((int)notes_rest != 0)) {
+            if (!note_resting && (notes_rest > 0)) {
                 note_resting = true;
                 note_frequency = 0;
                 note_length = notes_rest;
index 457f70a448aaa3426f6ed2fe49c424eaffbde3d2..8f35521a2d2b4b9d934be64fb2f7f1fc641a13b6 100644 (file)
@@ -33,12 +33,14 @@ extern keymap_config_t keymap_config;
 #include <inttypes.h>
 #ifdef AUDIO_ENABLE
     #include "audio.h"
-
-    float goodbye[][2] = {
-        {440.0*pow(2.0,(31)/12.0), 8},
-        {440.0*pow(2.0,(24)/12.0), 8},
-        {440.0*pow(2.0,(19)/12.0), 12},
-    };
+    #ifndef GOODBYE_TUNE
+    #define GOODBYE_TUNE { \
+        {440.0*pow(2.0,(31)/12.0), 8}, \
+        {440.0*pow(2.0,(24)/12.0), 8}, \
+        {440.0*pow(2.0,(19)/12.0), 12}, \
+    } 
+    #endif
+    float goodbye_tune[][2] = GOODBYE_TUNE;
 #endif
 
 static action_t keycode_to_action(uint16_t keycode);
@@ -189,7 +191,7 @@ static action_t keycode_to_action(uint16_t keycode)
         case RESET: ; // RESET is 0x5000, which is why this is here
             clear_keyboard();
             #ifdef AUDIO_ENABLE
-                play_notes(&goodbye, 3, false, 0);
+                play_notes(&goodbye_tune, false, 0);
             #endif
             _delay_ms(250);
             #ifdef ATREUS_ASTAR