Compare commits

...

26 Commits
10 ... 11

Author SHA1 Message Date
Florian Didron
8f065c420b chore: move led shutdown logic in rgb_matric.c 2019-08-17 02:42:35 +00:00
Florian Didron
76ba4c4fa5 fix: do not turn off leds when usb suspend is not set 2019-08-17 02:42:35 +00:00
Florian Didron
96a09786d8 chore: set rgb sleep by default for the Shine 2019-08-15 23:41:32 +00:00
Florian Didron
5f2b255bb1 chore: set rgb suspend to default 2019-08-15 23:41:32 +00:00
Florian Didron
7215cb932b fix: shutdown all leds before suspend 2019-08-15 23:40:31 +00:00
Florian Didron
a587846d97 fix: eeconfig init timning issue on the Planck 2019-08-15 23:40:15 +00:00
Florian Didron
2db33bc5e1 feat: force eeprom reset on flash 2019-08-15 01:56:15 +00:00
Joel Challis
87487abd05 Fix LT() crashing some ARM keyboards (#6529) 2019-08-14 00:50:25 +00:00
Drashna Jaelre
b188634e6f Delete PULL_REQUEST_TEMPLATE.md 2019-08-13 10:51:33 +09:00
Drashna Jaelre
a6dfd85e60 Update spacing in editorconfig file
For sanity's sake
2019-08-13 10:51:33 +09:00
fauxpark
ce6f145802 Mask off TD() parameter properly (#6143)
* Mask off TD() parameter properly

* More parentheses
2019-08-13 10:51:08 +09:00
fauxpark
b6e465be96 Add some defaults for ATmega32A to mcu_selection.mk (#6253)
* Add some defaults for ATmega32A to mcu_selection.mk

* Remove boilerplate from templates

* Relax INTERRUPT_CONTROL_ENDPOINT and PROGRAM_CMD

* Apply suggestions from code review

Co-Authored-By: Drashna Jaelre <drashna@live.com>
2019-08-13 10:50:27 +09:00
fauxpark
36a0c2b456 Extend allowed range of tappable keycodes to include modifiers (#5809)
* Extend allowed range of tappable keycodes to include modifiers

* Get rid of the magic numbers altogether

* Remove some more magic numbers

* Extract LM() functionality from ACT_LAYER_TAP

* Use ACTION() macro everywhere
2019-08-13 10:49:55 +09:00
fauxpark
86c9a1a384 Rename QK_TMK(_MAX) to QK_BASIC (#6509) 2019-08-13 10:49:14 +09:00
fauxpark
562884a328 Improve backlight PWM pin support (#6202)
* Improve backlight PWM pin support

* I accidentally an equals sign

* Another typo

* Order by pin number

* Throw an error if backlight pin is C4 or C5 on 16/32U4

* Use else for clarity

* Minor alignment adjustments
2019-08-13 10:48:29 +09:00
skullydazed
9e38863d64 Use the older universal_newlines name instead of text (#6506) 2019-08-13 10:47:48 +09:00
Zach DeCook
1cb8fa3cdc MIDI: Fix basic noteon: send correct velocity (#6476) 2019-08-13 10:47:17 +09:00
fauxpark
dd1a8564ed Fix qmk_install.sh on Windows dropping to command prompt (#6488) 2019-08-13 10:46:40 +09:00
Garrett Singer
31b5a5c22f [Split] Add config option for DIRECT_PINS_RIGHT (#6479)
Adds support for different direct pin mappings on the halves of a split keyboard.
2019-08-13 10:46:11 +09:00
Jake Grossman
d6fe48954e Removed print call to resolve #6364 (#6413)
* Change print to dprintf to avoid buffer overflow

* Add stdio header for dprintf

* Fix included headers
2019-08-13 10:45:38 +09:00
XScorpion2
986a0f068f (OLED) Added support for CR (#6399)
Currently OLED Dirver only supports LF (\n) character in a string to clear out the rest of the current line and advance to the next line for writing. This PR adds support for CR (\r) character as well to advance to the next line, however not clear out the rest of the current line. This is extremely useful when you want to display a multi-line logo using a single array without wiping out exiting lines and flagging the OLED as dirty unnecessarily.
2019-08-13 10:44:55 +09:00
Konstantin Đorđević
2823be1b2f Change xprintf() calls in rgblight.c to dprintf() (#6363) 2019-08-13 10:44:32 +09:00
zvecr
98fd7ebf58 Small fix to allow board to override split keyboard master check 2019-08-13 10:28:34 +09:00
Drashna Jaelre
64566241cb Add support for TAP_CODE_DELAY to Hold-Tap keys (#5400)
* Add support for TAP_CODE_DELAY to Hold-Tap keys

* Better handling for tap code delay and caps version
2019-08-13 10:28:09 +09:00
Joel Challis
6d9eb7e97a Fix MATRIX_X_PINS_RIGHT ARM compilation (#6395) 2019-08-13 10:27:36 +09:00
yrdns
48db06e8c1 Fix RGB Matrix Cycle Left-Right Animation (#6421)
One-line fix for a typo that could break build if DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT was defined but not DISABLE_RGB_MATRIX_CYCLE_ALL
2019-08-13 10:27:08 +09:00
24 changed files with 254 additions and 172 deletions

View File

@@ -5,7 +5,7 @@ root = true
[*]
indent_style = space
indent_size = 2
indent_size = 4
# We recommend you to keep these unchanged
charset = utf-8

View File

@@ -1,34 +0,0 @@
<!--- Provide a general summary of your changes in the title above. -->
<!--- This template is entirely optional and can be removed, but is here to help both you and us. -->
<!--- Anything on lines wrapped in comments like these will not show up in the final text. -->
## Description
<!--- Describe your changes in detail here. -->
## Types of Changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply. -->
- [ ] Core
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement/optimization
- [ ] Keyboard (addition or update)
- [ ] Keymap/layout/userspace (addition or update)
- [ ] Documentation
## Issues Fixed or Closed by This PR
*
## Checklist
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the [**CONTRIBUTING** document](https://docs.qmk.fm/#/contributing).
- [ ] I have added tests to cover my changes.
- [ ] I have tested the changes and verified that they work and don't break anything (as well as I can manage).

View File

@@ -38,7 +38,7 @@ with open('requirements.txt', 'r') as fd:
# Figure out our version
command = ['git', 'describe', '--abbrev=6', '--dirty', '--always', '--tags']
result = subprocess.run(command, text=True, capture_output=True)
result = subprocess.run(command, universal_newlines=True, capture_output=True)
if result.returncode == 0:
os.environ['QMK_VERSION'] = 'QMK ' + result.stdout.strip()

View File

@@ -321,7 +321,7 @@ void oled_render(void) {
// Send render data chunk after rotating
if (I2C_WRITE_REG(I2C_DATA, &temp_buffer[0], OLED_BLOCK_SIZE) != I2C_STATUS_SUCCESS) {
print("oled_render data failed\n");
print("oled_render90 data failed\n");
return;
}
}
@@ -393,6 +393,11 @@ void oled_write_char(const char data, bool invert) {
return;
}
if (data == '\r') {
oled_advance_page(false);
return;
}
// copy the current render buffer to check for dirty after
static uint8_t oled_temp_buffer[OLED_FONT_WIDTH];
memcpy(&oled_temp_buffer, oled_cursor, OLED_FONT_WIDTH);

View File

@@ -85,6 +85,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGBW 1
#define RGBLIGHT_SLEEP
/*
* The debounce filtering reports a key/switch change directly,
* without any extra delay. After that the debounce logic will filter
@@ -113,6 +115,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGB_MATRIX_LED_PROCESS_LIMIT 5
#define RGB_MATRIX_LED_FLUSH_LIMIT 26
#define RGB_DISABLE_WHEN_USB_SUSPENDED true
// #define RGBLIGHT_COLOR_LAYER_0 0x00, 0x00, 0xFF
/* #define RGBLIGHT_COLOR_LAYER_1 0x00, 0x00, 0xFF */

View File

@@ -139,6 +139,7 @@
#define RGB_MATRIX_KEYPRESSES
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
#define RGB_DISABLE_WHEN_USB_SUSPENDED true
#define RGB_MATRIX_LED_PROCESS_LIMIT 5

View File

@@ -207,6 +207,9 @@ void led_initialize_hardware(void) {
}
void keyboard_pre_init_kb(void) {
if (!eeconfig_is_enabled()) {
eeconfig_init();
}
// read kb settings from eeprom
keyboard_config.raw = eeconfig_read_kb();
#ifdef RGB_MATRIX_ENABLE

View File

@@ -1,4 +1,3 @@
ifneq ($(findstring STM32F303, $(MCU)),)
## chip/board settings
# - the next two should match the directories in
@@ -54,7 +53,7 @@ ifneq (,$(filter $(MCU),atmega32u4 at90usb1286))
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH ?= AVR8
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
@@ -68,4 +67,27 @@ ifneq (,$(filter $(MCU),atmega32u4 at90usb1286))
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB ?= $(F_CPU)
# Interrupt driven control endpoint task
ifeq (,$(filter $(NO_INTERRUPT_CONTROL_ENDPOINT),yes))
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
endif
endif
ifneq (,$(filter $(MCU),atmega32a))
PROTOCOL = VUSB
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
F_CPU ?= 12000000
# unsupported features for now
NO_UART ?= yes
NO_SUSPEND_POWER_DOWN ?= yes
# Programming options
PROGRAM_CMD ?= ./util/atmega32a_program.py $(TARGET).hex
endif

View File

@@ -24,7 +24,7 @@
void process_midi_basic_noteon(uint8_t note)
{
midi_send_noteon(&midi_device, 0, note, 128);
midi_send_noteon(&midi_device, 0, note, 127);
}
void process_midi_basic_noteoff(uint8_t note)

View File

@@ -34,7 +34,7 @@ typedef struct
bool finished;
} qk_tap_dance_state_t;
#define TD(n) (QK_TAP_DANCE + n)
#define TD(n) (QK_TAP_DANCE | ((n) & 0xFF))
typedef void (*qk_tap_dance_user_fn_t) (qk_tap_dance_state_t *state, void *user_data);

View File

@@ -1030,35 +1030,147 @@ void matrix_scan_quantum() {
}
#if defined(BACKLIGHT_ENABLE) && defined(BACKLIGHT_PIN)
static const uint8_t backlight_pin = BACKLIGHT_PIN;
// This logic is a bit complex, we support 3 setups:
//
// 1. Hardware PWM when backlight is wired to a PWM pin.
// Depending on this pin, we use a different output compare unit.
// 2. Software PWM with hardware timers, but the used timer
// depends on the Audio setup (Audio wins over Backlight).
// 3. Full software PWM, driven by the matrix scan, if both timers are used by Audio.
// depending on the pin, we use a different output compare unit
#if BACKLIGHT_PIN == B7
# define TCCRxA TCCR1A
# define TCCRxB TCCR1B
# define COMxx1 COM1C1
# define OCRxx OCR1C
# define ICRx ICR1
#elif BACKLIGHT_PIN == B6
# define TCCRxA TCCR1A
# define TCCRxB TCCR1B
# define COMxx1 COM1B1
# define OCRxx OCR1B
# define ICRx ICR1
#elif BACKLIGHT_PIN == B5
# define TCCRxA TCCR1A
# define TCCRxB TCCR1B
# define COMxx1 COM1A1
# define OCRxx OCR1A
# define ICRx ICR1
#elif BACKLIGHT_PIN == C6
# define TCCRxA TCCR3A
# define TCCRxB TCCR3B
# define COMxx1 COM1A1
# define OCRxx OCR3A
# define ICRx ICR3
#if (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) \
|| defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) \
|| defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)) \
&& (BACKLIGHT_PIN == B5 || BACKLIGHT_PIN == B6 || BACKLIGHT_PIN == B7)
#define HARDWARE_PWM
#define ICRx ICR1
#define TCCRxA TCCR1A
#define TCCRxB TCCR1B
#define TIMERx_OVF_vect TIMER1_OVF_vect
#define TIMSKx TIMSK1
#define TOIEx TOIE1
#if BACKLIGHT_PIN == B5
#define COMxx1 COM1A1
#define OCRxx OCR1A
#elif BACKLIGHT_PIN == B6
#define COMxx1 COM1B1
#define OCRxx OCR1B
#elif BACKLIGHT_PIN == B7
#define COMxx1 COM1C1
#define OCRxx OCR1C
#endif
#elif (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) \
|| defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) \
|| defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)) \
&& (BACKLIGHT_PIN == C4 || BACKLIGHT_PIN == C5 || BACKLIGHT_PIN == C6)
#define HARDWARE_PWM
#define ICRx ICR3
#define TCCRxA TCCR3A
#define TCCRxB TCCR3B
#define TIMERx_OVF_vect TIMER3_OVF_vect
#define TIMSKx TIMSK3
#define TOIEx TOIE3
#if BACKLIGHT_PIN == C4
#if (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))
#error This MCU has no C4 pin!
#else
#define COMxx1 COM3C1
#define OCRxx OCR3C
#endif
#elif BACKLIGHT_PIN == C5
#if (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))
#error This MCU has no C5 pin!
#else
#define COMxx1 COM3B1
#define OCRxx OCR3B
#endif
#elif BACKLIGHT_PIN == C6
#define COMxx1 COM3A1
#define OCRxx OCR3A
#endif
#elif (defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__)) \
&& (BACKLIGHT_PIN == B7 || BACKLIGHT_PIN == C5 || BACKLIGHT_PIN == C6)
#define HARDWARE_PWM
#define ICRx ICR1
#define TCCRxA TCCR1A
#define TCCRxB TCCR1B
#define TIMERx_OVF_vect TIMER1_OVF_vect
#define TIMSKx TIMSK1
#define TOIEx TOIE1
#if BACKLIGHT_PIN == B7
#define COMxx1 COM1C1
#define OCRxx OCR1C
#elif BACKLIGHT_PIN == C5
#define COMxx1 COM1B1
#define OCRxx OCR1B
#elif BACKLIGHT_PIN == C6
#define COMxx1 COM1A1
#define OCRxx OCR1A
#endif
#elif defined(__AVR_ATmega32A__) \
&& (BACKLIGHT_PIN == D4 || BACKLIGHT_PIN == D5)
#define HARDWARE_PWM
#define ICRx ICR1
#define TCCRxA TCCR1A
#define TCCRxB TCCR1B
#define TIMERx_OVF_vect TIMER1_OVF_vect
#define TIMSKx TIMSK
#define TOIEx TOIE1
#if BACKLIGHT_PIN == D4
#define COMxx1 COM1B1
#define OCRxx OCR1B
#elif BACKLIGHT_PIN == D5
#define COMxx1 COM1A1
#define OCRxx OCR1A
#endif
#else
# define NO_HARDWARE_PWM
#if !defined(BACKLIGHT_CUSTOM_DRIVER)
#if !defined(B5_AUDIO) && !defined(B6_AUDIO) && !defined(B7_AUDIO)
// Timer 1 is not in use by Audio feature, Backlight can use it
#pragma message "Using hardware timer 1 with software PWM"
#define HARDWARE_PWM
#define BACKLIGHT_PWM_TIMER
#define ICRx ICR1
#define TCCRxA TCCR1A
#define TCCRxB TCCR1B
#define TIMERx_COMPA_vect TIMER1_COMPA_vect
#define TIMERx_OVF_vect TIMER1_OVF_vect
#if defined(__AVR_ATmega32A__) // This MCU has only one TIMSK register
#define TIMSKx TIMSK
#else
#define TIMSKx TIMSK1
#endif
#define TOIEx TOIE1
#define OCIExA OCIE1A
#define OCRxx OCR1A
#elif !defined(C6_AUDIO) && !defined(C5_AUDIO) && !defined(C4_AUDIO)
#pragma message "Using hardware timer 3 with software PWM"
// Timer 3 is not in use by Audio feature, Backlight can use it
#define HARDWARE_PWM
#define BACKLIGHT_PWM_TIMER
#define ICRx ICR1
#define TCCRxA TCCR3A
#define TCCRxB TCCR3B
#define TIMERx_COMPA_vect TIMER3_COMPA_vect
#define TIMERx_OVF_vect TIMER3_OVF_vect
#define TIMSKx TIMSK3
#define TOIEx TOIE3
#define OCIExA OCIE3A
#define OCRxx OCR3A
#else
#pragma message "Audio in use - using pure software PWM"
#define NO_HARDWARE_PWM
#endif
#else
#pragma message "Custom driver defined - using pure software PWM"
#define NO_HARDWARE_PWM
#endif
#endif
#ifndef BACKLIGHT_ON_STATE
@@ -1137,7 +1249,7 @@ static uint16_t cie_lightness(uint16_t v) {
// range for val is [0..TIMER_TOP]. PWM pin is high while the timer count is below val.
static inline void set_pwm(uint16_t val) {
OCRxx = val;
OCRxx = val;
}
#ifndef BACKLIGHT_CUSTOM_DRIVER

View File

@@ -31,9 +31,9 @@
#define XXXXXXX KC_NO
enum quantum_keycodes {
// Ranges used in shortucuts - not to be used directly
QK_TMK = 0x0000,
QK_TMK_MAX = 0x00FF,
// Ranges used in shortcuts - not to be used directly
QK_BASIC = 0x0000,
QK_BASIC_MAX = 0x00FF,
QK_MODS = 0x0100,
QK_LCTL = 0x0100,
QK_LSFT = 0x0200,

View File

@@ -88,7 +88,7 @@
#endif
#if !defined(RGB_MATRIX_STARTUP_MODE)
#ifndef DISABLE_RGB_MATRIX_CYCLE_ALL
#ifndef DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_LEFT_RIGHT
#else
// fallback to solid colors if RGB_MATRIX_CYCLE_LEFT_RIGHT is disabled in userspace
@@ -436,6 +436,9 @@ void rgb_matrix_init(void) {
}
void rgb_matrix_set_suspend_state(bool state) {
if (state && RGB_DISABLE_WHEN_USB_SUSPENDED) {
rgb_matrix_set_color_all(0, 0, 0);
}
g_suspend_state = state;
}

View File

@@ -167,7 +167,6 @@ void eeconfig_update_rgblight(uint32_t val) {
}
void eeconfig_update_rgblight_default(void) {
//dprintf("eeconfig_update_rgblight_default\n");
rgblight_config.enable = 1;
rgblight_config.mode = RGBLIGHT_MODE_STATIC_LIGHT;
rgblight_config.hue = 0;
@@ -179,7 +178,7 @@ void eeconfig_update_rgblight_default(void) {
}
void eeconfig_debug_rgblight(void) {
dprintf("rgblight_config eprom\n");
dprintf("rgblight_config EEPROM:\n");
dprintf("rgblight_config.enable = %d\n", rgblight_config.enable);
dprintf("rghlight_config.mode = %d\n", rgblight_config.mode);
dprintf("rgblight_config.hue = %d\n", rgblight_config.hue);
@@ -308,9 +307,9 @@ void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom) {
RGBLIGHT_SPLIT_SET_CHANGE_MODE;
if (write_to_eeprom) {
eeconfig_update_rgblight(rgblight_config.raw);
xprintf("rgblight mode [EEPROM]: %u\n", rgblight_config.mode);
dprintf("rgblight mode [EEPROM]: %u\n", rgblight_config.mode);
} else {
xprintf("rgblight mode [NOEEPROM]: %u\n", rgblight_config.mode);
dprintf("rgblight mode [NOEEPROM]: %u\n", rgblight_config.mode);
}
if( is_static_effect(rgblight_config.mode) ) {
#ifdef RGBLIGHT_USE_TIMER
@@ -337,7 +336,7 @@ void rgblight_mode_noeeprom(uint8_t mode) {
void rgblight_toggle(void) {
xprintf("rgblight toggle [EEPROM]: rgblight_config.enable = %u\n", !rgblight_config.enable);
dprintf("rgblight toggle [EEPROM]: rgblight_config.enable = %u\n", !rgblight_config.enable);
if (rgblight_config.enable) {
rgblight_disable();
}
@@ -347,7 +346,7 @@ void rgblight_toggle(void) {
}
void rgblight_toggle_noeeprom(void) {
xprintf("rgblight toggle [NOEEPROM]: rgblight_config.enable = %u\n", !rgblight_config.enable);
dprintf("rgblight toggle [NOEEPROM]: rgblight_config.enable = %u\n", !rgblight_config.enable);
if (rgblight_config.enable) {
rgblight_disable_noeeprom();
}
@@ -360,20 +359,20 @@ void rgblight_enable(void) {
rgblight_config.enable = 1;
// No need to update EEPROM here. rgblight_mode() will do that, actually
//eeconfig_update_rgblight(rgblight_config.raw);
xprintf("rgblight enable [EEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable);
dprintf("rgblight enable [EEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable);
rgblight_mode(rgblight_config.mode);
}
void rgblight_enable_noeeprom(void) {
rgblight_config.enable = 1;
xprintf("rgblight enable [NOEEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable);
dprintf("rgblight enable [NOEEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable);
rgblight_mode_noeeprom(rgblight_config.mode);
}
void rgblight_disable(void) {
rgblight_config.enable = 0;
eeconfig_update_rgblight(rgblight_config.raw);
xprintf("rgblight disable [EEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable);
dprintf("rgblight disable [EEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable);
#ifdef RGBLIGHT_USE_TIMER
rgblight_timer_disable();
#endif
@@ -384,7 +383,7 @@ void rgblight_disable(void) {
void rgblight_disable_noeeprom(void) {
rgblight_config.enable = 0;
xprintf("rgblight disable [noEEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable);
dprintf("rgblight disable [NOEEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable);
#ifdef RGBLIGHT_USE_TIMER
rgblight_timer_disable();
#endif
@@ -471,7 +470,6 @@ void rgblight_sethsv_noeeprom_old(uint8_t hue, uint8_t sat, uint8_t val) {
if (rgblight_config.enable) {
LED_TYPE tmp_led;
sethsv(hue, sat, val, &tmp_led);
// dprintf("rgblight set hue [MEMORY]: %u,%u,%u\n", inmem_config.hue, inmem_config.sat, inmem_config.val);
rgblight_setrgb(tmp_led.r, tmp_led.g, tmp_led.b);
}
}
@@ -543,9 +541,9 @@ void rgblight_sethsv_eeprom_helper(uint8_t hue, uint8_t sat, uint8_t val, bool w
rgblight_config.val = val;
if (write_to_eeprom) {
eeconfig_update_rgblight(rgblight_config.raw);
xprintf("rgblight set hsv [EEPROM]: %u,%u,%u\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val);
dprintf("rgblight set hsv [EEPROM]: %u,%u,%u\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val);
} else {
xprintf("rgblight set hsv [NOEEPROM]: %u,%u,%u\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val);
dprintf("rgblight set hsv [NOEEPROM]: %u,%u,%u\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val);
}
}
}
@@ -866,7 +864,6 @@ void rgblight_task(void) {
uint16_t oldpos16;
if (tick_flag) {
tick_flag = false;
//dprintf("rgblight animation tick\n");
if (timer_elapsed(report_last_timer) >= 30000) {
report_last_timer = timer_read();
dprintf("rgblight animation tick report to slave\n");
@@ -874,15 +871,11 @@ void rgblight_task(void) {
}
}
oldpos16 = animation_status.pos16;
//dprintf("call effect function\n");
#endif
animation_status.last_timer += interval_time;
effect_func(&animation_status);
#if defined(RGBLIGHT_SPLIT) && !defined(RGBLIGHT_SPLIT_NO_ANIMATION_SYNC)
//dprintf("pos16, oldpos16 = %d %d\n",
// animation_status.pos16,oldpos16);
if (animation_status.pos16 == 0 && oldpos16 != 0) {
//dprintf("flag on\n");
tick_flag = true;
}
#endif

View File

@@ -252,14 +252,22 @@ void matrix_init(void) {
// Set pinout for right half if pinout for that half is defined
if (!isLeftHand) {
#ifdef DIRECT_PINS_RIGHT
const pin_t direct_pins_right[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS_RIGHT;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
for (uint8_t j = 0; j < MATRIX_COLS; j++) {
direct_pins[i][j] = direct_pins_right[i][j];
}
}
#endif
#ifdef MATRIX_ROW_PINS_RIGHT
const uint8_t row_pins_right[MATRIX_ROWS] = MATRIX_ROW_PINS_RIGHT;
const pin_t row_pins_right[MATRIX_ROWS] = MATRIX_ROW_PINS_RIGHT;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
row_pins[i] = row_pins_right[i];
}
#endif
#ifdef MATRIX_COL_PINS_RIGHT
const uint8_t col_pins_right[MATRIX_COLS] = MATRIX_COL_PINS_RIGHT;
const pin_t col_pins_right[MATRIX_COLS] = MATRIX_COL_PINS_RIGHT;
for (uint8_t i = 0; i < MATRIX_COLS; i++) {
col_pins[i] = col_pins_right[i];
}

View File

@@ -32,6 +32,7 @@ bool is_keyboard_left(void) {
return is_keyboard_master();
}
__attribute__((weak))
bool is_keyboard_master(void)
{
#ifdef __AVR__

View File

@@ -2,42 +2,6 @@
#MCU = at90usb1286
MCU = atmega32u4
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Bootloader selection
# Teensy halfkay

View File

@@ -1,13 +1,5 @@
# MCU name
MCU = atmega32a
PROTOCOL = VUSB
# unsupported features for now
NO_UART = yes
NO_SUSPEND_POWER_DOWN = yes
# processor frequency
F_CPU = 12000000
# Bootloader
# This definition is optional, and if your keyboard supports multiple bootloaders of
@@ -27,9 +19,4 @@ RGBLIGHT_CUSTOM_DRIVER = yes
OPT_DEFS = -DDEBUG_LEVEL=0
# custom matrix setup
CUSTOM_MATRIX = yes
SRC = matrix.c i2c.c
# programming options
PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex
SRC += i2c_master.c

View File

@@ -44,6 +44,9 @@ int retro_tapping_counter = 0;
#include <fauxclicky.h>
#endif
#ifndef TAP_CODE_DELAY
# define TAP_CODE_DELAY 0
#endif
#ifndef TAP_HOLD_CAPS_DELAY
# define TAP_HOLD_CAPS_DELAY 80
#endif
@@ -330,6 +333,9 @@ void process_action(keyrecord_t *record, action_t action)
} else {
if (tap_count > 0) {
dprint("MODS_TAP: Tap: unregister_code\n");
if (action.layer_tap.code == KC_CAPS) {
wait_ms(TAP_HOLD_CAPS_DELAY);
}
unregister_code(action.key.code);
} else {
dprint("MODS_TAP: No tap: add_mods\n");
@@ -431,20 +437,19 @@ void process_action(keyrecord_t *record, action_t action)
}
}
break;
case ACT_LAYER_MODS:
if (event.pressed) {
layer_on(action.layer_mods.layer);
register_mods(action.layer_mods.mods);
} else {
unregister_mods(action.layer_mods.mods);
layer_off(action.layer_mods.layer);
}
break;
#ifndef NO_ACTION_TAPPING
case ACT_LAYER_TAP:
case ACT_LAYER_TAP_EXT:
switch (action.layer_tap.code) {
case 0xe0 ... 0xef:
/* layer On/Off with modifiers(left only) */
if (event.pressed) {
layer_on(action.layer_tap.val);
register_mods(action.layer_tap.code & 0x0f);
} else {
layer_off(action.layer_tap.val);
unregister_mods(action.layer_tap.code & 0x0f);
}
break;
case OP_TAP_TOGGLE:
/* tap toggle */
if (event.pressed) {
@@ -522,7 +527,9 @@ void process_action(keyrecord_t *record, action_t action)
dprint("KEYMAP_TAP_KEY: Tap: unregister_code\n");
if (action.layer_tap.code == KC_CAPS) {
wait_ms(TAP_HOLD_CAPS_DELAY);
}
} else {
wait_ms(TAP_CODE_DELAY);
}
unregister_code(action.layer_tap.code);
} else {
dprint("KEYMAP_TAP_KEY: No tap: Off on release\n");
@@ -618,6 +625,7 @@ void process_action(keyrecord_t *record, action_t action)
if (event.pressed) {
register_code(action.swap.code);
} else {
wait_ms(TAP_CODE_DELAY);
unregister_code(action.swap.code);
*record = (keyrecord_t){}; // hack: reset tap mode
}
@@ -643,6 +651,7 @@ void process_action(keyrecord_t *record, action_t action)
// if this event is a layer action, update the leds
switch (action.kind.id) {
case ACT_LAYER:
case ACT_LAYER_MODS:
#ifndef NO_ACTION_TAPPING
case ACT_LAYER_TAP:
case ACT_LAYER_TAP_EXT:
@@ -670,8 +679,7 @@ void process_action(keyrecord_t *record, action_t action)
retro_tapping_counter = 0;
} else {
if (retro_tapping_counter == 2) {
register_code(action.layer_tap.code);
unregister_code(action.layer_tap.code);
tap_code(action.layer_tap.code);
}
retro_tapping_counter = 0;
}
@@ -858,12 +866,9 @@ void tap_code(uint8_t code) {
register_code(code);
if (code == KC_CAPS) {
wait_ms(TAP_HOLD_CAPS_DELAY);
}
#if TAP_CODE_DELAY > 0
else {
} else {
wait_ms(TAP_CODE_DELAY);
}
#endif
unregister_code(code);
}
@@ -952,7 +957,7 @@ bool is_tap_action(action_t action)
case ACT_LAYER_TAP:
case ACT_LAYER_TAP_EXT:
switch (action.layer_tap.code) {
case 0x00 ... 0xdf:
case KC_NO ... KC_RGUI:
case OP_TAP_TOGGLE:
case OP_ONESHOT:
return true;
@@ -960,7 +965,7 @@ bool is_tap_action(action_t action)
return false;
case ACT_SWAP_HANDS:
switch (action.swap.code) {
case 0x00 ... 0xdf:
case KC_NO ... KC_RGUI:
case OP_SH_TAP_TOGGLE:
return true;
}
@@ -1009,6 +1014,7 @@ void debug_action(action_t action)
case ACT_USAGE: dprint("ACT_USAGE"); break;
case ACT_MOUSEKEY: dprint("ACT_MOUSEKEY"); break;
case ACT_LAYER: dprint("ACT_LAYER"); break;
case ACT_LAYER_MODS: dprint("ACT_LAYER_MODS"); break;
case ACT_LAYER_TAP: dprint("ACT_LAYER_TAP"); break;
case ACT_LAYER_TAP_EXT: dprint("ACT_LAYER_TAP_EXT"); break;
case ACT_MACRO: dprint("ACT_MACRO"); break;

View File

@@ -66,7 +66,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* EBBBB: bits and extra bit
* ee: on event(01:press, 10:release, 11:both)
*
* 1001|xxxx|xxxx xxxx (reserved)
* ACT_LAYER_MODS(1001):
* 1001|LLLL| mods Layer with modifiers held
*
* ACT_LAYER_TAP(101x):
* 101E|LLLL| keycode On/Off with tap key (0x00-DF)[TAP]
@@ -110,6 +111,7 @@ enum action_kind_id {
ACT_SWAP_HANDS = 0b0110,
/* Layer Actions */
ACT_LAYER = 0b1000,
ACT_LAYER_MODS = 0b1001,
ACT_LAYER_TAP = 0b1010, /* Layer 0-15 */
ACT_LAYER_TAP_EXT = 0b1011, /* Layer 16-31 */
/* Extensions */
@@ -153,6 +155,12 @@ typedef union {
uint8_t op :2;
uint8_t kind :4;
} layer_bitop;
struct action_layer_mods
{
uint8_t mods :8;
uint8_t layer :4;
uint8_t kind :4;
} layer_mods;
struct action_layer_tap {
uint8_t code :8;
uint8_t val :5;
@@ -261,8 +269,8 @@ enum layer_param_tap_op {
OP_SET_CLEAR,
OP_ONESHOT,
};
#define ACTION_LAYER_BITOP(op, part, bits, on) (ACT_LAYER<<12 | (op)<<10 | (on)<<8 | (part)<<5 | ((bits)&0x1f))
#define ACTION_LAYER_TAP(layer, key) (ACT_LAYER_TAP<<12 | (layer)<<8 | (key))
#define ACTION_LAYER_BITOP(op, part, bits, on) ACTION(ACT_LAYER, (op)<<10 | (on)<<8 | (part)<<5 | ((bits)&0x1f))
#define ACTION_LAYER_TAP(layer, key) ACTION(ACT_LAYER_TAP, (layer)<<8 | (key))
/* Default Layer */
#define ACTION_DEFAULT_LAYER_SET(layer) ACTION_DEFAULT_LAYER_BIT_SET((layer)/4, 1<<((layer)%4))
/* Layer Operation */
@@ -277,7 +285,7 @@ enum layer_param_tap_op {
#define ACTION_LAYER_OFF_ON(layer) ACTION_LAYER_TAP((layer), OP_OFF_ON)
#define ACTION_LAYER_SET_CLEAR(layer) ACTION_LAYER_TAP((layer), OP_SET_CLEAR)
#define ACTION_LAYER_ONESHOT(layer) ACTION_LAYER_TAP((layer), OP_ONESHOT)
#define ACTION_LAYER_MODS(layer, mods) ACTION_LAYER_TAP((layer), 0xe0 | ((mods)&0x0f))
#define ACTION_LAYER_MODS(layer, mods) ACTION(ACT_LAYER_MODS, (layer) << 8 | (mods))
/* With Tapping */
#define ACTION_LAYER_TAP_KEY(layer, key) ACTION_LAYER_TAP((layer), (key))
#define ACTION_LAYER_TAP_TOGGLE(layer) ACTION_LAYER_TAP((layer), OP_TAP_TOGGLE)

View File

@@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdbool.h>
#define EECONFIG_MAGIC_NUMBER (uint16_t)0xFEED
#define EECONFIG_MAGIC_NUMBER (uint16_t)0xFEEE
#define EECONFIG_MAGIC_NUMBER_OFF (uint16_t)0xFFFF
/* EEPROM parameter address */

View File

@@ -13,8 +13,8 @@ extern "C" {
# define wait_us(us) _delay_us(us)
#elif defined PROTOCOL_CHIBIOS
# include "ch.h"
# define wait_ms(ms) chThdSleepMilliseconds(ms)
# define wait_us(us) chThdSleepMicroseconds(us)
# define wait_ms(ms) do { if (ms != 0) { chThdSleepMilliseconds(ms); } else { chThdSleepMicroseconds(1); } } while (0)
# define wait_us(us) do { if (us != 0) { chThdSleepMicroseconds(us); } else { chThdSleepMicroseconds(1); } } while (0)
#elif defined PROTOCOL_ARM_ATSAM
# include "clks.h"
# define wait_ms(ms) CLK_delay_ms(ms)

View File

@@ -41,7 +41,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <util/delay.h>
#include "xt.h"
#include "wait.h"
#include "print.h"
#include "debug.h"
static inline uint8_t pbuf_dequeue(void);
static inline void pbuf_enqueue(uint8_t data);
@@ -138,7 +138,7 @@ static inline void pbuf_enqueue(uint8_t data)
pbuf[pbuf_head] = data;
pbuf_head = next;
} else {
print("pbuf: full\n");
dprintf("pbuf: full\n");
}
SREG = sreg;
}

View File

@@ -34,7 +34,7 @@ function install_drivers {
pushd "$download_dir"
cp -f "$dir/drivers.txt" .
echo
cmd.exe /c "qmk_driver_installer.exe $1 $2 drivers.txt"
cmd.exe //c "qmk_driver_installer.exe $1 $2 drivers.txt"
popd > /dev/null
}