aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2017-06-27 14:35:08 -0400
committerJack Humbert <jack.humb@gmail.com>2017-06-27 14:35:08 -0400
commitea7590c8940bc85f8a83bd42b1e01bc1431c104b (patch)
treef3c2b71269e6ff64dd3c427d0f8a7e27f2900201
parent9f5b4e1d7a37f873acbc19b8385964121566653e (diff)
downloadqmk_firmware-ea7590c8940bc85f8a83bd42b1e01bc1431c104b.tar.gz
qmk_firmware-ea7590c8940bc85f8a83bd42b1e01bc1431c104b.zip
add new arguements, docs
-rw-r--r--docs/modding_your_keyboard.md2
-rw-r--r--keyboards/planck/config.h1
-rw-r--r--keyboards/preonic/config.h1
-rw-r--r--quantum/audio/audio.c3
4 files changed, 5 insertions, 2 deletions
diff --git a/docs/modding_your_keyboard.md b/docs/modding_your_keyboard.md
index 2429570f5..44e6e6e72 100644
--- a/docs/modding_your_keyboard.md
+++ b/docs/modding_your_keyboard.md
@@ -1,7 +1,7 @@
1 1
2## Audio output from a speaker 2## Audio output from a speaker
3 3
4Your 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. 4Your 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.
5 5
6The 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: 6The 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:
7 7
diff --git a/keyboards/planck/config.h b/keyboards/planck/config.h
index 5cf96bb88..c86f8491e 100644
--- a/keyboards/planck/config.h
+++ b/keyboards/planck/config.h
@@ -37,6 +37,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
37#define UNUSED_PINS 37#define UNUSED_PINS
38 38
39#define AUDIO_VOICES 39#define AUDIO_VOICES
40#define C6_AUDIO
40 41
41#define BACKLIGHT_PIN B7 42#define BACKLIGHT_PIN B7
42 43
diff --git a/keyboards/preonic/config.h b/keyboards/preonic/config.h
index 239c29ebf..8aa88b7f0 100644
--- a/keyboards/preonic/config.h
+++ b/keyboards/preonic/config.h
@@ -38,6 +38,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
38#define UNUSED_PINS 38#define UNUSED_PINS
39 39
40#define AUDIO_VOICES 40#define AUDIO_VOICES
41#define C6_AUDIO
41 42
42#define BACKLIGHT_PIN B7 43#define BACKLIGHT_PIN B7
43 44
diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c
index 04f346003..3192d500f 100644
--- a/quantum/audio/audio.c
+++ b/quantum/audio/audio.c
@@ -271,12 +271,13 @@ float vibrato(float average_freq) {
271#ifdef C6_AUDIO 271#ifdef C6_AUDIO
272ISR(TIMER3_COMPA_vect) 272ISR(TIMER3_COMPA_vect)
273{ 273{
274 float freq, freq_alt = 0; 274 float freq;
275 275
276 if (playing_note) { 276 if (playing_note) {
277 if (voices > 0) { 277 if (voices > 0) {
278 278
279 #ifdef B5_AUDIO 279 #ifdef B5_AUDIO
280 float freq_alt = 0;
280 if (voices > 1) { 281 if (voices > 1) {
281 if (polyphony_rate == 0) { 282 if (polyphony_rate == 0) {
282 if (glissando) { 283 if (glissando) {