]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
add new arguements, docs
authorJack Humbert <jack.humb@gmail.com>
Tue, 27 Jun 2017 18:35:08 +0000 (14:35 -0400)
committerJack Humbert <jack.humb@gmail.com>
Tue, 27 Jun 2017 18:35:08 +0000 (14:35 -0400)
docs/modding_your_keyboard.md
keyboards/planck/config.h
keyboards/preonic/config.h
quantum/audio/audio.c

index 2429570f53e47a51d7b4dd90e6bc73eebcb4c476..44e6e6e72ad6d7f176884ce7e55c77c653d280c7 100644 (file)
@@ -1,7 +1,7 @@
 
 ## Audio output from a speaker
 
-Your keyboard can make sounds! If you've got a Planck, Preonic, or basically any keyboard that allows access to the C6 port, you can hook up a simple speaker and make it beep. You can use those beeps to indicate layer transitions, modifiers, special keys, or just to play some funky 8bit tunes.
+Your keyboard can make sounds! If you've got a Planck, Preonic, or basically any keyboard that allows access to the C6 or B5 port (`#define C6_AUDIO` and `#define B5_AUDIO`), you can hook up a simple speaker and make it beep. You can use those beeps to indicate layer transitions, modifiers, special keys, or just to play some funky 8bit tunes.
 
 The audio code lives in [quantum/audio/audio.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/audio/audio.h) and in the other files in the audio directory. It's enabled by default on the Planck [stock keymap](https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/default/keymap.c). Here are the important bits:
 
index 5cf96bb88cb02c72525f8528587f0da00c7df4a2..c86f8491eed7fa0450f64cc90bffb448c72cb7c9 100644 (file)
@@ -37,6 +37,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define UNUSED_PINS
 
 #define AUDIO_VOICES
+#define C6_AUDIO
 
 #define BACKLIGHT_PIN B7
 
index 239c29ebf9ebf9ce6c63b73d3c9e36a802df94c3..8aa88b7f0d207cdb4830bf7389fb91d253972313 100644 (file)
@@ -38,6 +38,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define UNUSED_PINS
 
 #define AUDIO_VOICES
+#define C6_AUDIO
 
 #define BACKLIGHT_PIN B7
 
index 04f3460033117b7c763d4bff20dbd0caee7737f3..3192d500f561b8df545aeec5d8324f44fc3dc388 100644 (file)
@@ -271,12 +271,13 @@ float vibrato(float average_freq) {
 #ifdef C6_AUDIO
 ISR(TIMER3_COMPA_vect)
 {
-    float freq, freq_alt = 0;
+    float freq;
 
     if (playing_note) {
         if (voices > 0) {
 
             #ifdef B5_AUDIO
+            float freq_alt = 0;
                 if (voices > 1) {
                     if (polyphony_rate == 0) {
                         if (glissando) {