summaryrefslogtreecommitdiffstats
path: root/quantum
diff options
context:
space:
mode:
Diffstat (limited to 'quantum')
-rw-r--r--quantum/analog.c16
-rw-r--r--quantum/analog.h16
-rw-r--r--quantum/api.c18
-rw-r--r--quantum/api.h18
-rw-r--r--quantum/api/api_sysex.c15
-rw-r--r--quantum/api/api_sysex.h18
-rw-r--r--quantum/audio/audio.c337
-rw-r--r--quantum/audio/audio.h17
-rw-r--r--quantum/audio/audio_pwm.c15
-rw-r--r--quantum/audio/luts.c16
-rw-r--r--quantum/audio/luts.h18
-rw-r--r--quantum/audio/musical_notes.h18
-rw-r--r--quantum/audio/song_list.h42
-rw-r--r--quantum/audio/voices.c16
-rw-r--r--quantum/audio/voices.h17
-rw-r--r--quantum/audio/wave.h18
-rw-r--r--quantum/config_common.h22
-rw-r--r--quantum/dynamic_macro.h16
-rw-r--r--quantum/fauxclicky.c68
-rw-r--r--quantum/fauxclicky.h99
-rw-r--r--quantum/keycode_config.c18
-rw-r--r--quantum/keycode_config.h16
-rw-r--r--quantum/keymap.h2
-rw-r--r--quantum/keymap_common.c12
-rw-r--r--quantum/keymap_extras/keymap_bepo.h15
-rw-r--r--quantum/keymap_extras/keymap_canadian_multilingual.h15
-rw-r--r--quantum/keymap_extras/keymap_colemak.h15
-rw-r--r--quantum/keymap_extras/keymap_dvorak.h15
-rw-r--r--quantum/keymap_extras/keymap_dvp.h16
-rw-r--r--quantum/keymap_extras/keymap_fr_ch.h15
-rw-r--r--quantum/keymap_extras/keymap_french.h19
-rw-r--r--quantum/keymap_extras/keymap_french_osx.h17
-rw-r--r--quantum/keymap_extras/keymap_german.h16
-rw-r--r--quantum/keymap_extras/keymap_german_ch.h15
-rw-r--r--quantum/keymap_extras/keymap_german_osx.h15
-rw-r--r--quantum/keymap_extras/keymap_jp.h17
-rw-r--r--quantum/keymap_extras/keymap_neo2.h15
-rw-r--r--quantum/keymap_extras/keymap_nordic.h15
-rw-r--r--quantum/keymap_extras/keymap_norwegian.h15
-rw-r--r--quantum/keymap_extras/keymap_plover.h15
-rw-r--r--quantum/keymap_extras/keymap_russian.h77
-rw-r--r--quantum/keymap_extras/keymap_spanish.h15
-rw-r--r--quantum/keymap_extras/keymap_uk.h15
-rw-r--r--quantum/keymap_extras/keymap_unicode_cyrillic.h163
-rwxr-xr-xquantum/light_ws2812.c19
-rwxr-xr-xquantum/light_ws2812.h14
-rw-r--r--quantum/matrix.c17
-rw-r--r--quantum/pincontrol.h15
-rw-r--r--quantum/process_keycode/process_audio.c62
-rw-r--r--quantum/process_keycode/process_audio.h11
-rw-r--r--quantum/process_keycode/process_chording.c18
-rw-r--r--quantum/process_keycode/process_chording.h18
-rw-r--r--quantum/process_keycode/process_combo.c150
-rw-r--r--quantum/process_keycode/process_combo.h59
-rw-r--r--quantum/process_keycode/process_leader.c18
-rw-r--r--quantum/process_keycode/process_leader.h18
-rw-r--r--quantum/process_keycode/process_midi.c307
-rw-r--r--quantum/process_keycode/process_midi.h243
-rw-r--r--quantum/process_keycode/process_music.c133
-rw-r--r--quantum/process_keycode/process_music.h24
-rw-r--r--quantum/process_keycode/process_printer.c18
-rw-r--r--quantum/process_keycode/process_printer.h18
-rw-r--r--quantum/process_keycode/process_printer_bb.c18
-rw-r--r--quantum/process_keycode/process_tap_dance.c15
-rw-r--r--quantum/process_keycode/process_tap_dance.h15
-rw-r--r--quantum/process_keycode/process_ucis.c149
-rw-r--r--quantum/process_keycode/process_ucis.h51
-rw-r--r--quantum/process_keycode/process_unicode.c291
-rw-r--r--quantum/process_keycode/process_unicode.h175
-rw-r--r--quantum/process_keycode/process_unicode_common.c101
-rw-r--r--quantum/process_keycode/process_unicode_common.h148
-rw-r--r--quantum/process_keycode/process_unicodemap.c72
-rw-r--r--quantum/process_keycode/process_unicodemap.h25
-rw-r--r--quantum/quantum.c252
-rw-r--r--quantum/quantum.h38
-rw-r--r--quantum/quantum_keycodes.h313
-rw-r--r--quantum/rgblight.c50
-rw-r--r--quantum/rgblight.h26
-rw-r--r--quantum/serial_link/LICENSE2
-rw-r--r--quantum/template/Makefile17
-rw-r--r--quantum/template/config.h27
-rw-r--r--quantum/template/keymaps/default/Makefile22
-rw-r--r--quantum/template/keymaps/default/config.h18
-rw-r--r--quantum/template/keymaps/default/keymap.c17
-rw-r--r--quantum/template/rules.mk3
-rw-r--r--quantum/template/template.c15
-rw-r--r--quantum/template/template.h15
-rw-r--r--quantum/variable_trace.c16
-rw-r--r--quantum/variable_trace.h16
89 files changed, 3196 insertions, 1261 deletions
diff --git a/quantum/analog.c b/quantum/analog.c
index 49b84ee0e8..1ec38df75d 100644
--- a/quantum/analog.c
+++ b/quantum/analog.c
@@ -1,3 +1,19 @@
+/* Copyright 2015 Jack Humbert
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
// Simple analog to digitial conversion
#include <avr/io.h>
diff --git a/quantum/analog.h b/quantum/analog.h
index 9b95a93bef..8d93de7dc2 100644
--- a/quantum/analog.h
+++ b/quantum/analog.h
@@ -1,3 +1,19 @@
+/* Copyright 2015 Jack Humbert
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
#ifndef _analog_h_included__
#define _analog_h_included__
diff --git a/quantum/api.c b/quantum/api.c
index 6a7c0a4332..52dfe23e17 100644
--- a/quantum/api.c
+++ b/quantum/api.c
@@ -1,3 +1,19 @@
+/* Copyright 2016 Jack Humbert
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * 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 "api.h"
#include "quantum.h"
@@ -176,4 +192,4 @@ void process_api(uint16_t length, uint8_t * data) {
// #endif
}
-} \ No newline at end of file
+}
diff --git a/quantum/api.h b/quantum/api.h
index 00dcdb8954..efc0ddca12 100644
--- a/quantum/api.h
+++ b/quantum/api.h
@@ -1,3 +1,19 @@
+/* Copyright 2016 Jack Humbert
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
#ifndef _API_H_
#define _API_H_
@@ -56,4 +72,4 @@ bool process_api_keyboard(uint8_t length, uint8_t * data);
__attribute__ ((weak))
bool process_api_user(uint8_t length, uint8_t * data);
-#endif \ No newline at end of file
+#endif
diff --git a/quantum/api/api_sysex.c b/quantum/api/api_sysex.c
index 868f854b92..6a2ee90124 100644
--- a/quantum/api/api_sysex.c
+++ b/quantum/api/api_sysex.c
@@ -1,3 +1,18 @@
+/* Copyright 2016 Jack Humbert, Fred Sundvik
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * 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 "api_sysex.h"
#include "sysex_tools.h"
#include "print.h"
diff --git a/quantum/api/api_sysex.h b/quantum/api/api_sysex.h
index b947b60e54..a23f00f572 100644
--- a/quantum/api/api_sysex.h
+++ b/quantum/api/api_sysex.h
@@ -1,3 +1,19 @@
+/* Copyright 2016 Jack Humbert
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
#ifndef _API_SYSEX_H_
#define _API_SYSEX_H_
@@ -7,4 +23,4 @@ void send_bytes_sysex(uint8_t message_type, uint8_t data_type, uint8_t * bytes,
#define SEND_BYTES(mt, dt, b, l) send_bytes_sysex(mt, dt, b, l)
-#endif \ No newline at end of file
+#endif
diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c
index 2a315fd168..597073611a 100644
--- a/quantum/audio/audio.c
+++ b/quantum/audio/audio.c
@@ -1,3 +1,18 @@
+/* Copyright 2016 Jack Humbert
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * 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>
@@ -89,15 +104,15 @@ void audio_init()
}
audio_config.raw = eeconfig_read_audio();
- // Set port PC6 (OC3A and /OC4A) as output
+ // Set port PC6 (OC3A and /OC4A) as output
DDRC |= _BV(PORTC6);
DISABLE_AUDIO_COUNTER_3_ISR;
- // TCCR3A / TCCR3B: Timer/Counter #3 Control Registers
- // Compare Output Mode (COM3An) = 0b00 = Normal port operation, OC3A disconnected from PC6
- // Waveform Generation Mode (WGM3n) = 0b1110 = Fast PWM Mode 14 (Period = ICR3, Duty Cycle = OCR3A)
- // Clock Select (CS3n) = 0b010 = Clock / 8
+ // TCCR3A / TCCR3B: Timer/Counter #3 Control Registers
+ // Compare Output Mode (COM3An) = 0b00 = Normal port operation, OC3A disconnected from PC6
+ // Waveform Generation Mode (WGM3n) = 0b1110 = Fast PWM Mode 14 (Period = ICR3, Duty Cycle = OCR3A)
+ // Clock Select (CS3n) = 0b010 = Clock / 8
TCCR3A = (0 << COM3A1) | (0 << COM3A0) | (1 << WGM31) | (0 << WGM30);
TCCR3B = (1 << WGM33) | (1 << WGM32) | (0 << CS32) | (1 << CS31) | (0 << CS30);
@@ -106,6 +121,8 @@ void audio_init()
void stop_all_notes()
{
+ dprintf("audio stop all notes");
+
if (!audio_initialized) {
audio_init();
}
@@ -128,6 +145,8 @@ void stop_all_notes()
void stop_note(float freq)
{
+ dprintf("audio stop note freq=%d", (int)freq);
+
if (playing_note) {
if (!audio_initialized) {
audio_init();
@@ -183,159 +202,161 @@ float vibrato(float average_freq) {
ISR(TIMER3_COMPA_vect)
{
- float freq;
-
- if (playing_note) {
- if (voices > 0) {
- if (polyphony_rate > 0) {
- if (voices > 1) {
- voice_place %= voices;
- if (place++ > (frequencies[voice_place] / polyphony_rate / CPU_PRESCALER)) {
- voice_place = (voice_place + 1) % voices;
- place = 0.0;
- }
- }
-
- #ifdef VIBRATO_ENABLE
- if (vibrato_strength > 0) {
- freq = vibrato(frequencies[voice_place]);
- } else {
- freq = frequencies[voice_place];
- }
- #else
- freq = frequencies[voice_place];
- #endif
- } else {
- if (glissando) {
- if (frequency != 0 && frequency < frequencies[voices - 1] && frequency < frequencies[voices - 1] * pow(2, -440/frequencies[voices - 1]/12/2)) {
- frequency = frequency * pow(2, 440/frequency/12/2);
- } else if (frequency != 0 && frequency > frequencies[voices - 1] && frequency > frequencies[voices - 1] * pow(2, 440/frequencies[voices - 1]/12/2)) {
- frequency = frequency * pow(2, -440/frequency/12/2);
- } else {
- frequency = frequencies[voices - 1];
- }
- } else {
- frequency = frequencies[voices - 1];
- }
-
- #ifdef VIBRATO_ENABLE
- if (vibrato_strength > 0) {
- freq = vibrato(frequency);
- } else {
- freq = frequency;
- }
- #else
- freq = frequency;
- #endif
- }
-
- if (envelope_index < 65535) {
- envelope_index++;
- }
-
- freq = voice_envelope(freq);
-
- if (freq < 30.517578125) {
- freq = 30.52;
- }
-
- TIMER_3_PERIOD = (uint16_t)(((float)F_CPU) / (freq * CPU_PRESCALER));
- TIMER_3_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre);
- }
- }
-
- if (playing_notes) {
- if (note_frequency > 0) {
- #ifdef VIBRATO_ENABLE
- if (vibrato_strength > 0) {
- freq = vibrato(note_frequency);
- } else {
- freq = note_frequency;
- }
- #else
- freq = note_frequency;
- #endif
-
- if (envelope_index < 65535) {
- envelope_index++;
- }
-