diff --git a/keyboard/atomic/atomic.h b/keyboard/atomic/atomic.h index 456c3fbdf8..901761f514 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 dde3b840ba..b9bb143ea8 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 e88c338e5b..31008c426e 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 a641210af8..aee94c5831 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 a5b9e9ba4a..3f42f6272e 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 46005b533e..e9648ede7d 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 8150f559b5..dcac1fe29d 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 33a0480c94..6eb864b447 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 314c2ec32b..e5d7fe1885 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 93d1c84bc5..04ad2a8167 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 af29caaab7..501f14f9fb 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 18939b1923..778cbc63cf 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 b1f6aabf91..2233a8cbfe 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 174f26cbe5..554813d7e8 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 715b5acec4..3351a628fe 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 72ed195eb7..20b085ed44 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 0372ed8afa..3fe28d5e55 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 19e539006a..4a9ceb4ef7 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 f1806ffffb..de951666dd 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 0cc546325e..74449a9557 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 e23c5a1d6a..a66971befd 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 439d7639c4..1debb026a1 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 dd946c1823..dedac694e4 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 ea088861a2..c8db30edfd 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 78aa3ee8b9..58ba690afd 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 72b215f0f6..8bde2f29da 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 05800a00c6..c9c0f4c279 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 81b4d9379a..75d544f16a 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 f69364b2af..0000000000 --- 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 bc3fcd3ddf..5437b2bffc 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 54b6641b21..1e9de2123b 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 ea8cb1aaee..cc20ee3c53 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 9bfb07db45..3f0ab6524b 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 37bbfb5551..5ee1e08d93 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 e45cc09648..b2459c7743 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 4328539d07..30fef63c68 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 b458e32f5c..d7eb8c5a3d 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 76984a07cc..8400506996 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 0000000000..a9117e0eea --- /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 2be5a80791..041285684a 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 26fc8ee0cd..13e872aa6d 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 1a650952c5..7ac9c5cd08 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 a32eb3a4a9..ad95012764 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 8aec6b2627..0e641c27ee 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 dfadd031ea..a988ab756c 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 06e6647136..4c967d73ed 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 feb8797744..2b605f3742 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/quantum/keymap.h b/quantum/keymap.h index 43efab7f3f..6ac3d2ace6 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 b2040a278a..f63f066183 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 208e348f34..2634ab2f61 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/tmk_core/common/command.c b/tmk_core/common/command.c index 024d7c67a3..187a2b9496 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 92b18849bf..a729e4b1e4 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/led.h b/tmk_core/common/led.h index 2e18dc2afa..9dc8987802 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 ed66e52c1f..549606162d 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 01f07e8e67..78ece1cd0b 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); /*