summaryrefslogtreecommitdiffstats
path: root/quantum
diff options
context:
space:
mode:
authorRyan Ascheman <rascheman@groupon.com>2016-10-18 12:42:02 -0700
committerRyan Ascheman <rascheman@groupon.com>2016-10-18 12:42:02 -0700
commit55b8b8477cc6aee82dfe6792eea4e589cac433d5 (patch)
treece5bfbd1b0ee59dbffdc2044bcf90c89614392ed /quantum
parentd1c70328f8d8ded6ce1e5422b468fc41ef315e7d (diff)
parent04df74f6360464661bcc1e6794e9fd3549084390 (diff)
Merge remote-tracking branch 'upstream/master'
* upstream/master: (1239 commits) Update ez.c removes planck/rev3 temporarily Move hand_swap_config to ez.c, removes error for infinity Update Makefile ergodox: Update algernon's keymap to v1.9 Added VS Code dir to .gitignore Support the Pegasus Hoof controller. [Jack & Erez] Simplifies and documents TO add readme use wait_ms instead of _delay_ms add messenger init keymap Add example keymap Adding whiskey_tango_foxtrot_capslock ergodox keymap Unicode map framework. Allow unicode up to 0xFFFFF using separate mapping table CIE 1931 dim curve Apply the dim curve to the RGB output Update the Cluecard readme files Tune snake and knight intervals for Cluecard Tunable RGB light intervals ...
Diffstat (limited to 'quantum')
-rw-r--r--quantum/audio.c483
-rw-r--r--quantum/audio.h50
-rw-r--r--quantum/audio/audio.c477
-rw-r--r--quantum/audio/audio.h91
-rw-r--r--quantum/audio/audio_pwm.c643
-rw-r--r--quantum/audio/luts.c382
-rw-r--r--quantum/audio/luts.h15
-rw-r--r--quantum/audio/musical_notes.h (renamed from quantum/musical_notes.h)0
-rw-r--r--quantum/audio/song_list.h (renamed from quantum/song_list.h)24
-rw-r--r--quantum/audio/voices.c165
-rw-r--r--quantum/audio/voices.h31
-rw-r--r--quantum/audio/wave.h (renamed from quantum/wave.h)0
-rw-r--r--quantum/config_common.h132
-rw-r--r--quantum/dynamic_macro.h231
-rw-r--r--quantum/keycode_config.c74
-rw-r--r--quantum/keycode_config.h26
-rw-r--r--quantum/keymap.h350
-rw-r--r--quantum/keymap_common.c306
-rw-r--r--quantum/keymap_common.h238
-rw-r--r--quantum/keymap_extras/keymap_bepo.h6
-rw-r--r--quantum/keymap_extras/keymap_canadian_multilingual.h255
-rw-r--r--quantum/keymap_extras/keymap_colemak.h2
-rw-r--r--quantum/keymap_extras/keymap_dvorak.h21
-rw-r--r--quantum/keymap_extras/keymap_fr_ch.h4
-rw-r--r--quantum/keymap_extras/keymap_french.h6
-rw-r--r--quantum/keymap_extras/keymap_french_osx.h2
-rw-r--r--quantum/keymap_extras/keymap_german.h4
-rw-r--r--quantum/keymap_extras/keymap_german_ch.h102
-rw-r--r--quantum/keymap_extras/keymap_german_osx.h9
-rw-r--r--quantum/keymap_extras/keymap_neo2.h4
-rw-r--r--quantum/keymap_extras/keymap_nordic.h6
-rw-r--r--quantum/keymap_extras/keymap_norwegian.h (renamed from quantum/keymap_extras/keymap_norwegian.c)2
-rw-r--r--quantum/keymap_extras/keymap_plover.h32
-rw-r--r--quantum/keymap_extras/keymap_russian.h77
-rw-r--r--quantum/keymap_extras/keymap_spanish.h8
-rw-r--r--quantum/keymap_extras/keymap_uk.h6
-rw-r--r--quantum/keymap_extras/keymap_unicode_cyrillic.h163
-rw-r--r--quantum/keymap_midi.c109
-rw-r--r--quantum/keymap_unicode.c61
-rw-r--r--quantum/led.c48
-rwxr-xr-xquantum/light_ws2812.c25
-rw-r--r--quantum/matrix.c196
-rw-r--r--quantum/process_keycode/process_chording.c60
-rw-r--r--quantum/process_keycode/process_chording.h16
-rw-r--r--quantum/process_keycode/process_leader.c38
-rw-r--r--quantum/process_keycode/process_leader.h23
-rw-r--r--quantum/process_keycode/process_midi.c68
-rw-r--r--quantum/process_keycode/process_midi.h (renamed from quantum/keymap_midi.h)33
-rw-r--r--quantum/process_keycode/process_music.c176
-rw-r--r--quantum/process_keycode/process_music.h27
-rw-r--r--quantum/process_keycode/process_tap_dance.c136
-rw-r--r--quantum/process_keycode/process_tap_dance.h72
-rw-r--r--quantum/process_keycode/process_unicode.c239
-rw-r--r--quantum/process_keycode/process_unicode.h165
-rw-r--r--quantum/quantum.c853
-rw-r--r--quantum/quantum.h113
-rw-r--r--quantum/quantum.mk54
-rw-r--r--quantum/rgblight.c757
-rw-r--r--quantum/rgblight.h18
-rw-r--r--quantum/serial_link/LICENSE21
-rw-r--r--quantum/serial_link/README.md1
-rw-r--r--quantum/serial_link/protocol/byte_stuffer.c142
-rw-r--r--quantum/serial_link/protocol/byte_stuffer.h37
-rw-r--r--quantum/serial_link/protocol/frame_router.c69
-rw-r--r--quantum/serial_link/protocol/frame_router.h38
-rw-r--r--quantum/serial_link/protocol/frame_validator.c121
-rw-r--r--quantum/serial_link/protocol/frame_validator.h34
-rw-r--r--quantum/serial_link/protocol/physical.h30
-rw-r--r--quantum/serial_link/protocol/transport.c128
-rw-r--r--quantum/serial_link/protocol/transport.h152
-rw-r--r--quantum/serial_link/protocol/triple_buffered_object.c78
-rw-r--r--quantum/serial_link/protocol/triple_buffered_object.h51
-rw-r--r--quantum/serial_link/system/serial_link.c265
-rw-r--r--quantum/serial_link/system/serial_link.h63
-rw-r--r--quantum/serial_link/tests/Makefile61
-rw-r--r--quantum/serial_link/tests/byte_stuffer_tests.cpp483
-rw-r--r--quantum/serial_link/tests/frame_router_tests.cpp229
-rw-r--r--quantum/serial_link/tests/frame_validator_tests.cpp115
-rw-r--r--quantum/serial_link/tests/rules.mk22
-rw-r--r--quantum/serial_link/tests/testlist.mk6
-rw-r--r--quantum/serial_link/tests/transport_tests.cpp188
-rw-r--r--quantum/serial_link/tests/triple_buffered_object_tests.cpp84
-rw-r--r--quantum/template/Makefile143
-rw-r--r--quantum/template/config.h23
-rw-r--r--quantum/template/keymaps/default/Makefile21
-rw-r--r--quantum/template/keymaps/default/config.h8
-rw-r--r--quantum/template/keymaps/default/keymap.c (renamed from quantum/template/keymaps/default.c)20
-rw-r--r--quantum/template/keymaps/default/readme.md1
-rw-r--r--quantum/template/readme.md (renamed from quantum/template/README.md)18
-rw-r--r--quantum/template/rules.mk67
-rw-r--r--quantum/template/template.c24
-rw-r--r--quantum/template/template.h10
-rw-r--r--quantum/tools/readme.md (renamed from quantum/tools/README.md)4
-rw-r--r--quantum/visualizer/LICENSE.md29
-rw-r--r--quantum/visualizer/example_integration/callbacks.c36
-rw-r--r--quantum/visualizer/example_integration/gfxconf.h325
-rw-r--r--quantum/visualizer/example_integration/lcd_backlight_hal.c91
-rw-r--r--quantum/visualizer/example_integration/visualizer_user.c121
-rw-r--r--quantum/visualizer/lcd_backlight.c85
-rw-r--r--quantum/visualizer/lcd_backlight.h42
-rw-r--r--quantum/visualizer/led_test.c170
-rw-r--r--quantum/visualizer/led_test.h41
-rw-r--r--quantum/visualizer/readme.md18
-rw-r--r--quantum/visualizer/visualizer.c545
-rw-r--r--quantum/visualizer/visualizer.h147
-rw-r--r--quantum/visualizer/visualizer.mk61
106 files changed, 10130 insertions, 2052 deletions
diff --git a/quantum/audio.c b/quantum/audio.c
deleted file mode 100644
index d8768f1609..0000000000
--- a/quantum/audio.c
+++ /dev/null
@@ -1,483 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-#include <avr/pgmspace.h>
-#include <avr/interrupt.h>
-#include <avr/io.h>
-#include "print.h"
-#include "audio.h"
-#include "keymap_common.h"
-
-#include "eeconfig.h"
-
-#define PI 3.14159265
-
-#define CPU_PRESCALER 8
-
-// #define PWM_AUDIO
-
-#ifdef PWM_AUDIO
- #include "wave.h"
- #define SAMPLE_DIVIDER 39
- #define SAMPLE_RATE (2000000.0/SAMPLE_DIVIDER/2048)
- // Resistor value of 1/ (2 * PI * 10nF * (2000000 hertz / SAMPLE_DIVIDER / 10)) for 10nF cap
-#endif
-
-void delay_us(int count) {
- while(count--) {
- _delay_us(1);
- }
-}
-
-int voices = 0;
-int voice_place = 0;
-double frequency = 0;
-int volume = 0;
-long position = 0;
-int duty_place = 1;
-int duty_counter = 0;
-
-double frequencies[8] = {0, 0, 0, 0, 0, 0, 0, 0};
-int volumes[8] = {0, 0, 0, 0, 0, 0, 0, 0};
-bool sliding = false;
-
-int max = 0xFF;
-float sum = 0;
-int value = 128;
-float place = 0;
-float places[8] = {0, 0, 0, 0, 0, 0, 0, 0};
-
-uint16_t place_int = 0;
-bool repeat = true;
-uint8_t * sample;
-uint16_t sample_length = 0;
-
-
-bool notes = false;
-bool note = false;
-float note_frequency = 0;
-float note_length = 0;
-float note_tempo = TEMPO_DEFAULT;
-float note_timbre = TIMBRE_DEFAULT;
-uint16_t note_position = 0;
-float (* notes_pointer)[][2];
-uint8_t notes_count;
-bool notes_repeat;
-float notes_rest;
-bool note_resting = false;
-int note_flipper = 0;
-
-uint8_t current_note = 0;
-uint8_t rest_counter = 0;
-
-audio_config_t audio_config;
-
-
-void audio_toggle(void) {
- audio_config.enable ^= 1;
- eeconfig_write_audio(audio_config.raw);
-}
-
-void audio_on(void) {
- audio_config.enable = 1;
- eeconfig_write_audio(audio_config.raw);
-}
-
-void audio_off(void) {
- audio_config.enable = 0;
- eeconfig_write_audio(audio_config.raw);
-}
-
-
-void stop_all_notes() {
- voices = 0;
- #ifdef PWM_AUDIO
- TIMSK3 &= ~_BV(OCIE3A);
- #else
- TIMSK3 &= ~_BV(OCIE3A);
- TCCR3A &= ~_BV(COM3A1);
- #endif
- notes = false;
- note = false;
- frequency = 0;
- volume = 0;
-
- for (int i = 0; i < 8; i++) {
- frequencies[i] = 0;
- volumes[i] = 0;
- }
-}
-
-void stop_note(double freq) {
- if (note) {
- #ifdef PWM_AUDIO
- freq = freq / SAMPLE_RATE;
- #endif
- for (int i = 7; i >= 0; i--) {
- if (frequencies[i] == freq) {
- frequencies[i] = 0;
- volumes[i] = 0;
- for (int j = i; (j < 7); j++) {
- frequencies[j] = frequencies[j+1];
- frequencies[j+1] = 0;
- volumes[j] = volumes[j+1];
- volumes[j+1] = 0;
- }
- }
- }
- voices--;
- if (voices < 0)
- voices = 0;
- if (voice_place >= voices) {
- voice_place = 0;
- }
- if (voices == 0) {
- #ifdef PWM_AUDIO
- TIMSK3 &= ~_BV(OCIE3A);
- #else
- TIMSK3 &= ~_BV(OCIE3A);
- TCCR3A &= ~_BV(COM3A1);
- #endif
- frequency = 0;
- volume = 0;
- note = false;
- }
- }
-}
-
-void init_notes() {
-
- /* check signature */
- if (!eeconfig_is_enabled()) {
- eeconfig_init();
- }
- audio_config.raw = eeconfig_read_audio();
-
- #ifdef PWM_AUDIO
- PLLFRQ = _BV(PDIV2);
- PLLCSR = _BV(PLLE);
- while(!(PLLCSR & _BV(PLOCK)));
- PLLFRQ |= _BV(PLLTM0); /* PCK 48MHz */
-
- /* Init a fast PWM on Timer4 */
- TCCR4A = _BV(COM4A0) | _BV(PWM4A); /* Clear OC4A on Compare Match */
- TCCR4B = _BV(CS40); /* No prescaling => f = PCK/256 = 187500Hz */
- OCR4A = 0;
-
- /* Enable the OC4A output */
- DDRC |= _BV(PORTC6);
-
- TIMSK3 &= ~_BV(OCIE3A); // Turn off 3A interputs
-
- TCCR3A = 0x0; // Options not needed
- TCCR3B = _BV(CS31) | _BV(CS30) | _BV(WGM32); // 64th prescaling and CTC
- OCR3A = SAMPLE_DIVIDER - 1; // Correct count/compare, related to sample playback
- #else
- DDRC |= _BV(PORTC6);
-
- TIMSK3 &= ~_BV(OCIE3A); // Turn off 3A interputs
-
- TCCR3A = (0 << COM3A1) | (0 << COM3A0) | (1 << WGM31) | (0 << WGM30);
- TCCR3B = (1 << WGM33) | (1 << WGM32) | (0 << CS32) | (1 << CS31) | (0 << CS30);
- #endif
-}
-
-
-ISR(TIMER3_COMPA_vect) {
- if (note) {
- #ifdef PWM_AUDIO
- if (voices == 1) {
- // SINE
- OCR4A = pgm_read_byte(&sinewave[(uint16_t)place]) >> 2;
-
- // SQUARE
- // if (((int)place) >= 1024){
- // OCR4A = 0xFF >> 2;
- // } else {
- // OCR4A = 0x00;
- // }
-
- // SAWTOOTH
- // OCR4A = (int)place / 4;
-
- // TRIANGLE
- // if (((int)place) >= 1024) {
- // OCR4A = (int)place / 2;
- // } else {
- // OCR4A = 2048 - (int)place / 2;
- // }
-
- place += frequency;
-
- if (place >= SINE_LENGTH)
- place -= SINE_LENGTH;
-
- } else {
- int sum = 0;
- for (int i = 0; i < voices; i++) {
- // SINE
- sum += pgm_read_byte(&sinewave[(uint16_t)places[i]]) >> 2;
-
- // SQUARE
- // if (((int)places[i]) >= 1024){
- // sum += 0xFF >> 2;
- // } else {
- // sum += 0x00;