example_keyboards
Christopher Browne 9 years ago
commit ee3c7892ad

4
Vagrantfile vendored

@ -5,10 +5,10 @@ Vagrant.configure(2) do |config|
# You can only have one config.vm.box uncommented at a time # 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 # 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 # VMware/Virtualbox 64 bit
# config.vm.box = "phusion/ubuntu-14.04-amd64" config.vm.box = "phusion/ubuntu-14.04-amd64"
# #
# VMware/Virtualbox 64 bit # VMware/Virtualbox 64 bit
#config.vm.box = "puphpet/centos65-x64" #config.vm.box = "puphpet/centos65-x64"

@ -4,6 +4,7 @@
#include "quantum.h" #include "quantum.h"
#include <stddef.h> #include <stddef.h>
#include <avr/io.h> #include <avr/io.h>
#include <avr/interrupt.h>
// This a shortcut to help you visually see your layout. // This a shortcut to help you visually see your layout.
// The following is an example using the Planck MIT layout // The following is an example using the Planck MIT layout

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -202,7 +202,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
break; break;
case MACRO_PARENTHESE: case MACRO_PARENTHESE:
if (record->event.pressed) { 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; break;
} }

File diff suppressed because it is too large Load Diff

@ -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(OBRACE), KC_SLSH,KC_Q, KC_J, KC_K, KC_X, KC_LGUI,
M(OBRACK), KC_HOME,KC_PGDN,KC_PGUP,KC_END, M(OBRACK), KC_HOME,KC_PGDN,KC_PGUP,KC_END,
LCAG_T(KC_F5), LT(AUX, KC_F6), 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), KC_ENT,KC_TAB,MT((MOD_LALT | MOD_LSFT), KC_F3),
// right hand // right hand
KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, 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_RALT, KC_B, KC_M, KC_W, KC_V, KC_Z, M(CBRACE),
KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,M(CBRACK), KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,M(CBRACK),
LT(AUX, KC_F7), LCAG_T(KC_F8), LT(AUX, KC_F7), LCAG_T(KC_F8),
MT(MOD_LALT | MOD_LCTL, KC_F11), MT((MOD_LALT | MOD_LCTL), KC_F11),
MT(MOD_LALT | MOD_LSFT, KC_F12),KC_BSPC, KC_SPC MT((MOD_LALT | MOD_LSFT), KC_F12),KC_BSPC, KC_SPC
), ),
/* Keymap 1: Aux layer /* 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(OBRACE), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI,
M(OBRACK), KC_HOME,KC_PGDN,KC_PGUP,KC_END, M(OBRACK), KC_HOME,KC_PGDN,KC_PGUP,KC_END,
LCAG_T(KC_F5), KC_TRNS, 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, KC_ENT,KC_TAB,KC_TRNS,
// right hand // right hand
KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, 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_RALT, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,M(CBRACE),
KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,M(CBRACK), KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,M(CBRACK),
KC_TRNS, LCAG_T(KC_F8), KC_TRNS, LCAG_T(KC_F8),
MT(MOD_LALT | MOD_LCTL, KC_F11), MT((MOD_LALT | MOD_LCTL), KC_F11),
MT(MOD_LALT | MOD_LSFT, KC_F12),KC_BSPC, KC_SPC MT((MOD_LALT | MOD_LSFT), KC_F12),KC_BSPC, KC_SPC
), ),
}; };

@ -6,4 +6,7 @@
#define ONESHOT_TAP_TOGGLE 2 #define ONESHOT_TAP_TOGGLE 2
#define ONESHOT_TIMEOUT 300 #define ONESHOT_TIMEOUT 300
#undef LEADER_TIMEOUT
#define LEADER_TIMEOUT 300
#endif #endif

@ -7,8 +7,6 @@
#define SYMB 1 // symbols #define SYMB 1 // symbols
#define MDIA 2 // media keys #define MDIA 2 // media keys
#define LEADER_TIMEOUT 300
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 0: Basic layer /* Keymap 0: Basic layer
* *
@ -144,8 +142,6 @@ const uint16_t PROGMEM fn_actions[] = {
[3] = ACTION_MACRO_TAP(1) // Eric Tang's Famous Macro! [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) const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{ {
return MACRO_NONE; return MACRO_NONE;

File diff suppressed because it is too large Load Diff

@ -3,6 +3,7 @@
#include "debug.h" #include "debug.h"
#include "action_layer.h" #include "action_layer.h"
#include "action_util.h" #include "action_util.h"
#include "mousekey.h"
#define BASE 0 // default layer #define BASE 0 // default layer
#define SYMB 1 // symbols layer #define SYMB 1 // symbols layer

File diff suppressed because it is too large Load Diff

@ -1,19 +1,7 @@
#include "ergodox_ez.h" #include "ergodox_ez.h"
#include "debug.h" #include "debug.h"
#include "action_layer.h" #include "action_layer.h"
#include "keymap_extras/keymap_french.h" #include "keymap_german_osx.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"
#define BASE 0 #define BASE 0
#define SYMB 1 #define SYMB 1

File diff suppressed because it is too large Load Diff

@ -1,19 +1,19 @@
#include "ergodox_ez.h" #include "ergodox_ez.h"
#include "debug.h" #include "debug.h"
#include "action_layer.h" #include "action_layer.h"
#include "keymap_extras/keymap_french.h"
#include "keymap_extras/keymap_neo2.h" #include "keymap_neo2.h"
#include "keymap_extras/keymap_uk.h" #include "keymap_uk.h"
#include "keymap_extras/keymap_colemak.h" #include "keymap_colemak.h"
#include "keymap_extras/keymap_french_osx.h" #include "keymap_french_osx.h"
#include "keymap_extras/keymap_nordic.h" #include "keymap_nordic.h"
#include "keymap_extras/keymap_dvorak.h" #include "keymap_dvorak.h"
#include "keymap_extras/keymap_german.h" #include "keymap_german.h"
#include "keymap_extras/keymap_norwegian.c" #include "keymap_norwegian.c"
#include "keymap_extras/keymap_fr_ch.h" #include "keymap_fr_ch.h"
#include "keymap_extras/keymap_german_osx.h" #include "keymap_german_osx.h"
#include "keymap_extras/keymap_spanish.h" #include "keymap_spanish.h"
#include "keymap_extras/keymap_bepo.h" #include "keymap_bepo.h"
#define BASE 0 #define BASE 0
#define SYMB 1 #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) const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{ {
static uint16_t start;
switch(id) { switch(id) {
case UNUSED: case UNUSED:
//Macro: UNUSED//----------------------- //Macro: UNUSED//-----------------------

File diff suppressed because it is too large Load Diff

@ -1,19 +1,17 @@
#include "ergodox_ez.h" #include "ergodox_ez.h"
#include "debug.h" #include "debug.h"
#include "action_layer.h" #include "action_layer.h"
#include "keymap_extras/keymap_french.h" #include "keymap_neo2.h"
#include "keymap_extras/keymap_neo2.h" #include "keymap_uk.h"
#include "keymap_extras/keymap_uk.h" #include "keymap_colemak.h"
#include "keymap_extras/keymap_colemak.h" #include "keymap_nordic.h"
#include "keymap_extras/keymap_french_osx.h" #include "keymap_dvorak.h"
#include "keymap_extras/keymap_nordic.h" #include "keymap_german.h"
#include "keymap_extras/keymap_dvorak.h" #include "keymap_norwegian.c"
#include "keymap_extras/keymap_german.h" #include "keymap_fr_ch.h"
#include "keymap_extras/keymap_norwegian.c" #include "keymap_german_osx.h"
#include "keymap_extras/keymap_fr_ch.h" #include "keymap_spanish.h"
#include "keymap_extras/keymap_german_osx.h" #include "keymap_bepo.h"
#include "keymap_extras/keymap_spanish.h"
#include "keymap_extras/keymap_bepo.h"
/** /**

@ -2,7 +2,7 @@
#include "ergodox_ez.h" #include "ergodox_ez.h"
#include "debug.h" #include "debug.h"
#include "action_layer.h" #include "action_layer.h"
#include "keymap_extras/keymap_french_osx.h" #include "keymap_french_osx.h"
#define BASE 0 // default layer #define BASE 0 // default layer
#define SYMB 1 // symbols #define SYMB 1 // symbols

@ -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) { 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. // Runs just one time when the keyboard initializes.

@ -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) { 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. // Runs just one time when the keyboard initializes.

File diff suppressed because it is too large Load Diff

@ -74,7 +74,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* disable debug print */ /* disable debug print */
#define NO_DEBUG // #define NO_DEBUG
/* disable print */ /* disable print */
// #define NO_PRINT // #define NO_PRINT

File diff suppressed because it is too large Load Diff

@ -333,7 +333,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
default: default:
return MACRO_NONE; return MACRO_NONE;
} }
return MACRO_NONE;
}; };
// Runs just one time when the keyboard initializes. // Runs just one time when the keyboard initializes.

@ -1,8 +1,5 @@
# # project specific files
SRC = backlight.c
# MCU name # MCU name
#MCU = at90usb1287 #MCU = at90usb1287
MCU = atmega32u4 MCU = atmega32u4

@ -1,61 +0,0 @@
#include <avr/io.h>
#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));
}
}

@ -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) { void matrix_init_kb(void) {
#ifdef BACKLIGHT_ENABLE #ifdef BACKLIGHT_ENABLE
backlight_init_ports(); backlight_init_ports();
#endif #endif
if (matrix_init_user) { matrix_init_user();
(*matrix_init_user)();
}
}; };
void matrix_scan_kb(void) { void matrix_scan_kb(void) {
if (matrix_scan_user) { matrix_scan_user();
(*matrix_scan_user)();
}
}; };

@ -5,6 +5,7 @@
#include "keymap.h" #include "keymap.h"
#include "backlight.h" #include "backlight.h"
#include <stddef.h> #include <stddef.h>
#include <avr/io.h>
void matrix_init_user(void); void matrix_init_user(void);
void matrix_scan_user(void); void matrix_scan_user(void);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -19,8 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdint.h" #include "stdint.h"
#include "led.h" #include "led.h"
void led_init(void) {
void led_init_ports() {
// * Set our LED pins as output // * Set our LED pins as output
DDRB |= (1<<6); DDRB |= (1<<6);
DDRB |= (1<<7); DDRB |= (1<<7);

@ -1,4 +1,5 @@
#include "phantom.h" #include "phantom.h"
#include "led.h"
__attribute__ ((weak)) __attribute__ ((weak))
void matrix_init_user(void) { void matrix_init_user(void) {
@ -13,16 +14,12 @@ void matrix_scan_user(void) {
void matrix_init_kb(void) { void matrix_init_kb(void) {
// put your keyboard start-up code here // put your keyboard start-up code here
// runs once when the firmware starts up // runs once when the firmware starts up
if (matrix_init_user) { matrix_init_user();
(*matrix_init_user)();
}
led_init_ports(); led_init_ports();
}; };
void matrix_scan_kb(void) { void matrix_scan_kb(void) {
// put your looping keyboard code here // put your looping keyboard code here
// runs every cycle (a lot) // runs every cycle (a lot)
if (matrix_scan_user) { matrix_scan_user();
(*matrix_scan_user)();
}
}; };

@ -4,7 +4,7 @@
#include "matrix.h" #include "matrix.h"
#include "keymap.h" #include "keymap.h"
#include <stddef.h> #include <stddef.h>
#include "action_util.h"
/* Phantom matrix layout /* Phantom matrix layout
* ,-----------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------.

File diff suppressed because it is too large Load Diff

@ -0,0 +1,8 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
#define LEADER_TIMEOUT 300
#endif

@ -321,8 +321,6 @@ void music_scale_user(void)
LEADER_EXTERNS(); LEADER_EXTERNS();
#define LEADER_TIMEOUT 300
void matrix_scan_user(void) { void matrix_scan_user(void) {
LEADER_DICTIONARY() { LEADER_DICTIONARY() {
leading = false; leading = false;

File diff suppressed because it is too large Load Diff

@ -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 "keymap_extras/keymap_german.h"
#include "backlight.h" #include "backlight.h"
#include "debug.h" #include "debug.h"
#include "action_layer.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = { /* Colemak [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} {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 [6] = { /* Gaming
/* CS:GO buy binds * CS:GO buy binds
* ,-----------------------------------------------------------------------. * ,-----------------------------------------------------------------------.
* | | | | | | | | | 7 | 8 | 9 | | * | | | | | | | | | 7 | 8 | 9 | |
* |-----------------------------------------------------------------------| * |-----------------------------------------------------------------------|

File diff suppressed because it is too large Load Diff

@ -2,6 +2,7 @@
#define PLANCK_H #define PLANCK_H
#include "quantum.h" #include "quantum.h"
#include <avr/interrupt.h>
#define PLANCK_MIT( \ #define PLANCK_MIT( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \

File diff suppressed because it is too large Load Diff

@ -164,18 +164,20 @@ const uint16_t PROGMEM fn_actions[] = {
}; };
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
float start_up[][2] = { float tone_startup[][2] = {
{440.0*pow(2.0,(14)/12.0), 20}, {NOTE_B5, 20},
{440.0*pow(2.0,(26)/12.0), 8}, {NOTE_B6, 8},
{440.0*pow(2.0,(18)/12.0), 20}, {NOTE_DS6, 20},
{440.0*pow(2.0,(26)/12.0), 8} {NOTE_B6, 8}
}; };
float tone_qwerty[][2] = SONG(QWERTY_SOUND); float tone_qwerty[][2] = SONG(QWERTY_SOUND);
float tone_dvorak[][2] = SONG(DVORAK_SOUND); float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_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 #endif
void persistant_default_layer_set(uint16_t default_layer) { 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; return MACRO_NONE;
}; };
void matrix_init_user(void) { void matrix_init_user(void) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
_delay_ms(20); // gets rid of tick startup_user();
PLAY_NOTE_ARRAY(start_up, false, 0); #endif
#endif
} }
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
void play_goodbye_tone() void startup_user()
{
_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(goodbye, false, 0); PLAY_NOTE_ARRAY(music_scale, false, 0);
_delay_ms(150);
} }
#endif #endif

@ -36,5 +36,6 @@
void matrix_init_user(void); void matrix_init_user(void);
void matrix_scan_user(void); void matrix_scan_user(void);
bool process_action_kb(keyrecord_t *record); bool process_action_kb(keyrecord_t *record);
void backlight_init_ports(void);
#endif #endif

@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "led.h" #include "led.h"
void led_init_ports() { void led_init_ports(void) {
// * Set our LED pins as output // * Set our LED pins as output
DDRB |= (1<<2); DDRB |= (1<<2);
} }

@ -4,7 +4,7 @@
#include "matrix.h" #include "matrix.h"
#include "keymap.h" #include "keymap.h"
#include <stddef.h> #include <stddef.h>
#include "action_util.h"
/* Clueboard matrix layout /* Clueboard matrix layout
* ,-----------------------------------------------------------. * ,-----------------------------------------------------------.

@ -294,10 +294,10 @@ enum quantum_keycodes {
#define SFT_T(kc) MT(MOD_LSFT, kc) #define SFT_T(kc) MT(MOD_LSFT, kc)
#define ALT_T(kc) MT(MOD_LALT, kc) #define ALT_T(kc) MT(MOD_LALT, kc)
#define GUI_T(kc) MT(MOD_LGUI, 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 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 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 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 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 // 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) #define KC_HYPR HYPR(KC_NO)

@ -1,9 +1,6 @@
#ifndef KEYMAP_GERMAN_OSX #ifndef KEYMAP_GERMAN_OSX
#define KEYMAP_GERMAN_OSX #define KEYMAP_GERMAN_OSX
#ifdef KEYMAP_GERMAN
#warning redefining german keys
#endif
#include "keymap.h" #include "keymap.h"
// Alt gr // Alt gr

@ -24,6 +24,12 @@ void led_set_kb(uint8_t usb_led) {
} }
__attribute__ ((weak))
void led_init_ports(void)
{
}
__attribute__ ((weak)) __attribute__ ((weak))
void led_set(uint8_t usb_led) void led_set(uint8_t usb_led)
{ {

@ -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). The DIM_CURVE is used only on brightness/value and on saturation (inverted).
This looks the most natural. 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]); val = pgm_read_byte(&DIM_CURVE[val]);
sat = 255 - pgm_read_byte(&DIM_CURVE[255 - sat]); sat = 255 - pgm_read_byte(&DIM_CURVE[255 - sat]);
@ -154,7 +154,7 @@ void rgblight_init(void) {
} }
void rgblight_increase(void) { void rgblight_increase(void) {
uint8_t mode; uint8_t mode = 0;
if (rgblight_config.mode < RGBLIGHT_MODES) { if (rgblight_config.mode < RGBLIGHT_MODES) {
mode = rgblight_config.mode + 1; mode = rgblight_config.mode + 1;
} }
@ -162,7 +162,7 @@ void rgblight_increase(void) {
} }
void rgblight_decrease(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. 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; mode = rgblight_config.mode-1;
} }
@ -170,7 +170,7 @@ void rgblight_decrease(void) {
} }
void rgblight_step(void) { void rgblight_step(void) {
uint8_t mode; uint8_t mode = 0;
mode = rgblight_config.mode + 1; mode = rgblight_config.mode + 1;
if (mode > RGBLIGHT_MODES) { if (mode > RGBLIGHT_MODES) {
mode = 1; mode = 1;

@ -64,7 +64,6 @@ void rgblight_decrease_val(void);
void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val); void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val);
void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b); void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b);
#define EECONFIG_RGBLIGHT (uint8_t *)7
uint32_t eeconfig_read_rgblight(void); uint32_t eeconfig_read_rgblight(void);
void eeconfig_update_rgblight(uint32_t val); void eeconfig_update_rgblight(uint32_t val);
void eeconfig_update_rgblight_default(void); void eeconfig_update_rgblight_default(void);

@ -14,7 +14,10 @@ void eeconfig_init(void)
eeprom_update_byte(EECONFIG_BACKLIGHT, 0); eeprom_update_byte(EECONFIG_BACKLIGHT, 0);
#endif #endif
#ifdef AUDIO_ENABLE #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 #endif
} }

@ -66,7 +66,6 @@ static bool mousekey_console(uint8_t code);
static void mousekey_console_help(void); static void mousekey_console_help(void);
#endif #endif
static uint8_t numkey2num(uint8_t code);
static void switch_default_layer(uint8_t layer); static void switch_default_layer(uint8_t layer);
@ -763,7 +762,7 @@ static bool mousekey_console(uint8_t code)
/*********************************************************** /***********************************************************
* Utilities * Utilities
***********************************************************/ ***********************************************************/
static uint8_t numkey2num(uint8_t code) uint8_t numkey2num(uint8_t code)
{ {
switch (code) { switch (code) {
case KC_1: return 1; case KC_1: return 1;

@ -27,6 +27,7 @@ bool command_extra(uint8_t code);
bool command_console_extra(uint8_t code); bool command_console_extra(uint8_t code);
#ifdef COMMAND_ENABLE #ifdef COMMAND_ENABLE
uint8_t numkey2num(uint8_t code);
bool command_proc(uint8_t code); bool command_proc(uint8_t code);
#else #else
#define command_proc(code) false #define command_proc(code) false

@ -32,6 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define EECONFIG_MOUSEKEY_ACCEL (uint8_t *)5 #define EECONFIG_MOUSEKEY_ACCEL (uint8_t *)5
#define EECONFIG_BACKLIGHT (uint8_t *)6 #define EECONFIG_BACKLIGHT (uint8_t *)6
#define EECONFIG_AUDIO (uint8_t *)7 #define EECONFIG_AUDIO (uint8_t *)7
#define EECONFIG_RGBLIGHT (uint32_t *)8
/* debug bit */ /* debug bit */

@ -37,6 +37,9 @@ void led_set(uint8_t usb_led);
/* keyboard-specific LED functionality */ /* keyboard-specific LED functionality */
void led_set_kb(uint8_t usb_led); void led_set_kb(uint8_t usb_led);
void led_init_ports(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "report.h" #include "report.h"
#include "print.h" #include "print.h"
#include "debug.h" #include "debug.h"
#include "../serial.h"
#include "bluetooth.h" #include "bluetooth.h"
void bluefruit_keyboard_print_report(report_keyboard_t *report) void bluefruit_keyboard_print_report(report_keyboard_t *report)

@ -18,6 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef BLUETOOTH_H #ifndef BLUETOOTH_H
#define BLUETOOTH_H #define BLUETOOTH_H
#include "../serial.h"
void bluefruit_serial_send(uint8_t data); void bluefruit_serial_send(uint8_t data);
/* /*

@ -632,17 +632,34 @@ all-keyboards-defaults-%:
all-keyboards-defaults: all-keyboards-defaults-all all-keyboards-defaults: all-keyboards-defaults-all
KEYBOARDS := $(SUBDIRS:$(TOP_DIR)/keyboard/%/=/keyboard/%) KEYBOARDS := $(SUBDIRS:$(TOP_DIR)/keyboard/%/=/keyboard/%)
all-keyboards-%: $(KEYBOARDS) all-keyboards-all: $(addsuffix -all,$(KEYBOARDS))
/keyboard/%: all-keyboards-quick: $(addsuffix -quick,$(KEYBOARDS))
$(eval KEYBOARD=$(patsubst /keyboard/%,%,$@)) all-keyboards-clean: $(addsuffix -clean,$(KEYBOARDS))
$(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-keyboards-all 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-%: all-keymaps-%:
$(eval MAKECONFIG=$(call get_target,all-keymaps,$@)) $(eval MAKECONFIG=$(call get_target,all-keymaps,$@))
$(eval KEYMAPS=$(notdir $(patsubst %/.,%,$(wildcard $(TOP_DIR)/keyboard/$(KEYBOARD)/keymaps/*/.)))) $(eval KEYMAPS=$(notdir $(patsubst %/.,%,$(wildcard $(TOP_DIR)/keyboard/$(KEYBOARD)/keymaps/*/.))))

Loading…
Cancel
Save