mirror of
https://github.com/qmk/qmk_firmware
synced 2024-12-22 16:36:58 +00:00
parent
758a8c64e9
commit
1a0bac8bcc
@ -4,6 +4,7 @@
|
||||
#include "quantum.h"
|
||||
#include <stddef.h>
|
||||
#include <avr/io.h>
|
||||
#include <avr/interrupt.h>
|
||||
|
||||
// This a shortcut to help you visually see your 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;
|
||||
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;
|
||||
}
|
||||
|
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(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
|
||||
),
|
||||
};
|
||||
|
||||
|
@ -6,4 +6,7 @@
|
||||
#define ONESHOT_TAP_TOGGLE 2
|
||||
#define ONESHOT_TIMEOUT 300
|
||||
|
||||
#undef LEADER_TIMEOUT
|
||||
#define LEADER_TIMEOUT 300
|
||||
|
||||
#endif
|
||||
|
@ -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;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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//-----------------------
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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"
|
||||
|
||||
|
||||
/**
|
||||
|
@ -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
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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.
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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.
|
||||
|
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 */
|
||||
#define NO_DEBUG
|
||||
// #define NO_DEBUG
|
||||
|
||||
/* disable 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:
|
||||
return MACRO_NONE;
|
||||
}
|
||||
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
// Runs just one time when the keyboard initializes.
|
||||
|
@ -1,8 +1,5 @@
|
||||
|
||||
|
||||
# # project specific files
|
||||
SRC = backlight.c
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
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) {
|
||||
#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();
|
||||
};
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user