diff --git a/Vagrantfile b/Vagrantfile index a6c3afd385f..42b4377510c 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -5,10 +5,10 @@ Vagrant.configure(2) do |config| # You can only have one config.vm.box uncommented at a time # Comment this and uncomment another if you don't want to use the minimal Arch box - config.vm.box = "dragon788/arch-ala-elasticdog" + #config.vm.box = "dragon788/arch-ala-elasticdog" # VMware/Virtualbox 64 bit - # config.vm.box = "phusion/ubuntu-14.04-amd64" + config.vm.box = "phusion/ubuntu-14.04-amd64" # # VMware/Virtualbox 64 bit #config.vm.box = "puphpet/centos65-x64" diff --git a/keyboard/atomic/atomic.h b/keyboard/atomic/atomic.h index 456c3fbdf8d..901761f514c 100644 --- a/keyboard/atomic/atomic.h +++ b/keyboard/atomic/atomic.h @@ -4,6 +4,7 @@ #include "quantum.h" #include #include +#include // This a shortcut to help you visually see your layout. // The following is an example using the Planck MIT layout diff --git a/keyboard/atomic/keymaps/default/compiled.hex b/keyboard/atomic/keymaps/default/compiled.hex index dde3b840bae..b9bb143ea85 100644 Binary files a/keyboard/atomic/keymaps/default/compiled.hex and b/keyboard/atomic/keymaps/default/compiled.hex differ diff --git a/keyboard/clueboard1/keymaps/default/compiled.hex b/keyboard/clueboard1/keymaps/default/compiled.hex index e88c338e5b6..31008c426e9 100644 Binary files a/keyboard/clueboard1/keymaps/default/compiled.hex and b/keyboard/clueboard1/keymaps/default/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/adnw_k_o_y/compiled.hex b/keyboard/ergodox_ez/keymaps/adnw_k_o_y/compiled.hex index a641210af87..aee94c58315 100644 Binary files a/keyboard/ergodox_ez/keymaps/adnw_k_o_y/compiled.hex and b/keyboard/ergodox_ez/keymaps/adnw_k_o_y/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/csharp_dev/compiled.hex b/keyboard/ergodox_ez/keymaps/csharp_dev/compiled.hex index a5b9e9ba4a7..3f42f6272e7 100644 Binary files a/keyboard/ergodox_ez/keymaps/csharp_dev/compiled.hex and b/keyboard/ergodox_ez/keymaps/csharp_dev/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/csharp_dev/keymap.c b/keyboard/ergodox_ez/keymaps/csharp_dev/keymap.c index 46005b533ee..e9648ede7d1 100644 --- a/keyboard/ergodox_ez/keymaps/csharp_dev/keymap.c +++ b/keyboard/ergodox_ez/keymaps/csharp_dev/keymap.c @@ -202,7 +202,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) break; case MACRO_PARENTHESE: if (record->event.pressed) { - return MACRO( D(LSHIFT),T(LPRN), T(RPRN),U(LSHIFT), T(SCOLON), END); + return MACRO( D(LSHIFT),T(9), T(0),U(LSHIFT), T(SCOLON), END); } break; } diff --git a/keyboard/ergodox_ez/keymaps/dvorak_spanish/compiled.hex b/keyboard/ergodox_ez/keymaps/dvorak_spanish/compiled.hex index 8150f559b51..dcac1fe29d5 100644 Binary files a/keyboard/ergodox_ez/keymaps/dvorak_spanish/compiled.hex and b/keyboard/ergodox_ez/keymaps/dvorak_spanish/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/dvorak_spanish/keymap.c b/keyboard/ergodox_ez/keymaps/dvorak_spanish/keymap.c index 33a0480c942..6eb864b447a 100755 --- a/keyboard/ergodox_ez/keymaps/dvorak_spanish/keymap.c +++ b/keyboard/ergodox_ez/keymaps/dvorak_spanish/keymap.c @@ -68,7 +68,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { M(OBRACE), KC_SLSH,KC_Q, KC_J, KC_K, KC_X, KC_LGUI, M(OBRACK), KC_HOME,KC_PGDN,KC_PGUP,KC_END, LCAG_T(KC_F5), LT(AUX, KC_F6), - MT(MOD_LALT | MOD_LCTL, KC_F4), + MT((MOD_LALT | MOD_LCTL), KC_F4), KC_ENT,KC_TAB,MT((MOD_LALT | MOD_LSFT), KC_F3), // right hand KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, @@ -77,8 +77,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_RALT, KC_B, KC_M, KC_W, KC_V, KC_Z, M(CBRACE), KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,M(CBRACK), LT(AUX, KC_F7), LCAG_T(KC_F8), - MT(MOD_LALT | MOD_LCTL, KC_F11), - MT(MOD_LALT | MOD_LSFT, KC_F12),KC_BSPC, KC_SPC + MT((MOD_LALT | MOD_LCTL), KC_F11), + MT((MOD_LALT | MOD_LSFT), KC_F12),KC_BSPC, KC_SPC ), /* Keymap 1: Aux layer * @@ -154,7 +154,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { M(OBRACE), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI, M(OBRACK), KC_HOME,KC_PGDN,KC_PGUP,KC_END, LCAG_T(KC_F5), KC_TRNS, - MT(MOD_LALT | MOD_LCTL, KC_F4), + MT((MOD_LALT | MOD_LCTL), KC_F4), KC_ENT,KC_TAB,KC_TRNS, // right hand KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, @@ -163,8 +163,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_RALT, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,M(CBRACE), KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,M(CBRACK), KC_TRNS, LCAG_T(KC_F8), - MT(MOD_LALT | MOD_LCTL, KC_F11), - MT(MOD_LALT | MOD_LSFT, KC_F12),KC_BSPC, KC_SPC + MT((MOD_LALT | MOD_LCTL), KC_F11), + MT((MOD_LALT | MOD_LSFT), KC_F12),KC_BSPC, KC_SPC ), }; diff --git a/keyboard/ergodox_ez/keymaps/erez_experimental/config.h b/keyboard/ergodox_ez/keymaps/erez_experimental/config.h index 314c2ec32b1..e5d7fe1885e 100644 --- a/keyboard/ergodox_ez/keymaps/erez_experimental/config.h +++ b/keyboard/ergodox_ez/keymaps/erez_experimental/config.h @@ -6,4 +6,7 @@ #define ONESHOT_TAP_TOGGLE 2 #define ONESHOT_TIMEOUT 300 +#undef LEADER_TIMEOUT +#define LEADER_TIMEOUT 300 + #endif diff --git a/keyboard/ergodox_ez/keymaps/erez_experimental/keymap.c b/keyboard/ergodox_ez/keymaps/erez_experimental/keymap.c index 93d1c84bc5c..04ad2a81671 100644 --- a/keyboard/ergodox_ez/keymaps/erez_experimental/keymap.c +++ b/keyboard/ergodox_ez/keymaps/erez_experimental/keymap.c @@ -7,8 +7,6 @@ #define SYMB 1 // symbols #define MDIA 2 // media keys -#define LEADER_TIMEOUT 300 - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Basic layer * @@ -144,8 +142,6 @@ const uint16_t PROGMEM fn_actions[] = { [3] = ACTION_MACRO_TAP(1) // Eric Tang's Famous Macro! }; -static uint16_t key_timer; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { return MACRO_NONE; diff --git a/keyboard/ergodox_ez/keymaps/ordinary/compiled.hex b/keyboard/ergodox_ez/keymaps/ordinary/compiled.hex index af29caaab78..501f14f9fb3 100644 Binary files a/keyboard/ergodox_ez/keymaps/ordinary/compiled.hex and b/keyboard/ergodox_ez/keymaps/ordinary/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/ordinary/keymap.c b/keyboard/ergodox_ez/keymaps/ordinary/keymap.c index 18939b1923a..778cbc63cf5 100644 --- a/keyboard/ergodox_ez/keymaps/ordinary/keymap.c +++ b/keyboard/ergodox_ez/keymaps/ordinary/keymap.c @@ -3,6 +3,7 @@ #include "debug.h" #include "action_layer.h" #include "action_util.h" +#include "mousekey.h" #define BASE 0 // default layer #define SYMB 1 // symbols layer diff --git a/keyboard/ergodox_ez/keymaps/osx_de/compiled.hex b/keyboard/ergodox_ez/keymaps/osx_de/compiled.hex index b1f6aabf919..2233a8cbfe0 100644 Binary files a/keyboard/ergodox_ez/keymaps/osx_de/compiled.hex and b/keyboard/ergodox_ez/keymaps/osx_de/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/osx_de/keymap.c b/keyboard/ergodox_ez/keymaps/osx_de/keymap.c index 174f26cbe56..554813d7e8b 100644 --- a/keyboard/ergodox_ez/keymaps/osx_de/keymap.c +++ b/keyboard/ergodox_ez/keymaps/osx_de/keymap.c @@ -1,19 +1,7 @@ #include "ergodox_ez.h" #include "debug.h" #include "action_layer.h" -#include "keymap_extras/keymap_french.h" -#include "keymap_extras/keymap_neo2.h" -#include "keymap_extras/keymap_uk.h" -#include "keymap_extras/keymap_colemak.h" -#include "keymap_extras/keymap_french_osx.h" -#include "keymap_extras/keymap_nordic.h" -#include "keymap_extras/keymap_dvorak.h" -#include "keymap_extras/keymap_german.h" -#include "keymap_extras/keymap_norwegian.c" -#include "keymap_extras/keymap_fr_ch.h" -#include "keymap_extras/keymap_german_osx.h" -#include "keymap_extras/keymap_spanish.h" -#include "keymap_extras/keymap_bepo.h" +#include "keymap_german_osx.h" #define BASE 0 #define SYMB 1 diff --git a/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/compiled.hex b/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/compiled.hex index 715b5acec4b..3351a628fe3 100644 Binary files a/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/compiled.hex and b/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/keymap.c b/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/keymap.c index 72ed195eb7c..20b085ed444 100644 --- a/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/keymap.c +++ b/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/keymap.c @@ -1,19 +1,19 @@ #include "ergodox_ez.h" #include "debug.h" #include "action_layer.h" -#include "keymap_extras/keymap_french.h" -#include "keymap_extras/keymap_neo2.h" -#include "keymap_extras/keymap_uk.h" -#include "keymap_extras/keymap_colemak.h" -#include "keymap_extras/keymap_french_osx.h" -#include "keymap_extras/keymap_nordic.h" -#include "keymap_extras/keymap_dvorak.h" -#include "keymap_extras/keymap_german.h" -#include "keymap_extras/keymap_norwegian.c" -#include "keymap_extras/keymap_fr_ch.h" -#include "keymap_extras/keymap_german_osx.h" -#include "keymap_extras/keymap_spanish.h" -#include "keymap_extras/keymap_bepo.h" + +#include "keymap_neo2.h" +#include "keymap_uk.h" +#include "keymap_colemak.h" +#include "keymap_french_osx.h" +#include "keymap_nordic.h" +#include "keymap_dvorak.h" +#include "keymap_german.h" +#include "keymap_norwegian.c" +#include "keymap_fr_ch.h" +#include "keymap_german_osx.h" +#include "keymap_spanish.h" +#include "keymap_bepo.h" #define BASE 0 #define SYMB 1 @@ -128,7 +128,6 @@ const uint16_t PROGMEM fn_actions[] = { const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { -static uint16_t start; switch(id) { case UNUSED: //Macro: UNUSED//----------------------- diff --git a/keyboard/ergodox_ez/keymaps/osx_de_experimental/compiled.hex b/keyboard/ergodox_ez/keymaps/osx_de_experimental/compiled.hex index 0372ed8afa7..3fe28d5e550 100644 Binary files a/keyboard/ergodox_ez/keymaps/osx_de_experimental/compiled.hex and b/keyboard/ergodox_ez/keymaps/osx_de_experimental/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/osx_de_experimental/keymap.c b/keyboard/ergodox_ez/keymaps/osx_de_experimental/keymap.c index 19e539006ac..4a9ceb4ef77 100644 --- a/keyboard/ergodox_ez/keymaps/osx_de_experimental/keymap.c +++ b/keyboard/ergodox_ez/keymaps/osx_de_experimental/keymap.c @@ -1,19 +1,17 @@ #include "ergodox_ez.h" #include "debug.h" #include "action_layer.h" -#include "keymap_extras/keymap_french.h" -#include "keymap_extras/keymap_neo2.h" -#include "keymap_extras/keymap_uk.h" -#include "keymap_extras/keymap_colemak.h" -#include "keymap_extras/keymap_french_osx.h" -#include "keymap_extras/keymap_nordic.h" -#include "keymap_extras/keymap_dvorak.h" -#include "keymap_extras/keymap_german.h" -#include "keymap_extras/keymap_norwegian.c" -#include "keymap_extras/keymap_fr_ch.h" -#include "keymap_extras/keymap_german_osx.h" -#include "keymap_extras/keymap_spanish.h" -#include "keymap_extras/keymap_bepo.h" +#include "keymap_neo2.h" +#include "keymap_uk.h" +#include "keymap_colemak.h" +#include "keymap_nordic.h" +#include "keymap_dvorak.h" +#include "keymap_german.h" +#include "keymap_norwegian.c" +#include "keymap_fr_ch.h" +#include "keymap_german_osx.h" +#include "keymap_spanish.h" +#include "keymap_bepo.h" /** diff --git a/keyboard/ergodox_ez/keymaps/osx_fr/keymap.c b/keyboard/ergodox_ez/keymaps/osx_fr/keymap.c index f1806ffffb9..de951666dd9 100644 --- a/keyboard/ergodox_ez/keymaps/osx_fr/keymap.c +++ b/keyboard/ergodox_ez/keymaps/osx_fr/keymap.c @@ -2,7 +2,7 @@ #include "ergodox_ez.h" #include "debug.h" #include "action_layer.h" -#include "keymap_extras/keymap_french_osx.h" +#include "keymap_french_osx.h" #define BASE 0 // default layer #define SYMB 1 // symbols diff --git a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-osx/compiled.hex b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-osx/compiled.hex index 0cc546325ed..74449a95576 100644 Binary files a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-osx/compiled.hex and b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-osx/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-osx/keymap.c b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-osx/keymap.c index e23c5a1d6af..a66971befd8 100644 --- a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-osx/keymap.c +++ b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-osx/keymap.c @@ -30,6 +30,7 @@ const uint16_t PROGMEM fn_actions[] = { }; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE; }; // Runs just one time when the keyboard initializes. diff --git a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/compiled.hex b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/compiled.hex index 439d7639c42..1debb026a14 100644 Binary files a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/compiled.hex and b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c index dd946c1823f..dedac694e42 100644 --- a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c +++ b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c @@ -50,6 +50,7 @@ const uint16_t PROGMEM fn_actions[] = { }; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE; }; // Runs just one time when the keyboard initializes. diff --git a/keyboard/ergodox_ez/keymaps/townk_osx/compiled.hex b/keyboard/ergodox_ez/keymaps/townk_osx/compiled.hex index ea088861a25..c8db30edfd8 100644 Binary files a/keyboard/ergodox_ez/keymaps/townk_osx/compiled.hex and b/keyboard/ergodox_ez/keymaps/townk_osx/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/townk_osx/config.h b/keyboard/ergodox_ez/keymaps/townk_osx/config.h index 78aa3ee8b92..58ba690afd1 100644 --- a/keyboard/ergodox_ez/keymaps/townk_osx/config.h +++ b/keyboard/ergodox_ez/keymaps/townk_osx/config.h @@ -74,7 +74,7 @@ along with this program. If not, see . */ /* disable debug print */ -#define NO_DEBUG +// #define NO_DEBUG /* disable print */ // #define NO_PRINT diff --git a/keyboard/ergodox_ez/keymaps/workman_osx_mdw/compiled.hex b/keyboard/ergodox_ez/keymaps/workman_osx_mdw/compiled.hex index 72b215f0f6b..8bde2f29dab 100644 Binary files a/keyboard/ergodox_ez/keymaps/workman_osx_mdw/compiled.hex and b/keyboard/ergodox_ez/keymaps/workman_osx_mdw/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/workman_osx_mdw/keymap.c b/keyboard/ergodox_ez/keymaps/workman_osx_mdw/keymap.c index 05800a00c60..c9c0f4c279e 100644 --- a/keyboard/ergodox_ez/keymaps/workman_osx_mdw/keymap.c +++ b/keyboard/ergodox_ez/keymaps/workman_osx_mdw/keymap.c @@ -333,7 +333,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) default: return MACRO_NONE; } - + return MACRO_NONE; }; // Runs just one time when the keyboard initializes. diff --git a/keyboard/jd45/Makefile b/keyboard/jd45/Makefile index 81b4d9379a0..75d544f16aa 100644 --- a/keyboard/jd45/Makefile +++ b/keyboard/jd45/Makefile @@ -1,8 +1,5 @@ -# # project specific files -SRC = backlight.c - # MCU name #MCU = at90usb1287 MCU = atmega32u4 diff --git a/keyboard/jd45/backlight.c b/keyboard/jd45/backlight.c deleted file mode 100644 index f69364b2afb..00000000000 --- a/keyboard/jd45/backlight.c +++ /dev/null @@ -1,61 +0,0 @@ - -#include -#include "backlight.h" - -#define CHANNEL OCR1C - -void backlight_init_ports() -{ - - // Setup PB7 as output and output low. - DDRB |= (1<<7); - PORTB &= ~(1<<7); - - // Use full 16-bit resolution. - ICR1 = 0xFFFF; - - // I could write a wall of text here to explain... but TL;DW - // Go read the ATmega32u4 datasheet. - // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on - - // Pin PB7 = OCR1C (Timer 1, Channel C) - // Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0 - // (i.e. start high, go low when counter matches.) - // WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0 - // Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1 - - TCCR1A = _BV(COM1C1) | _BV(WGM11); // = 0b00001010; - TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; - - backlight_init(); -} - -void backlight_set(uint8_t level) -{ - if ( level == 0 ) - { - // Turn off PWM control on PB7, revert to output low. - TCCR1A &= ~(_BV(COM1C1)); - CHANNEL = 0x0; - // Prevent backlight blink on lowest level - PORTB &= ~(_BV(PORTB7)); - } - else if ( level == BACKLIGHT_LEVELS ) - { - // Prevent backlight blink on lowest level - PORTB &= ~(_BV(PORTB7)); - // Turn on PWM control of PB7 - TCCR1A |= _BV(COM1C1); - // Set the brightness - CHANNEL = 0xFFFF; - } - else - { - // Prevent backlight blink on lowest level - PORTB &= ~(_BV(PORTB7)); - // Turn on PWM control of PB7 - TCCR1A |= _BV(COM1C1); - // Set the brightness - CHANNEL = 0xFFFF >> ((BACKLIGHT_LEVELS - level) * ((BACKLIGHT_LEVELS + 1) / 2)); - } -} \ No newline at end of file diff --git a/keyboard/jd45/jd45.c b/keyboard/jd45/jd45.c index bc3fcd3ddfe..5437b2bffc7 100644 --- a/keyboard/jd45/jd45.c +++ b/keyboard/jd45/jd45.c @@ -10,18 +10,72 @@ void matrix_scan_user(void) { }; +#define CHANNEL OCR1C + +void backlight_init_ports(void) +{ + + // Setup PB7 as output and output low. + DDRB |= (1<<7); + PORTB &= ~(1<<7); + + // Use full 16-bit resolution. + ICR1 = 0xFFFF; + + // I could write a wall of text here to explain... but TL;DW + // Go read the ATmega32u4 datasheet. + // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on + + // Pin PB7 = OCR1C (Timer 1, Channel C) + // Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0 + // (i.e. start high, go low when counter matches.) + // WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0 + // Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1 + + TCCR1A = _BV(COM1C1) | _BV(WGM11); // = 0b00001010; + TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; + + backlight_init(); +} + +void backlight_set(uint8_t level) +{ + if ( level == 0 ) + { + // Turn off PWM control on PB7, revert to output low. + TCCR1A &= ~(_BV(COM1C1)); + CHANNEL = 0x0; + // Prevent backlight blink on lowest level + PORTB &= ~(_BV(PORTB7)); + } + else if ( level == BACKLIGHT_LEVELS ) + { + // Prevent backlight blink on lowest level + PORTB &= ~(_BV(PORTB7)); + // Turn on PWM control of PB7 + TCCR1A |= _BV(COM1C1); + // Set the brightness + CHANNEL = 0xFFFF; + } + else + { + // Prevent backlight blink on lowest level + PORTB &= ~(_BV(PORTB7)); + // Turn on PWM control of PB7 + TCCR1A |= _BV(COM1C1); + // Set the brightness + CHANNEL = 0xFFFF >> ((BACKLIGHT_LEVELS - level) * ((BACKLIGHT_LEVELS + 1) / 2)); + } +} + void matrix_init_kb(void) { #ifdef BACKLIGHT_ENABLE backlight_init_ports(); #endif - if (matrix_init_user) { - (*matrix_init_user)(); - } + matrix_init_user(); }; void matrix_scan_kb(void) { - if (matrix_scan_user) { - (*matrix_scan_user)(); - } + matrix_scan_user(); }; diff --git a/keyboard/jd45/jd45.h b/keyboard/jd45/jd45.h index 54b6641b210..1e9de2123b2 100644 --- a/keyboard/jd45/jd45.h +++ b/keyboard/jd45/jd45.h @@ -5,6 +5,7 @@ #include "keymap.h" #include "backlight.h" #include +#include void matrix_init_user(void); void matrix_scan_user(void); diff --git a/keyboard/jd45/keymaps/default/compiled.hex b/keyboard/jd45/keymaps/default/compiled.hex index ea8cb1aaeee..cc20ee3c534 100644 Binary files a/keyboard/jd45/keymaps/default/compiled.hex and b/keyboard/jd45/keymaps/default/compiled.hex differ diff --git a/keyboard/jd45/keymaps/justin/compiled.hex b/keyboard/jd45/keymaps/justin/compiled.hex index 9bfb07db457..3f0ab6524be 100644 Binary files a/keyboard/jd45/keymaps/justin/compiled.hex and b/keyboard/jd45/keymaps/justin/compiled.hex differ diff --git a/keyboard/phantom/keymaps/default/compiled.hex b/keyboard/phantom/keymaps/default/compiled.hex index 37bbfb5551f..5ee1e08d930 100644 Binary files a/keyboard/phantom/keymaps/default/compiled.hex and b/keyboard/phantom/keymaps/default/compiled.hex differ diff --git a/keyboard/phantom/led.c b/keyboard/phantom/led.c index e45cc096484..b2459c77433 100644 --- a/keyboard/phantom/led.c +++ b/keyboard/phantom/led.c @@ -19,8 +19,7 @@ along with this program. If not, see . #include "stdint.h" #include "led.h" - -void led_init_ports() { +void led_init(void) { // * Set our LED pins as output DDRB |= (1<<6); DDRB |= (1<<7); diff --git a/keyboard/phantom/phantom.c b/keyboard/phantom/phantom.c index 4328539d072..30fef63c688 100644 --- a/keyboard/phantom/phantom.c +++ b/keyboard/phantom/phantom.c @@ -1,4 +1,5 @@ #include "phantom.h" +#include "led.h" __attribute__ ((weak)) void matrix_init_user(void) { @@ -13,16 +14,12 @@ void matrix_scan_user(void) { void matrix_init_kb(void) { // put your keyboard start-up code here // runs once when the firmware starts up - if (matrix_init_user) { - (*matrix_init_user)(); - } + matrix_init_user(); led_init_ports(); }; void matrix_scan_kb(void) { // put your looping keyboard code here // runs every cycle (a lot) - if (matrix_scan_user) { - (*matrix_scan_user)(); - } + matrix_scan_user(); }; diff --git a/keyboard/phantom/phantom.h b/keyboard/phantom/phantom.h index b458e32f5c9..d7eb8c5a3de 100644 --- a/keyboard/phantom/phantom.h +++ b/keyboard/phantom/phantom.h @@ -4,7 +4,7 @@ #include "matrix.h" #include "keymap.h" #include - +#include "action_util.h" /* Phantom matrix layout * ,-----------------------------------------------------------------------------. diff --git a/keyboard/planck/keymaps/experimental/compiled.hex b/keyboard/planck/keymaps/experimental/compiled.hex index 76984a07cc2..84005069960 100644 Binary files a/keyboard/planck/keymaps/experimental/compiled.hex and b/keyboard/planck/keymaps/experimental/compiled.hex differ diff --git a/keyboard/planck/keymaps/experimental/config.h b/keyboard/planck/keymaps/experimental/config.h new file mode 100644 index 00000000000..a9117e0eeab --- /dev/null +++ b/keyboard/planck/keymaps/experimental/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#define LEADER_TIMEOUT 300 + +#endif diff --git a/keyboard/planck/keymaps/experimental/keymap.c b/keyboard/planck/keymaps/experimental/keymap.c index 2be5a807919..041285684ab 100644 --- a/keyboard/planck/keymaps/experimental/keymap.c +++ b/keyboard/planck/keymaps/experimental/keymap.c @@ -321,8 +321,6 @@ void music_scale_user(void) LEADER_EXTERNS(); -#define LEADER_TIMEOUT 300 - void matrix_scan_user(void) { LEADER_DICTIONARY() { leading = false; diff --git a/keyboard/planck/keymaps/lucas/compiled.hex b/keyboard/planck/keymaps/lucas/compiled.hex index 26fc8ee0cd0..13e872aa6d7 100644 Binary files a/keyboard/planck/keymaps/lucas/compiled.hex and b/keyboard/planck/keymaps/lucas/compiled.hex differ diff --git a/keyboard/planck/keymaps/lucas/keymap.c b/keyboard/planck/keymaps/lucas/keymap.c index 1a650952c53..7ac9c5cd089 100644 --- a/keyboard/planck/keymaps/lucas/keymap.c +++ b/keyboard/planck/keymaps/lucas/keymap.c @@ -12,6 +12,7 @@ If you have any question about this keymap feel free to shoot me a message on re #include "keymap_extras/keymap_german.h" #include "backlight.h" #include "debug.h" +#include "action_layer.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = { /* Colemak @@ -111,7 +112,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_NO, KC_NO, KC_TAB, KC_LALT, KC_NO, KC_SPC, KC_SPC, LCTL(KC_SPC), KC_LGUI, KC_LEFT, KC_DOWN, KC_RGHT} }, [6] = { /* Gaming - /* CS:GO buy binds + * CS:GO buy binds * ,-----------------------------------------------------------------------. * | | | | | | | | | 7 | 8 | 9 | | * |-----------------------------------------------------------------------| diff --git a/keyboard/planck/keymaps/unicode/compiled.hex b/keyboard/planck/keymaps/unicode/compiled.hex index a32eb3a4a9a..ad950127649 100644 Binary files a/keyboard/planck/keymaps/unicode/compiled.hex and b/keyboard/planck/keymaps/unicode/compiled.hex differ diff --git a/keyboard/planck/planck.h b/keyboard/planck/planck.h index 8aec6b26278..0e641c27ee7 100644 --- a/keyboard/planck/planck.h +++ b/keyboard/planck/planck.h @@ -2,6 +2,7 @@ #define PLANCK_H #include "quantum.h" +#include #define PLANCK_MIT( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ diff --git a/keyboard/preonic/keymaps/default/compiled.hex b/keyboard/preonic/keymaps/default/compiled.hex index dfadd031ea7..a988ab756cb 100644 Binary files a/keyboard/preonic/keymaps/default/compiled.hex and b/keyboard/preonic/keymaps/default/compiled.hex differ diff --git a/keyboard/preonic/keymaps/default/keymap.c b/keyboard/preonic/keymaps/default/keymap.c index 06e6647136d..4c967d73edf 100644 --- a/keyboard/preonic/keymaps/default/keymap.c +++ b/keyboard/preonic/keymaps/default/keymap.c @@ -164,18 +164,20 @@ const uint16_t PROGMEM fn_actions[] = { }; #ifdef AUDIO_ENABLE -float start_up[][2] = { - {440.0*pow(2.0,(14)/12.0), 20}, - {440.0*pow(2.0,(26)/12.0), 8}, - {440.0*pow(2.0,(18)/12.0), 20}, - {440.0*pow(2.0,(26)/12.0), 8} +float tone_startup[][2] = { + {NOTE_B5, 20}, + {NOTE_B6, 8}, + {NOTE_DS6, 20}, + {NOTE_B6, 8} }; float tone_qwerty[][2] = SONG(QWERTY_SOUND); float tone_dvorak[][2] = SONG(DVORAK_SOUND); float tone_colemak[][2] = SONG(COLEMAK_SOUND); -float goodbye[][2] = SONG(GOODBYE_SOUND); +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); + +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); #endif void persistant_default_layer_set(uint16_t default_layer) { @@ -242,20 +244,35 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) return MACRO_NONE; }; - void matrix_init_user(void) { - #ifdef AUDIO_ENABLE - _delay_ms(20); // gets rid of tick - PLAY_NOTE_ARRAY(start_up, false, 0); - #endif + #ifdef AUDIO_ENABLE + startup_user(); + #endif } #ifdef AUDIO_ENABLE -void play_goodbye_tone() +void startup_user() { - PLAY_NOTE_ARRAY(goodbye, false, 0); - _delay_ms(150); + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); } #endif \ No newline at end of file diff --git a/keyboard/preonic/preonic.h b/keyboard/preonic/preonic.h index feb87977440..2b605f37425 100644 --- a/keyboard/preonic/preonic.h +++ b/keyboard/preonic/preonic.h @@ -36,5 +36,6 @@ void matrix_init_user(void); void matrix_scan_user(void); bool process_action_kb(keyrecord_t *record); +void backlight_init_ports(void); #endif diff --git a/keyboard/satan/led.c b/keyboard/satan/led.c index 5a9f2af672b..94606e89594 100644 --- a/keyboard/satan/led.c +++ b/keyboard/satan/led.c @@ -20,7 +20,7 @@ along with this program. If not, see . #include "led.h" -void led_init_ports() { +void led_init_ports(void) { // * Set our LED pins as output DDRB |= (1<<2); } diff --git a/keyboard/satan/satan.h b/keyboard/satan/satan.h index 12dec26a1ca..464289fdbd2 100644 --- a/keyboard/satan/satan.h +++ b/keyboard/satan/satan.h @@ -4,7 +4,7 @@ #include "matrix.h" #include "keymap.h" #include - +#include "action_util.h" /* Clueboard matrix layout * ,-----------------------------------------------------------. diff --git a/quantum/keymap.h b/quantum/keymap.h index 43efab7f3fb..6ac3d2ace6f 100644 --- a/quantum/keymap.h +++ b/quantum/keymap.h @@ -294,10 +294,10 @@ enum quantum_keycodes { #define SFT_T(kc) MT(MOD_LSFT, kc) #define ALT_T(kc) MT(MOD_LALT, kc) #define GUI_T(kc) MT(MOD_LGUI, kc) -#define C_S_T(kc) MT(MOD_LCTL | MOD_LSFT, kc) // Control + Shift e.g. for gnome-terminal -#define MEH_T(kc) MT(MOD_LCTL | MOD_LSFT | MOD_LALT, kc) // Meh is a less hyper version of the Hyper key -- doesn't include Win or Cmd, so just alt+shift+ctrl -#define LCAG_T(kc) MT(MOD_LCTL | MOD_LALT | MOD_LGUI, kc) // Left control alt and gui -#define ALL_T(kc) MT(MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI, kc) // see http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/ +#define C_S_T(kc) MT((MOD_LCTL | MOD_LSFT), kc) // Control + Shift e.g. for gnome-terminal +#define MEH_T(kc) MT((MOD_LCTL | MOD_LSFT | MOD_LALT), kc) // Meh is a less hyper version of the Hyper key -- doesn't include Win or Cmd, so just alt+shift+ctrl +#define LCAG_T(kc) MT((MOD_LCTL | MOD_LALT | MOD_LGUI), kc) // Left control alt and gui +#define ALL_T(kc) MT((MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI), kc) // see http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/ // Dedicated keycode versions for Hyper and Meh, if you want to use them as standalone keys rather than mod-tap #define KC_HYPR HYPR(KC_NO) diff --git a/quantum/keymap_extras/keymap_german_osx.h b/quantum/keymap_extras/keymap_german_osx.h index b2040a278a9..f63f066183d 100644 --- a/quantum/keymap_extras/keymap_german_osx.h +++ b/quantum/keymap_extras/keymap_german_osx.h @@ -1,9 +1,6 @@ #ifndef KEYMAP_GERMAN_OSX #define KEYMAP_GERMAN_OSX -#ifdef KEYMAP_GERMAN - #warning redefining german keys -#endif #include "keymap.h" // Alt gr diff --git a/quantum/led.c b/quantum/led.c index 208e348f345..2634ab2f61e 100644 --- a/quantum/led.c +++ b/quantum/led.c @@ -24,6 +24,12 @@ void led_set_kb(uint8_t usb_led) { } +__attribute__ ((weak)) +void led_init_ports(void) +{ + +} + __attribute__ ((weak)) void led_set(uint8_t usb_led) { diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 8c9ad773645..c29ffedc38c 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -42,7 +42,7 @@ void sethsv(uint16_t hue, uint8_t sat, uint8_t val, struct cRGB *led1) { The DIM_CURVE is used only on brightness/value and on saturation (inverted). This looks the most natural. */ - uint8_t r, g, b; + uint8_t r = 0, g = 0, b = 0; val = pgm_read_byte(&DIM_CURVE[val]); sat = 255 - pgm_read_byte(&DIM_CURVE[255 - sat]); @@ -154,7 +154,7 @@ void rgblight_init(void) { } void rgblight_increase(void) { - uint8_t mode; + uint8_t mode = 0; if (rgblight_config.mode < RGBLIGHT_MODES) { mode = rgblight_config.mode + 1; } @@ -162,7 +162,7 @@ void rgblight_increase(void) { } void rgblight_decrease(void) { - uint8_t mode; + uint8_t mode = 0; if (rgblight_config.mode > 1) { //mode will never < 1, if mode is less than 1, eeprom need to be initialized. mode = rgblight_config.mode-1; } @@ -170,7 +170,7 @@ void rgblight_decrease(void) { } void rgblight_step(void) { - uint8_t mode; + uint8_t mode = 0; mode = rgblight_config.mode + 1; if (mode > RGBLIGHT_MODES) { mode = 1; diff --git a/quantum/rgblight.h b/quantum/rgblight.h index 37e207578ca..64f92523e03 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -64,7 +64,6 @@ void rgblight_decrease_val(void); void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val); void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b); -#define EECONFIG_RGBLIGHT (uint8_t *)7 uint32_t eeconfig_read_rgblight(void); void eeconfig_update_rgblight(uint32_t val); void eeconfig_update_rgblight_default(void); diff --git a/tmk_core/common/avr/eeconfig.c b/tmk_core/common/avr/eeconfig.c index c5391f5cf5a..656938fb333 100644 --- a/tmk_core/common/avr/eeconfig.c +++ b/tmk_core/common/avr/eeconfig.c @@ -14,7 +14,10 @@ void eeconfig_init(void) eeprom_update_byte(EECONFIG_BACKLIGHT, 0); #endif #ifdef AUDIO_ENABLE - eeprom_update_byte(EECONFIG_AUDIO, 0xFF); // On by default + eeprom_update_byte(EECONFIG_AUDIO, 0xFF); // On by default +#endif +#ifdef RGBLIGHT_ENABLE + eeprom_update_dword(EECONFIG_RGBLIGHT, 0); #endif } diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c index 024d7c67a33..187a2b9496d 100644 --- a/tmk_core/common/command.c +++ b/tmk_core/common/command.c @@ -66,7 +66,6 @@ static bool mousekey_console(uint8_t code); static void mousekey_console_help(void); #endif -static uint8_t numkey2num(uint8_t code); static void switch_default_layer(uint8_t layer); @@ -763,7 +762,7 @@ static bool mousekey_console(uint8_t code) /*********************************************************** * Utilities ***********************************************************/ -static uint8_t numkey2num(uint8_t code) +uint8_t numkey2num(uint8_t code) { switch (code) { case KC_1: return 1; diff --git a/tmk_core/common/command.h b/tmk_core/common/command.h index 92b18849bf3..a729e4b1e43 100644 --- a/tmk_core/common/command.h +++ b/tmk_core/common/command.h @@ -27,6 +27,7 @@ bool command_extra(uint8_t code); bool command_console_extra(uint8_t code); #ifdef COMMAND_ENABLE +uint8_t numkey2num(uint8_t code); bool command_proc(uint8_t code); #else #define command_proc(code) false diff --git a/tmk_core/common/eeconfig.h b/tmk_core/common/eeconfig.h index ca47e0d2fd9..d8caa346f9d 100644 --- a/tmk_core/common/eeconfig.h +++ b/tmk_core/common/eeconfig.h @@ -32,6 +32,7 @@ along with this program. If not, see . #define EECONFIG_MOUSEKEY_ACCEL (uint8_t *)5 #define EECONFIG_BACKLIGHT (uint8_t *)6 #define EECONFIG_AUDIO (uint8_t *)7 +#define EECONFIG_RGBLIGHT (uint32_t *)8 /* debug bit */ diff --git a/tmk_core/common/led.h b/tmk_core/common/led.h index 2e18dc2afaa..9dc89878025 100644 --- a/tmk_core/common/led.h +++ b/tmk_core/common/led.h @@ -37,6 +37,9 @@ void led_set(uint8_t usb_led); /* keyboard-specific LED functionality */ void led_set_kb(uint8_t usb_led); + +void led_init_ports(void); + #ifdef __cplusplus } #endif diff --git a/tmk_core/protocol/lufa/bluetooth.c b/tmk_core/protocol/lufa/bluetooth.c index ed66e52c1fd..549606162db 100644 --- a/tmk_core/protocol/lufa/bluetooth.c +++ b/tmk_core/protocol/lufa/bluetooth.c @@ -19,7 +19,6 @@ along with this program. If not, see . #include "report.h" #include "print.h" #include "debug.h" -#include "../serial.h" #include "bluetooth.h" void bluefruit_keyboard_print_report(report_keyboard_t *report) diff --git a/tmk_core/protocol/lufa/bluetooth.h b/tmk_core/protocol/lufa/bluetooth.h index 01f07e8e678..78ece1cd0b4 100644 --- a/tmk_core/protocol/lufa/bluetooth.h +++ b/tmk_core/protocol/lufa/bluetooth.h @@ -18,6 +18,8 @@ along with this program. If not, see . #ifndef BLUETOOTH_H #define BLUETOOTH_H +#include "../serial.h" + void bluefruit_serial_send(uint8_t data); /* diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index d9a0fd33f36..e9ef5ca7b5b 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -632,17 +632,34 @@ all-keyboards-defaults-%: all-keyboards-defaults: all-keyboards-defaults-all KEYBOARDS := $(SUBDIRS:$(TOP_DIR)/keyboard/%/=/keyboard/%) -all-keyboards-%: $(KEYBOARDS) -/keyboard/%: - $(eval KEYBOARD=$(patsubst /keyboard/%,%,$@)) - $(eval KEYMAPS=$(notdir $(patsubst %/.,%,$(wildcard $(TOP_DIR)$@/keymaps/*/.)))) - @for x in $(KEYMAPS) ; do \ - printf "Compiling $(BOLD)$(KEYBOARD)$(NO_COLOR) with $(BOLD)$$x$(NO_COLOR)" | $(AWK) '{ printf "%-88s", $$0; }'; \ - LOG=$$($(MAKE) -C $(TOP_DIR)$@ $(subst all-keyboards-,,$@) keymap=$$x VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=true 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR_PLAIN); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING_PLAIN); else $(PRINT_OK); fi; \ - done - +all-keyboards-all: $(addsuffix -all,$(KEYBOARDS)) +all-keyboards-quick: $(addsuffix -quick,$(KEYBOARDS)) +all-keyboards-clean: $(addsuffix -clean,$(KEYBOARDS)) all-keyboards: all-keyboards-all +define make_keyboard +$(eval KEYBOARD=$(patsubst /keyboard/%,%,$1)) +$(eval KEYMAPS=$(notdir $(patsubst %/.,%,$(wildcard $(TOP_DIR)$1/keymaps/*/.)))) +@for x in $(KEYMAPS) ; do \ + printf "Compiling $(BOLD)$(KEYBOARD)$(NO_COLOR) with $(BOLD)$$x$(NO_COLOR)" | $(AWK) '{ printf "%-88s", $$0; }'; \ + LOG=$$($(MAKE) -C $(TOP_DIR)$1 $2 keymap=$$x VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=true 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR_PLAIN); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING_PLAIN); else $(PRINT_OK); fi; \ +done +endef + +define make_keyboard_helper +# Just remove the -quick, -all and so on from the first argument and pass it forward +$(call make_keyboard,$(subst -$2,,$1),$2) +endef + +/keyboard/%-quick: + $(call make_keyboard_helper,$@,quick) +/keyboard/%-all: + $(call make_keyboard_helper,$@,all) +/keyboard/%-clean: + $(call make_keyboard_helper,$@,clean) +/keyboard/%: + $(call make_keyboard_helper,$@,all) + all-keymaps-%: $(eval MAKECONFIG=$(call get_target,all-keymaps,$@)) $(eval KEYMAPS=$(notdir $(patsubst %/.,%,$(wildcard $(TOP_DIR)/keyboard/$(KEYBOARD)/keymaps/*/.))))