Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc146e32dc | ||
|
|
68fad7b777 | ||
|
|
7c2bee8b88 | ||
|
|
1e1b55fbdf | ||
|
|
d7754a19b9 |
No files matched your search
@@ -38,7 +38,7 @@ or `keymap.c`:
|
|||||||
} else {
|
} else {
|
||||||
tap_code(KC_PGUP);
|
tap_code(KC_PGUP);
|
||||||
}
|
}
|
||||||
} else if (index == 2) {
|
} else if (index == 1) { /* Second encoder
|
||||||
if (clockwise) {
|
if (clockwise) {
|
||||||
tap_code(KC_UP);
|
tap_code(KC_UP);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -12,9 +12,8 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
|||||||
MIDI_ENABLE = no # MIDI controls
|
MIDI_ENABLE = no # MIDI controls
|
||||||
AUDIO_ENABLE = no # Audio output on port C6
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
UNICODE_ENABLE = no # Unicode
|
UNICODE_ENABLE = no # Unicode
|
||||||
UNICODEMAP_ENABLE = yes
|
|
||||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||||
PS2_USE_USART = yes
|
PS2_USE_USART = yes
|
||||||
API_SYSEX_ENABLE = no
|
API_SYSEX_ENABLE = no
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
|||||||
MIDI_ENABLE = no # MIDI controls
|
MIDI_ENABLE = no # MIDI controls
|
||||||
AUDIO_ENABLE = no # Audio output on port C6
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
UNICODE_ENABLE = no # Unicode
|
UNICODE_ENABLE = no # Unicode
|
||||||
UNICODEMAP_ENABLE = yes
|
|
||||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||||
PS2_USE_USART = yes
|
PS2_USE_USART = yes
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
|||||||
MIDI_ENABLE = no # MIDI controls
|
MIDI_ENABLE = no # MIDI controls
|
||||||
AUDIO_ENABLE = no # Audio output on port C6
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
UNICODE_ENABLE = no # Unicode
|
UNICODE_ENABLE = no # Unicode
|
||||||
UNICODEMAP_ENABLE = no
|
|
||||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
|||||||
MIDI_ENABLE = no # MIDI controls
|
MIDI_ENABLE = no # MIDI controls
|
||||||
AUDIO_ENABLE = no # Audio output on port C6
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
UNICODE_ENABLE = no # Unicode
|
UNICODE_ENABLE = no # Unicode
|
||||||
UNICODEMAP_ENABLE = yes
|
|
||||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
#include "rev1.h"
|
#include "rev1.h"
|
||||||
|
|
||||||
void led_set_kb(uint8_t usb_led) {
|
void led_set_kb(uint8_t usb_led) {
|
||||||
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||||
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
|
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
|
||||||
writePinHigh(B2);
|
|
||||||
} else {
|
|
||||||
writePinLow(B2);
|
writePinLow(B2);
|
||||||
|
} else {
|
||||||
|
writePinHigh(B2);
|
||||||
}
|
}
|
||||||
|
|
||||||
led_set_user(usb_led);
|
led_set_user(usb_led);
|
||||||
}
|
}
|
||||||
|
|
||||||
void matrix_init_kb(void) {
|
void matrix_init_kb(void) {
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
#include "rev2.h"
|
#include "rev2.h"
|
||||||
|
|
||||||
void led_set_kb(uint8_t usb_led) {
|
void led_set_kb(uint8_t usb_led) {
|
||||||
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||||
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
|
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
|
||||||
writePinHigh(B2);
|
|
||||||
} else {
|
|
||||||
writePinLow(B2);
|
writePinLow(B2);
|
||||||
|
} else {
|
||||||
|
writePinHigh(B2);
|
||||||
}
|
}
|
||||||
|
|
||||||
led_set_user(usb_led);
|
led_set_user(usb_led);
|
||||||
}
|
}
|
||||||
|
|
||||||
void matrix_init_kb(void) {
|
void matrix_init_kb(void) {
|
||||||
|
|||||||
@@ -17,9 +17,6 @@
|
|||||||
#include "process_unicodemap.h"
|
#include "process_unicodemap.h"
|
||||||
#include "process_unicode_common.h"
|
#include "process_unicode_common.h"
|
||||||
|
|
||||||
__attribute__((weak))
|
|
||||||
const uint32_t PROGMEM unicode_map[] = {};
|
|
||||||
|
|
||||||
void register_hex32(uint32_t hex) {
|
void register_hex32(uint32_t hex) {
|
||||||
bool onzerostart = true;
|
bool onzerostart = true;
|
||||||
for(int i = 7; i >= 0; i--) {
|
for(int i = 7; i >= 0; i--) {
|
||||||
|
|||||||
@@ -19,5 +19,7 @@
|
|||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
#include "process_unicode_common.h"
|
#include "process_unicode_common.h"
|
||||||
|
|
||||||
|
extern const uint32_t PROGMEM unicode_map[];
|
||||||
|
|
||||||
void unicodemap_input_error(void);
|
void unicodemap_input_error(void);
|
||||||
bool process_unicodemap(uint16_t keycode, keyrecord_t *record);
|
bool process_unicodemap(uint16_t keycode, keyrecord_t *record);
|
||||||
+44
-2
@@ -58,6 +58,7 @@ const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90};
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
rgblight_config_t rgblight_config;
|
rgblight_config_t rgblight_config;
|
||||||
|
bool is_rgblight_initialized = false;
|
||||||
|
|
||||||
LED_TYPE led[RGBLED_NUM];
|
LED_TYPE led[RGBLED_NUM];
|
||||||
bool rgblight_timer_enabled = false;
|
bool rgblight_timer_enabled = false;
|
||||||
@@ -123,6 +124,35 @@ void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1) {
|
|||||||
(*led1).b = b;
|
(*led1).b = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void rgblight_check_config(void) {
|
||||||
|
/* Add some out of bound checks for RGB light config */
|
||||||
|
|
||||||
|
if (rgblight_config.mode < RGBLIGHT_MODE_STATIC_LIGHT) {
|
||||||
|
rgblight_config.mode = RGBLIGHT_MODE_STATIC_LIGHT;
|
||||||
|
}
|
||||||
|
else if (rgblight_config.mode > RGBLIGHT_MODES) {
|
||||||
|
rgblight_config.mode = RGBLIGHT_MODES;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rgblight_config.hue < 0) {
|
||||||
|
rgblight_config.hue = 0;
|
||||||
|
} else if (rgblight_config.hue > 360) {
|
||||||
|
rgblight_config.hue %= 360;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rgblight_config.sat < 0) {
|
||||||
|
rgblight_config.sat = 0;
|
||||||
|
} else if (rgblight_config.sat > 255) {
|
||||||
|
rgblight_config.sat = 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rgblight_config.val < 0) {
|
||||||
|
rgblight_config.val = 0;
|
||||||
|
} else if (rgblight_config.val > RGBLIGHT_LIMIT_VAL) {
|
||||||
|
rgblight_config.val = RGBLIGHT_LIMIT_VAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t eeconfig_read_rgblight(void) {
|
uint32_t eeconfig_read_rgblight(void) {
|
||||||
#if defined(__AVR__) || defined(STM32_EEPROM_ENABLE) || defined(PROTOCOL_ARM_ATSAM) || defined(EEPROM_SIZE)
|
#if defined(__AVR__) || defined(STM32_EEPROM_ENABLE) || defined(PROTOCOL_ARM_ATSAM) || defined(EEPROM_SIZE)
|
||||||
@@ -131,13 +161,14 @@ uint32_t eeconfig_read_rgblight(void) {
|
|||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void eeconfig_update_rgblight(uint32_t val) {
|
void eeconfig_update_rgblight(uint32_t val) {
|
||||||
#if defined(__AVR__) || defined(STM32_EEPROM_ENABLE) || defined(PROTOCOL_ARM_ATSAM) || defined(EEPROM_SIZE)
|
#if defined(__AVR__) || defined(STM32_EEPROM_ENABLE) || defined(PROTOCOL_ARM_ATSAM) || defined(EEPROM_SIZE)
|
||||||
if (eeconfig_read_rgblight() != val) {
|
rgblight_check_config();
|
||||||
eeprom_update_dword(EECONFIG_RGBLIGHT, val);
|
eeprom_update_dword(EECONFIG_RGBLIGHT, val);
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void eeconfig_update_rgblight_default(void) {
|
void eeconfig_update_rgblight_default(void) {
|
||||||
//dprintf("eeconfig_update_rgblight_default\n");
|
//dprintf("eeconfig_update_rgblight_default\n");
|
||||||
rgblight_config.enable = 1;
|
rgblight_config.enable = 1;
|
||||||
@@ -148,6 +179,7 @@ void eeconfig_update_rgblight_default(void) {
|
|||||||
rgblight_config.speed = 0;
|
rgblight_config.speed = 0;
|
||||||
eeconfig_update_rgblight(rgblight_config.raw);
|
eeconfig_update_rgblight(rgblight_config.raw);
|
||||||
}
|
}
|
||||||
|
|
||||||
void eeconfig_debug_rgblight(void) {
|
void eeconfig_debug_rgblight(void) {
|
||||||
dprintf("rgblight_config eprom\n");
|
dprintf("rgblight_config eprom\n");
|
||||||
dprintf("rgblight_config.enable = %d\n", rgblight_config.enable);
|
dprintf("rgblight_config.enable = %d\n", rgblight_config.enable);
|
||||||
@@ -159,6 +191,11 @@ void eeconfig_debug_rgblight(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void rgblight_init(void) {
|
void rgblight_init(void) {
|
||||||
|
/* if already initialized, don't do it again.
|
||||||
|
If you must do it again, extern this and set to false, first.
|
||||||
|
This is a dirty, dirty hack until proper hooks can be added for keyboard startup. */
|
||||||
|
if (is_rgblight_initialized) { return; }
|
||||||
|
|
||||||
debug_enable = 1; // Debug ON!
|
debug_enable = 1; // Debug ON!
|
||||||
dprintf("rgblight_init called.\n");
|
dprintf("rgblight_init called.\n");
|
||||||
dprintf("rgblight_init start!\n");
|
dprintf("rgblight_init start!\n");
|
||||||
@@ -173,6 +210,8 @@ void rgblight_init(void) {
|
|||||||
eeconfig_update_rgblight_default();
|
eeconfig_update_rgblight_default();
|
||||||
rgblight_config.raw = eeconfig_read_rgblight();
|
rgblight_config.raw = eeconfig_read_rgblight();
|
||||||
}
|
}
|
||||||
|
rgblight_check_config();
|
||||||
|
|
||||||
eeconfig_debug_rgblight(); // display current eeprom values
|
eeconfig_debug_rgblight(); // display current eeprom values
|
||||||
|
|
||||||
#ifdef RGBLIGHT_USE_TIMER
|
#ifdef RGBLIGHT_USE_TIMER
|
||||||
@@ -182,6 +221,9 @@ void rgblight_init(void) {
|
|||||||
if (rgblight_config.enable) {
|
if (rgblight_config.enable) {
|
||||||
rgblight_mode_noeeprom(rgblight_config.mode);
|
rgblight_mode_noeeprom(rgblight_config.mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_rgblight_initialized = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void rgblight_update_dword(uint32_t dword) {
|
void rgblight_update_dword(uint32_t dword) {
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ extern const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[3] PROGMEM;
|
|||||||
extern const uint8_t RGBLED_SNAKE_INTERVALS[3] PROGMEM;
|
extern const uint8_t RGBLED_SNAKE_INTERVALS[3] PROGMEM;
|
||||||
extern const uint8_t RGBLED_KNIGHT_INTERVALS[3] PROGMEM;
|
extern const uint8_t RGBLED_KNIGHT_INTERVALS[3] PROGMEM;
|
||||||
extern const uint16_t RGBLED_RGBTEST_INTERVALS[1] PROGMEM;
|
extern const uint16_t RGBLED_RGBTEST_INTERVALS[1] PROGMEM;
|
||||||
|
extern bool is_rgblight_initialized;
|
||||||
|
|
||||||
typedef union {
|
typedef union {
|
||||||
uint32_t raw;
|
uint32_t raw;
|
||||||
|
|||||||
+6
-2
@@ -39,9 +39,13 @@ include $(STARTUP_MK)
|
|||||||
# HAL-OSAL files (optional).
|
# HAL-OSAL files (optional).
|
||||||
include $(CHIBIOS)/os/hal/hal.mk
|
include $(CHIBIOS)/os/hal/hal.mk
|
||||||
|
|
||||||
PLATFORM_MK = $(CHIBIOS)/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)/platform.mk
|
ifeq ("$(PLATFORM_NAME)","")
|
||||||
|
PLATFORM_NAME = platform
|
||||||
|
endif
|
||||||
|
|
||||||
|
PLATFORM_MK = $(CHIBIOS)/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)/$(PLATFORM_NAME).mk
|
||||||
ifeq ("$(wildcard $(PLATFORM_MK))","")
|
ifeq ("$(wildcard $(PLATFORM_MK))","")
|
||||||
PLATFORM_MK = $(CHIBIOS_CONTRIB)/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)/platform.mk
|
PLATFORM_MK = $(CHIBIOS_CONTRIB)/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)/$(PLATFORM_NAME).mk
|
||||||
endif
|
endif
|
||||||
include $(PLATFORM_MK)
|
include $(PLATFORM_MK)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user