From e47ab6a5752e16bd3b4288153798c12af1bee3d5 Mon Sep 17 00:00:00 2001 From: Wilba Date: Sat, 12 Oct 2019 15:37:03 +1100 Subject: [PATCH] [Keyboard] wilba.tech PCB refactoring (#6982) * Cleanup * Refactor VIA rules.mk * WT mono backlight refactor, VIA support * Added WT75-C * Fixed compile error * Cleanup rules.mk * Review changes * Review changes --- keyboards/aeboards/aegis/config.h | 2 - keyboards/aeboards/ext65/config.h | 2 - keyboards/snagpad/config.h | 3 - keyboards/wilba_tech/rama_works_koyu/rules.mk | 46 +-- .../wilba_tech/rama_works_m10_b/config.h | 2 - .../wilba_tech/rama_works_m10_b/rules.mk | 46 +-- .../wilba_tech/rama_works_m60_a/rules.mk | 44 +-- keyboards/wilba_tech/rama_works_m6_a/rules.mk | 45 +-- keyboards/wilba_tech/rama_works_m6_b/rules.mk | 46 +-- .../wilba_tech/rama_works_u80_a/config.h | 2 - .../wilba_tech/rama_works_u80_a/rules.mk | 46 +-- keyboards/wilba_tech/wt60_a/config.h | 35 +- .../wilba_tech/wt60_a/keymaps/via/rules.mk | 69 ---- keyboards/wilba_tech/wt60_a/rules.mk | 1 + .../wilba_tech/wt60_d/keymaps/via/rules.mk | 66 ---- keyboards/wilba_tech/wt60_d/rules.mk | 49 +-- keyboards/wilba_tech/wt65_a/config.h | 32 +- .../wilba_tech/wt65_a/keymaps/via/rules.mk | 69 ---- keyboards/wilba_tech/wt65_a/rules.mk | 47 +-- keyboards/wilba_tech/wt65_b/config.h | 32 +- .../wilba_tech/wt65_b/keymaps/via/rules.mk | 69 ---- keyboards/wilba_tech/wt65_b/rules.mk | 47 +-- .../wilba_tech/wt69_a/keymaps/via/rules.mk | 66 ---- keyboards/wilba_tech/wt69_a/rules.mk | 48 +-- keyboards/wilba_tech/wt75_a/config.h | 35 +- .../wilba_tech/wt75_a/keymaps/via/rules.mk | 69 ---- keyboards/wilba_tech/wt75_a/rules.mk | 47 +-- keyboards/wilba_tech/wt75_b/config.h | 35 +- .../wilba_tech/wt75_b/keymaps/via/rules.mk | 69 ---- keyboards/wilba_tech/wt75_b/rules.mk | 47 +-- keyboards/wilba_tech/wt75_c/config.h | 223 ++++++++++++ keyboards/wilba_tech/wt75_c/info.json | 12 + .../wt75_c/keymaps/default/keymap.c | 41 +++ .../wilba_tech/wt75_c/keymaps/via/keymap.c | 41 +++ .../wilba_tech/wt75_c/keymaps/via/rules.mk | 2 + keyboards/wilba_tech/wt75_c/readme.md | 13 + keyboards/wilba_tech/wt75_c/rules.mk | 39 ++ keyboards/wilba_tech/wt75_c/wt75_c.c | 17 + keyboards/wilba_tech/wt75_c/wt75_c.h | 46 +++ keyboards/wilba_tech/wt80_a/config.h | 32 +- .../wilba_tech/wt80_a/keymaps/via/rules.mk | 69 ---- keyboards/wilba_tech/wt80_a/rules.mk | 47 +-- keyboards/wilba_tech/wt8_a/rules.mk | 49 +-- keyboards/wilba_tech/wt_main.c | 54 ++- keyboards/wilba_tech/wt_mono_backlight.c | 341 +++++++++++++++++- keyboards/wilba_tech/wt_mono_backlight.h | 48 ++- keyboards/wilba_tech/zeal60/rules.mk | 46 +-- keyboards/wilba_tech/zeal65/rules.mk | 46 +-- 48 files changed, 1132 insertions(+), 1250 deletions(-) create mode 100644 keyboards/wilba_tech/wt75_c/config.h create mode 100644 keyboards/wilba_tech/wt75_c/info.json create mode 100644 keyboards/wilba_tech/wt75_c/keymaps/default/keymap.c create mode 100644 keyboards/wilba_tech/wt75_c/keymaps/via/keymap.c create mode 100644 keyboards/wilba_tech/wt75_c/keymaps/via/rules.mk create mode 100644 keyboards/wilba_tech/wt75_c/readme.md create mode 100644 keyboards/wilba_tech/wt75_c/rules.mk create mode 100644 keyboards/wilba_tech/wt75_c/wt75_c.c create mode 100644 keyboards/wilba_tech/wt75_c/wt75_c.h diff --git a/keyboards/aeboards/aegis/config.h b/keyboards/aeboards/aegis/config.h index d8c256c7d9..2a35897300 100644 --- a/keyboards/aeboards/aegis/config.h +++ b/keyboards/aeboards/aegis/config.h @@ -47,8 +47,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -//#define WT_MONO_BACKLIGHT - #define DYNAMIC_KEYMAP_LAYER_COUNT 4 // EEPROM usage diff --git a/keyboards/aeboards/ext65/config.h b/keyboards/aeboards/ext65/config.h index b3e1b8c2f0..7255b463fc 100644 --- a/keyboards/aeboards/ext65/config.h +++ b/keyboards/aeboards/ext65/config.h @@ -47,8 +47,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -//#define WT_MONO_BACKLIGHT - #define DYNAMIC_KEYMAP_LAYER_COUNT 4 // EEPROM usage diff --git a/keyboards/snagpad/config.h b/keyboards/snagpad/config.h index cd32a3d8c2..a4ab9d5e26 100644 --- a/keyboards/snagpad/config.h +++ b/keyboards/snagpad/config.h @@ -48,9 +48,6 @@ #define RGBLIGHT_VAL_STEP 8 #endif -// Does not use WT_MONO_BACKLIGHT -// #define WT_MONO_BACKLIGHT - #define DYNAMIC_KEYMAP_LAYER_COUNT 4 // EEPROM usage diff --git a/keyboards/wilba_tech/rama_works_koyu/rules.mk b/keyboards/wilba_tech/rama_works_koyu/rules.mk index 9839602247..ebcb6a455f 100644 --- a/keyboards/wilba_tech/rama_works_koyu/rules.mk +++ b/keyboards/wilba_tech/rama_works_koyu/rules.mk @@ -1,5 +1,3 @@ - - # project specific files SRC = keyboards/wilba_tech/wt_main.c \ keyboards/wilba_tech/wt_rgb_backlight.c \ @@ -10,42 +8,14 @@ SRC = keyboards/wilba_tech/wt_main.c \ # MCU name 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 - -# Boot Section +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp BOOTLOADER = atmel-dfu # Do not put the microcontroller into power saving mode diff --git a/keyboards/wilba_tech/rama_works_m10_b/config.h b/keyboards/wilba_tech/rama_works_m10_b/config.h index 6901309a08..f72ecae85c 100644 --- a/keyboards/wilba_tech/rama_works_m10_b/config.h +++ b/keyboards/wilba_tech/rama_works_m10_b/config.h @@ -181,8 +181,6 @@ along with this program. If not, see . /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 -//#define WT_MONO_BACKLIGHT - #define DYNAMIC_KEYMAP_LAYER_COUNT 4 // EEPROM usage diff --git a/keyboards/wilba_tech/rama_works_m10_b/rules.mk b/keyboards/wilba_tech/rama_works_m10_b/rules.mk index 70258b9ead..99330021f2 100644 --- a/keyboards/wilba_tech/rama_works_m10_b/rules.mk +++ b/keyboards/wilba_tech/rama_works_m10_b/rules.mk @@ -4,44 +4,14 @@ SRC = keyboards/wilba_tech/wt_main.c # MCU name 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 - - -# Boot Section +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp BOOTLOADER = atmel-dfu diff --git a/keyboards/wilba_tech/rama_works_m60_a/rules.mk b/keyboards/wilba_tech/rama_works_m60_a/rules.mk index 3b2287333c..4ce5dc54cb 100644 --- a/keyboards/wilba_tech/rama_works_m60_a/rules.mk +++ b/keyboards/wilba_tech/rama_works_m60_a/rules.mk @@ -10,42 +10,14 @@ SRC = keyboards/wilba_tech/wt_main.c \ # MCU name 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 - -# Boot Section +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp BOOTLOADER = atmel-dfu # Do not put the microcontroller into power saving mode diff --git a/keyboards/wilba_tech/rama_works_m6_a/rules.mk b/keyboards/wilba_tech/rama_works_m6_a/rules.mk index 4270e7090c..32f0e25de8 100644 --- a/keyboards/wilba_tech/rama_works_m6_a/rules.mk +++ b/keyboards/wilba_tech/rama_works_m6_a/rules.mk @@ -4,43 +4,14 @@ SRC = keyboards/wilba_tech/wt_main.c # MCU name 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 - -# Boot Section +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp BOOTLOADER = atmel-dfu # Do not put the microcontroller into power saving mode diff --git a/keyboards/wilba_tech/rama_works_m6_b/rules.mk b/keyboards/wilba_tech/rama_works_m6_b/rules.mk index 6b7b3a63d8..c016fa344f 100644 --- a/keyboards/wilba_tech/rama_works_m6_b/rules.mk +++ b/keyboards/wilba_tech/rama_works_m6_b/rules.mk @@ -5,47 +5,17 @@ SRC = keyboards/wilba_tech/wt_main.c \ drivers/issi/is31fl3218.c \ drivers/avr/i2c_master.c - # MCU name 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 - -# Boot Section +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp BOOTLOADER = atmel-dfu # Do not put the microcontroller into power saving mode diff --git a/keyboards/wilba_tech/rama_works_u80_a/config.h b/keyboards/wilba_tech/rama_works_u80_a/config.h index 348b124b90..d0bf0ed1e3 100644 --- a/keyboards/wilba_tech/rama_works_u80_a/config.h +++ b/keyboards/wilba_tech/rama_works_u80_a/config.h @@ -179,8 +179,6 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 -//#define WT_MONO_BACKLIGHT - // IS31FL3731 driver #define DRIVER_COUNT 3 #define DRIVER_LED_TOTAL 108 diff --git a/keyboards/wilba_tech/rama_works_u80_a/rules.mk b/keyboards/wilba_tech/rama_works_u80_a/rules.mk index 6079ad8932..caecaecbb7 100644 --- a/keyboards/wilba_tech/rama_works_u80_a/rules.mk +++ b/keyboards/wilba_tech/rama_works_u80_a/rules.mk @@ -8,44 +8,14 @@ SRC = keyboards/wilba_tech/wt_main.c \ # MCU name 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 - - -# Boot Section +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp BOOTLOADER = atmel-dfu diff --git a/keyboards/wilba_tech/wt60_a/config.h b/keyboards/wilba_tech/wt60_a/config.h index 3ac8ea6fc0..6e1e0e81cc 100644 --- a/keyboards/wilba_tech/wt60_a/config.h +++ b/keyboards/wilba_tech/wt60_a/config.h @@ -179,14 +179,33 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 -#define WT_MONO_BACKLIGHT +// enable the mono backlight +#define MONO_BACKLIGHT_ENABLED 1 + +// enable the RGB indicator for WT75-A +#define MONO_BACKLIGHT_WT75_A + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define MONO_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 + +// disable backlight after timeout in minutes, 0 = no timeout +#define MONO_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default brightness +#define MONO_BACKLIGHT_BRIGHTNESS 255 + +// the default effect +#define MONO_BACKLIGHT_EFFECT 1 + +// the default effect speed (0-3) +#define MONO_BACKLIGHT_EFFECT_SPEED 0 #define DYNAMIC_KEYMAP_LAYER_COUNT 4 // EEPROM usage // TODO: refactor with new user EEPROM code (coming soon) -#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC 0x4520 #define EEPROM_MAGIC_ADDR 34 // Bump this every time we change what we store // This will automatically reset the EEPROM with defaults @@ -194,9 +213,11 @@ #define EEPROM_VERSION 0x08 #define EEPROM_VERSION_ADDR 36 -// Dynamic keymap starts after EEPROM version -#define DYNAMIC_KEYMAP_EEPROM_ADDR 37 -// Dynamic macro starts after dynamic keymaps (37+(4*5*14*2)) = (37+560) -#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 597 -#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 427 +// Backlight config starts after EEPROM version +#define MONO_BACKLIGHT_CONFIG_EEPROM_ADDR 37 +// Dynamic keymap starts after backlight config (37+7) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 44 +// Dynamic macro starts after dynamic keymaps (44+(4*5*14*2)) = (44+560) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 604 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 420 #define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/wt60_a/keymaps/via/rules.mk b/keyboards/wilba_tech/wt60_a/keymaps/via/rules.mk index 76a07d7a44..8834bf0c8e 100644 --- a/keyboards/wilba_tech/wt60_a/keymaps/via/rules.mk +++ b/keyboards/wilba_tech/wt60_a/keymaps/via/rules.mk @@ -1,71 +1,2 @@ -# project specific files -SRC = drivers/issi/is31fl3736.c \ - drivers/avr/i2c_master.c \ - keyboards/wilba_tech/wt_mono_backlight.c \ - keyboards/wilba_tech/wt_main.c - -# MCU name -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 - - -# Boot Section -BOOTLOADER = atmel-dfu - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches - RAW_ENABLE = yes DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt60_a/rules.mk b/keyboards/wilba_tech/wt60_a/rules.mk index e41f2186b3..4f702fab49 100644 --- a/keyboards/wilba_tech/wt60_a/rules.mk +++ b/keyboards/wilba_tech/wt60_a/rules.mk @@ -1,6 +1,7 @@ # project specific files SRC = drivers/issi/is31fl3736.c \ drivers/avr/i2c_master.c \ + quantum/color.c \ keyboards/wilba_tech/wt_mono_backlight.c \ keyboards/wilba_tech/wt_main.c diff --git a/keyboards/wilba_tech/wt60_d/keymaps/via/rules.mk b/keyboards/wilba_tech/wt60_d/keymaps/via/rules.mk index f072c67198..8834bf0c8e 100644 --- a/keyboards/wilba_tech/wt60_d/keymaps/via/rules.mk +++ b/keyboards/wilba_tech/wt60_d/keymaps/via/rules.mk @@ -1,68 +1,2 @@ -# project specific files -SRC = keyboards/wilba_tech/wt_main.c - -# MCU name -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 - - -# Boot Section -BOOTLOADER = atmel-dfu - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches - RAW_ENABLE = yes DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt60_d/rules.mk b/keyboards/wilba_tech/wt60_d/rules.mk index f072c67198..7ba0b9223b 100644 --- a/keyboards/wilba_tech/wt60_d/rules.mk +++ b/keyboards/wilba_tech/wt60_d/rules.mk @@ -1,50 +1,19 @@ # project specific files SRC = keyboards/wilba_tech/wt_main.c - + # MCU name 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 - - -# Boot Section +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp BOOTLOADER = atmel-dfu - # Build Options # change yes to no to disable # diff --git a/keyboards/wilba_tech/wt65_a/config.h b/keyboards/wilba_tech/wt65_a/config.h index f1bcb990aa..9d67c317b2 100644 --- a/keyboards/wilba_tech/wt65_a/config.h +++ b/keyboards/wilba_tech/wt65_a/config.h @@ -179,14 +179,30 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 -#define WT_MONO_BACKLIGHT +// enable the mono backlight +#define MONO_BACKLIGHT_ENABLED 1 + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define MONO_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 + +// disable backlight after timeout in minutes, 0 = no timeout +#define MONO_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default brightness +#define MONO_BACKLIGHT_BRIGHTNESS 255 + +// the default effect +#define MONO_BACKLIGHT_EFFECT 1 + +// the default effect speed (0-3) +#define MONO_BACKLIGHT_EFFECT_SPEED 0 #define DYNAMIC_KEYMAP_LAYER_COUNT 4 // EEPROM usage // TODO: refactor with new user EEPROM code (coming soon) -#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC 0x4520 #define EEPROM_MAGIC_ADDR 34 // Bump this every time we change what we store // This will automatically reset the EEPROM with defaults @@ -194,9 +210,11 @@ #define EEPROM_VERSION 0x08 #define EEPROM_VERSION_ADDR 36 -// Dynamic keymap starts after EEPROM version -#define DYNAMIC_KEYMAP_EEPROM_ADDR 37 -// Dynamic macro starts after dynamic keymaps (37+(4*5*15*2)) = (37+600) -#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 637 -#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 387 +// Backlight config starts after EEPROM version +#define MONO_BACKLIGHT_CONFIG_EEPROM_ADDR 37 +// Dynamic keymap starts after backlight config (37+7) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 44 +// Dynamic macro starts after dynamic keymaps (44+(4*5*15*2)) = (44+600) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 644 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 380 #define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/wt65_a/keymaps/via/rules.mk b/keyboards/wilba_tech/wt65_a/keymaps/via/rules.mk index 76a07d7a44..8834bf0c8e 100644 --- a/keyboards/wilba_tech/wt65_a/keymaps/via/rules.mk +++ b/keyboards/wilba_tech/wt65_a/keymaps/via/rules.mk @@ -1,71 +1,2 @@ -# project specific files -SRC = drivers/issi/is31fl3736.c \ - drivers/avr/i2c_master.c \ - keyboards/wilba_tech/wt_mono_backlight.c \ - keyboards/wilba_tech/wt_main.c - -# MCU name -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 - - -# Boot Section -BOOTLOADER = atmel-dfu - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches - RAW_ENABLE = yes DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt65_a/rules.mk b/keyboards/wilba_tech/wt65_a/rules.mk index e41f2186b3..9b5bd1e7f9 100644 --- a/keyboards/wilba_tech/wt65_a/rules.mk +++ b/keyboards/wilba_tech/wt65_a/rules.mk @@ -1,50 +1,21 @@ # project specific files SRC = drivers/issi/is31fl3736.c \ drivers/avr/i2c_master.c \ + quantum/color.c \ keyboards/wilba_tech/wt_mono_backlight.c \ keyboards/wilba_tech/wt_main.c # MCU name 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 - - -# Boot Section +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp BOOTLOADER = atmel-dfu diff --git a/keyboards/wilba_tech/wt65_b/config.h b/keyboards/wilba_tech/wt65_b/config.h index 765ed8ee1d..8b2437fc92 100644 --- a/keyboards/wilba_tech/wt65_b/config.h +++ b/keyboards/wilba_tech/wt65_b/config.h @@ -179,14 +179,30 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 -#define WT_MONO_BACKLIGHT +// enable the mono backlight +#define MONO_BACKLIGHT_ENABLED 1 + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define MONO_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 + +// disable backlight after timeout in minutes, 0 = no timeout +#define MONO_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default brightness +#define MONO_BACKLIGHT_BRIGHTNESS 255 + +// the default effect +#define MONO_BACKLIGHT_EFFECT 1 + +// the default effect speed (0-3) +#define MONO_BACKLIGHT_EFFECT_SPEED 0 #define DYNAMIC_KEYMAP_LAYER_COUNT 4 // EEPROM usage // TODO: refactor with new user EEPROM code (coming soon) -#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC 0x4520 #define EEPROM_MAGIC_ADDR 34 // Bump this every time we change what we store // This will automatically reset the EEPROM with defaults @@ -194,9 +210,11 @@ #define EEPROM_VERSION 0x08 #define EEPROM_VERSION_ADDR 36 -// Dynamic keymap starts after EEPROM version -#define DYNAMIC_KEYMAP_EEPROM_ADDR 37 -// Dynamic macro starts after dynamic keymaps (37+(4*5*15*2)) = (37+600) -#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 637 -#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 387 +// Backlight config starts after EEPROM version +#define MONO_BACKLIGHT_CONFIG_EEPROM_ADDR 37 +// Dynamic keymap starts after backlight config (37+7) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 44 +// Dynamic macro starts after dynamic keymaps (44+(4*5*15*2)) = (44+600) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 644 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 380 #define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/wt65_b/keymaps/via/rules.mk b/keyboards/wilba_tech/wt65_b/keymaps/via/rules.mk index 76a07d7a44..8834bf0c8e 100644 --- a/keyboards/wilba_tech/wt65_b/keymaps/via/rules.mk +++ b/keyboards/wilba_tech/wt65_b/keymaps/via/rules.mk @@ -1,71 +1,2 @@ -# project specific files -SRC = drivers/issi/is31fl3736.c \ - drivers/avr/i2c_master.c \ - keyboards/wilba_tech/wt_mono_backlight.c \ - keyboards/wilba_tech/wt_main.c - -# MCU name -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 - - -# Boot Section -BOOTLOADER = atmel-dfu - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches - RAW_ENABLE = yes DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt65_b/rules.mk b/keyboards/wilba_tech/wt65_b/rules.mk index e41f2186b3..9b5bd1e7f9 100644 --- a/keyboards/wilba_tech/wt65_b/rules.mk +++ b/keyboards/wilba_tech/wt65_b/rules.mk @@ -1,50 +1,21 @@ # project specific files SRC = drivers/issi/is31fl3736.c \ drivers/avr/i2c_master.c \ + quantum/color.c \ keyboards/wilba_tech/wt_mono_backlight.c \ keyboards/wilba_tech/wt_main.c # MCU name 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 - - -# Boot Section +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp BOOTLOADER = atmel-dfu diff --git a/keyboards/wilba_tech/wt69_a/keymaps/via/rules.mk b/keyboards/wilba_tech/wt69_a/keymaps/via/rules.mk index f072c67198..8834bf0c8e 100644 --- a/keyboards/wilba_tech/wt69_a/keymaps/via/rules.mk +++ b/keyboards/wilba_tech/wt69_a/keymaps/via/rules.mk @@ -1,68 +1,2 @@ -# project specific files -SRC = keyboards/wilba_tech/wt_main.c - -# MCU name -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 - - -# Boot Section -BOOTLOADER = atmel-dfu - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches - RAW_ENABLE = yes DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt69_a/rules.mk b/keyboards/wilba_tech/wt69_a/rules.mk index f1c632289c..f349608cd9 100644 --- a/keyboards/wilba_tech/wt69_a/rules.mk +++ b/keyboards/wilba_tech/wt69_a/rules.mk @@ -1,47 +1,17 @@ # project specific files SRC = keyboards/wilba_tech/wt_main.c - + # MCU name 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 - - -# Boot Section +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp BOOTLOADER = atmel-dfu diff --git a/keyboards/wilba_tech/wt75_a/config.h b/keyboards/wilba_tech/wt75_a/config.h index 024370d54d..f63bbf69c7 100644 --- a/keyboards/wilba_tech/wt75_a/config.h +++ b/keyboards/wilba_tech/wt75_a/config.h @@ -179,14 +179,33 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 -#define WT_MONO_BACKLIGHT +// enable the mono backlight +#define MONO_BACKLIGHT_ENABLED 1 + +// enable the RGB indicator for WT75-A +#define MONO_BACKLIGHT_WT75_A + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define MONO_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 + +// disable backlight after timeout in minutes, 0 = no timeout +#define MONO_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default brightness +#define MONO_BACKLIGHT_BRIGHTNESS 255 + +// the default effect +#define MONO_BACKLIGHT_EFFECT 1 + +// the default effect speed (0-3) +#define MONO_BACKLIGHT_EFFECT_SPEED 0 #define DYNAMIC_KEYMAP_LAYER_COUNT 4 // EEPROM usage // TODO: refactor with new user EEPROM code (coming soon) -#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC 0x4520 #define EEPROM_MAGIC_ADDR 34 // Bump this every time we change what we store // This will automatically reset the EEPROM with defaults @@ -194,9 +213,11 @@ #define EEPROM_VERSION 0x08 #define EEPROM_VERSION_ADDR 36 -// Dynamic keymap starts after EEPROM version -#define DYNAMIC_KEYMAP_EEPROM_ADDR 37 -// Dynamic macro starts after dynamic keymaps (37+(4*6*15*2)) = (37+720) -#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 757 -#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 267 +// Backlight config starts after EEPROM version +#define MONO_BACKLIGHT_CONFIG_EEPROM_ADDR 37 +// Dynamic keymap starts after backlight config (37+7) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 44 +// Dynamic macro starts after dynamic keymaps (44+(4*6*15*2)) = (44+720) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 764 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 260 #define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/wt75_a/keymaps/via/rules.mk b/keyboards/wilba_tech/wt75_a/keymaps/via/rules.mk index 76a07d7a44..8834bf0c8e 100644 --- a/keyboards/wilba_tech/wt75_a/keymaps/via/rules.mk +++ b/keyboards/wilba_tech/wt75_a/keymaps/via/rules.mk @@ -1,71 +1,2 @@ -# project specific files -SRC = drivers/issi/is31fl3736.c \ - drivers/avr/i2c_master.c \ - keyboards/wilba_tech/wt_mono_backlight.c \ - keyboards/wilba_tech/wt_main.c - -# MCU name -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 - - -# Boot Section -BOOTLOADER = atmel-dfu - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches - RAW_ENABLE = yes DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt75_a/rules.mk b/keyboards/wilba_tech/wt75_a/rules.mk index e41f2186b3..9b5bd1e7f9 100644 --- a/keyboards/wilba_tech/wt75_a/rules.mk +++ b/keyboards/wilba_tech/wt75_a/rules.mk @@ -1,50 +1,21 @@ # project specific files SRC = drivers/issi/is31fl3736.c \ drivers/avr/i2c_master.c \ + quantum/color.c \ keyboards/wilba_tech/wt_mono_backlight.c \ keyboards/wilba_tech/wt_main.c # MCU name 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 - - -# Boot Section +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp BOOTLOADER = atmel-dfu diff --git a/keyboards/wilba_tech/wt75_b/config.h b/keyboards/wilba_tech/wt75_b/config.h index b8ada14e8f..b173b02417 100644 --- a/keyboards/wilba_tech/wt75_b/config.h +++ b/keyboards/wilba_tech/wt75_b/config.h @@ -179,14 +179,33 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 -#define WT_MONO_BACKLIGHT +// enable the mono backlight +#define MONO_BACKLIGHT_ENABLED 1 + +// enable the RGB indicator for WT75-A +#define MONO_BACKLIGHT_WT75_A + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define MONO_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 + +// disable backlight after timeout in minutes, 0 = no timeout +#define MONO_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default brightness +#define MONO_BACKLIGHT_BRIGHTNESS 255 + +// the default effect +#define MONO_BACKLIGHT_EFFECT 1 + +// the default effect speed (0-3) +#define MONO_BACKLIGHT_EFFECT_SPEED 0 #define DYNAMIC_KEYMAP_LAYER_COUNT 4 // EEPROM usage // TODO: refactor with new user EEPROM code (coming soon) -#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC 0x4520 #define EEPROM_MAGIC_ADDR 34 // Bump this every time we change what we store // This will automatically reset the EEPROM with defaults @@ -194,9 +213,11 @@ #define EEPROM_VERSION 0x08 #define EEPROM_VERSION_ADDR 36 -// Dynamic keymap starts after EEPROM version -#define DYNAMIC_KEYMAP_EEPROM_ADDR 37 -// Dynamic macro starts after dynamic keymaps (37+(4*6*16*2)) = (37+768) -#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 805 -#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 219 +// Backlight config starts after EEPROM version +#define MONO_BACKLIGHT_CONFIG_EEPROM_ADDR 37 +// Dynamic keymap starts after backlight config (37+7) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 44 +// Dynamic macro starts after dynamic keymaps (44+(4*6*16*2)) = (44+768) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 812 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 212 #define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/wt75_b/keymaps/via/rules.mk b/keyboards/wilba_tech/wt75_b/keymaps/via/rules.mk index 76a07d7a44..8834bf0c8e 100644 --- a/keyboards/wilba_tech/wt75_b/keymaps/via/rules.mk +++ b/keyboards/wilba_tech/wt75_b/keymaps/via/rules.mk @@ -1,71 +1,2 @@ -# project specific files -SRC = drivers/issi/is31fl3736.c \ - drivers/avr/i2c_master.c \ - keyboards/wilba_tech/wt_mono_backlight.c \ - keyboards/wilba_tech/wt_main.c - -# MCU name -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 - - -# Boot Section -BOOTLOADER = atmel-dfu - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches - RAW_ENABLE = yes DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt75_b/rules.mk b/keyboards/wilba_tech/wt75_b/rules.mk index e41f2186b3..9b5bd1e7f9 100644 --- a/keyboards/wilba_tech/wt75_b/rules.mk +++ b/keyboards/wilba_tech/wt75_b/rules.mk @@ -1,50 +1,21 @@ # project specific files SRC = drivers/issi/is31fl3736.c \ drivers/avr/i2c_master.c \ + quantum/color.c \ keyboards/wilba_tech/wt_mono_backlight.c \ keyboards/wilba_tech/wt_main.c # MCU name 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 - - -# Boot Section +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp BOOTLOADER = atmel-dfu diff --git a/keyboards/wilba_tech/wt75_c/config.h b/keyboards/wilba_tech/wt75_c/config.h new file mode 100644 index 0000000000..7105998774 --- /dev/null +++ b/keyboards/wilba_tech/wt75_c/config.h @@ -0,0 +1,223 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x6582 // wilba.tech +#define PRODUCT_ID 0x075C // 75-C +#define DEVICE_VER 0x0001 +#define MANUFACTURER wilba.tech +#define PRODUCT wilba.tech WT75-C +#define DESCRIPTION wilba.tech WT75-C + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 16 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F1, F0, E6, F4, F6, F7 } +#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6, B7, D4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +// enable the mono backlight +#define MONO_BACKLIGHT_ENABLED 1 + +// enable the RGB indicator for WT75-A +#define MONO_BACKLIGHT_WT75_A + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define MONO_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 + +// disable backlight after timeout in minutes, 0 = no timeout +#define MONO_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default brightness +#define MONO_BACKLIGHT_BRIGHTNESS 255 + +// the default effect +#define MONO_BACKLIGHT_EFFECT 1 + +// the default effect speed (0-3) +#define MONO_BACKLIGHT_EFFECT_SPEED 0 + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x4520 +#define EEPROM_MAGIC_ADDR 34 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 36 + +// Backlight config starts after EEPROM version +#define MONO_BACKLIGHT_CONFIG_EEPROM_ADDR 37 +// Dynamic keymap starts after backlight config (37+7) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 44 +// Dynamic macro starts after dynamic keymaps (44+(4*6*16*2)) = (44+768) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 812 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 212 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/wt75_c/info.json b/keyboards/wilba_tech/wt75_c/info.json new file mode 100644 index 0000000000..bf63b2d00f --- /dev/null +++ b/keyboards/wilba_tech/wt75_c/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "wilba.tech WT75-A", + "url": "https://wilba.tech", + "maintainer": "Wilba", + "width": 16.25, + "height": 6.5, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"0", "x":0, "y":0}, {"label":"1", "x":1.25, "y":0}, {"label":"2", "x":2.25, "y":0}, {"label":"3", "x":3.25, "y":0}, {"label":"4", "x":4.25, "y":0}, {"label":"5", "x":5.5, "y":0}, {"label":"6", "x":6.5, "y":0}, {"label":"7", "x":7.5, "y":0}, {"label":"8", "x":8.5, "y":0}, {"label":"9", "x":9.75, "y":0}, {"label":"10", "x":10.75, "y":0}, {"label":"11", "x":11.75, "y":0}, {"label":"12", "x":12.75, "y":0}, {"label":"13", "x":14, "y":0}, {"label":"14", "x":0, "y":1.25}, {"label":"15", "x":1, "y":1.25}, {"label":"16", "x":2, "y":1.25}, {"label":"17", "x":3, "y":1.25}, {"label":"18", "x":4, "y":1.25}, {"label":"19", "x":5, "y":1.25}, {"label":"20", "x":6, "y":1.25}, {"label":"21", "x":7, "y":1.25}, {"label":"22", "x":8, "y":1.25}, {"label":"23", "x":9, "y":1.25}, {"label":"24", "x":10, "y":1.25}, {"label":"25", "x":11, "y":1.25}, {"label":"26", "x":12, "y":1.25}, {"label":"27", "x":13, "y":1.25}, {"label":"28", "x":14, "y":1.25}, {"label":"29", "x":15.25, "y":1.25}, {"label":"30", "x":0, "y":2.25, "w":1.5}, {"label":"31", "x":1.5, "y":2.25}, {"label":"32", "x":2.5, "y":2.25}, {"label":"33", "x":3.5, "y":2.25}, {"label":"34", "x":4.5, "y":2.25}, {"label":"35", "x":5.5, "y":2.25}, {"label":"36", "x":6.5, "y":2.25}, {"label":"37", "x":7.5, "y":2.25}, {"label":"38", "x":8.5, "y":2.25}, {"label":"39", "x":9.5, "y":2.25}, {"label":"40", "x":10.5, "y":2.25}, {"label":"41", "x":11.5, "y":2.25}, {"label":"42", "x":12.5, "y":2.25}, {"label":"43", "x":13.5, "y":2.25, "w":1.5}, {"label":"44", "x":15.25, "y":2.25}, {"label":"45", "x":0, "y":3.25, "w":1.75}, {"label":"46", "x":1.75, "y":3.25}, {"label":"47", "x":2.75, "y":3.25}, {"label":"48", "x":3.75, "y":3.25}, {"label":"49", "x":4.75, "y":3.25}, {"label":"50", "x":5.75, "y":3.25}, {"label":"51", "x":6.75, "y":3.25}, {"label":"52", "x":7.75, "y":3.25}, {"label":"53", "x":8.75, "y":3.25}, {"label":"54", "x":9.75, "y":3.25}, {"label":"55", "x":10.75, "y":3.25}, {"label":"56", "x":11.75, "y":3.25}, {"label":"57", "x":12.75, "y":3.25, "w":2.25}, {"label":"58", "x":15.25, "y":3.25}, {"label":"59", "x":0, "y":4.25, "w":2.25}, {"label":"60", "x":2.25, "y":4.25}, {"label":"61", "x":3.25, "y":4.25}, {"label":"62", "x":4.25, "y":4.25}, {"label":"63", "x":5.25, "y":4.25}, {"label":"64", "x":6.25, "y":4.25}, {"label":"65", "x":7.25, "y":4.25}, {"label":"66", "x":8.25, "y":4.25}, {"label":"67", "x":9.25, "y":4.25}, {"label":"68", "x":10.25, "y":4.25}, {"label":"69", "x":11.25, "y":4.25}, {"label":"70", "x":12.25, "y":4.25, "w":1.75}, {"label":"71", "x":14.25, "y":4.5}, {"label":"72", "x":0, "y":5.25, "w":1.5}, {"label":"73", "x":1.5, "y":5.25}, {"label":"74", "x":2.5, "y":5.25, "w":1.5}, {"label":"75", "x":4, "y":5.25, "w":6}, {"label":"76", "x":10, "y":5.25, "w":1.5}, {"label":"77", "x":11.5, "y":5.25, "w":1.5}, {"label":"78", "x":13.25, "y":5.5}, {"label":"79", "x":14.25, "y":5.5}, {"label":"80", "x":15.25, "y":5.5}] + } + } +} \ No newline at end of file diff --git a/keyboards/wilba_tech/wt75_c/keymaps/default/keymap.c b/keyboards/wilba_tech/wt75_c/keymaps/default/keymap.c new file mode 100644 index 0000000000..0eedd4cb10 --- /dev/null +++ b/keyboards/wilba_tech/wt75_c/keymaps/default/keymap.c @@ -0,0 +1,41 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // Default layer + [0] = LAYOUT_all( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + // Fn1 Layer + [1] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn2 Layer + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn3 Layer + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + diff --git a/keyboards/wilba_tech/wt75_c/keymaps/via/keymap.c b/keyboards/wilba_tech/wt75_c/keymaps/via/keymap.c new file mode 100644 index 0000000000..0eedd4cb10 --- /dev/null +++ b/keyboards/wilba_tech/wt75_c/keymaps/via/keymap.c @@ -0,0 +1,41 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // Default layer + [0] = LAYOUT_all( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + // Fn1 Layer + [1] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn2 Layer + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn3 Layer + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + diff --git a/keyboards/wilba_tech/wt75_c/keymaps/via/rules.mk b/keyboards/wilba_tech/wt75_c/keymaps/via/rules.mk new file mode 100644 index 0000000000..8834bf0c8e --- /dev/null +++ b/keyboards/wilba_tech/wt75_c/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt75_c/readme.md b/keyboards/wilba_tech/wt75_c/readme.md new file mode 100644 index 0000000000..7bcef19003 --- /dev/null +++ b/keyboards/wilba_tech/wt75_c/readme.md @@ -0,0 +1,13 @@ +# wilba.tech WT75-C + +WT75-C is a keyboard PCB supporting 75% layout with offset arrow keys. [More info at wilba.tech](https://wilba.tech/) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: wilba.tech WT75-C +Hardware Availability: Custom keyboard group buys + +Make example for this keyboard (after setting up your build environment): + + make wilba_tech/wt75_c:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file diff --git a/keyboards/wilba_tech/wt75_c/rules.mk b/keyboards/wilba_tech/wt75_c/rules.mk new file mode 100644 index 0000000000..9b5bd1e7f9 --- /dev/null +++ b/keyboards/wilba_tech/wt75_c/rules.mk @@ -0,0 +1,39 @@ +# project specific files +SRC = drivers/issi/is31fl3736.c \ + drivers/avr/i2c_master.c \ + quantum/color.c \ + keyboards/wilba_tech/wt_mono_backlight.c \ + keyboards/wilba_tech/wt_main.c + +# MCU name +MCU = atmega32u4 + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches diff --git a/keyboards/wilba_tech/wt75_c/wt75_c.c b/keyboards/wilba_tech/wt75_c/wt75_c.c new file mode 100644 index 0000000000..ccff6d62c9 --- /dev/null +++ b/keyboards/wilba_tech/wt75_c/wt75_c.c @@ -0,0 +1,17 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Nothing to see here, move along... ;-) diff --git a/keyboards/wilba_tech/wt75_c/wt75_c.h b/keyboards/wilba_tech/wt75_c/wt75_c.h new file mode 100644 index 0000000000..4c74bb117c --- /dev/null +++ b/keyboards/wilba_tech/wt75_c/wt75_c.h @@ -0,0 +1,46 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "quantum.h" + +#define ____ KC_NO + +// Right switch of split backspace is at 2,13 and is the only switch +// whose physical position doesn't match switch matrix position :-( +// However, it also makes no sense to view the physical as 16 columns, +// so the numbering goes 00 to 14. Deal with it. +// +// 0,15 exists on PCB but is blocked by the 7V blocker so until someone +// designs a case that uses it, we can just forget it exists. + +#define LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K315, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, \ + K500, K501, K502, K506, K510, K511, K512, K513, K515 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, ____, K014, ____ }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, ____, ____, K315 }, \ + { K400, ____, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, ____, ____ }, \ + { K500, K501, K502, ____, ____, ____, K506, ____, ____, ____, K510, K511, K512, K513, ____, K515 } \ +} + diff --git a/keyboards/wilba_tech/wt80_a/config.h b/keyboards/wilba_tech/wt80_a/config.h index 3ba90230b5..15dac9047f 100644 --- a/keyboards/wilba_tech/wt80_a/config.h +++ b/keyboards/wilba_tech/wt80_a/config.h @@ -179,14 +179,30 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 -#define WT_MONO_BACKLIGHT +// enable the mono backlight +#define MONO_BACKLIGHT_ENABLED 1 + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define MONO_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 + +// disable backlight after timeout in minutes, 0 = no timeout +#define MONO_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default brightness +#define MONO_BACKLIGHT_BRIGHTNESS 255 + +// the default effect +#define MONO_BACKLIGHT_EFFECT 1 + +// the default effect speed (0-3) +#define MONO_BACKLIGHT_EFFECT_SPEED 0 #define DYNAMIC_KEYMAP_LAYER_COUNT 4 // EEPROM usage // TODO: refactor with new user EEPROM code (coming soon) -#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC 0x4520 #define EEPROM_MAGIC_ADDR 34 // Bump this every time we change what we store // This will automatically reset the EEPROM with defaults @@ -194,9 +210,11 @@ #define EEPROM_VERSION 0x08 #define EEPROM_VERSION_ADDR 36 -// Dynamic keymap starts after EEPROM version -#define DYNAMIC_KEYMAP_EEPROM_ADDR 37 -// Dynamic macro starts after dynamic keymaps (37+(4*6*17*2)) = (37+816) -#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 853 -#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 171 +// Backlight config starts after EEPROM version +#define MONO_BACKLIGHT_CONFIG_EEPROM_ADDR 37 +// Dynamic keymap starts after backlight config (37+7) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 44 +// Dynamic macro starts after dynamic keymaps (44+(4*6*17*2)) = (44+816) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 860 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 164 #define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/wt80_a/keymaps/via/rules.mk b/keyboards/wilba_tech/wt80_a/keymaps/via/rules.mk index 76a07d7a44..8834bf0c8e 100644 --- a/keyboards/wilba_tech/wt80_a/keymaps/via/rules.mk +++ b/keyboards/wilba_tech/wt80_a/keymaps/via/rules.mk @@ -1,71 +1,2 @@ -# project specific files -SRC = drivers/issi/is31fl3736.c \ - drivers/avr/i2c_master.c \ - keyboards/wilba_tech/wt_mono_backlight.c \ - keyboards/wilba_tech/wt_main.c - -# MCU name -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 - - -# Boot Section -BOOTLOADER = atmel-dfu - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches - RAW_ENABLE = yes DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt80_a/rules.mk b/keyboards/wilba_tech/wt80_a/rules.mk index e41f2186b3..9b5bd1e7f9 100644 --- a/keyboards/wilba_tech/wt80_a/rules.mk +++ b/keyboards/wilba_tech/wt80_a/rules.mk @@ -1,50 +1,21 @@ # project specific files SRC = drivers/issi/is31fl3736.c \ drivers/avr/i2c_master.c \ + quantum/color.c \ keyboards/wilba_tech/wt_mono_backlight.c \ keyboards/wilba_tech/wt_main.c # MCU name 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 - - -# Boot Section +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp BOOTLOADER = atmel-dfu diff --git a/keyboards/wilba_tech/wt8_a/rules.mk b/keyboards/wilba_tech/wt8_a/rules.mk index f1c632289c..5e87a29959 100644 --- a/keyboards/wilba_tech/wt8_a/rules.mk +++ b/keyboards/wilba_tech/wt8_a/rules.mk @@ -1,50 +1,19 @@ # project specific files SRC = keyboards/wilba_tech/wt_main.c - + # MCU name 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 - - -# Boot Section +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp BOOTLOADER = atmel-dfu - # Build Options # change yes to no to disable # diff --git a/keyboards/wilba_tech/wt_main.c b/keyboards/wilba_tech/wt_main.c index e6ea4a21bd..32fc6f9e44 100644 --- a/keyboards/wilba_tech/wt_main.c +++ b/keyboards/wilba_tech/wt_main.c @@ -20,9 +20,9 @@ #if RGB_BACKLIGHT_ENABLED #include "keyboards/wilba_tech/wt_rgb_backlight.h" #endif // RGB_BACKLIGHT_ENABLED -#ifdef WT_MONO_BACKLIGHT +#if MONO_BACKLIGHT_ENABLED #include "keyboards/wilba_tech/wt_mono_backlight.h" -#endif // WT_MONO_BACKLIGHT +#endif // MONO_BACKLIGHT_ENABLED #include "keyboards/wilba_tech/via_api.h" // Temporary hack #include "keyboards/wilba_tech/via_keycodes.h" // Temporary hack @@ -150,7 +150,7 @@ void raw_hid_receive( uint8_t *data, uint8_t length ) break; } #endif // DYNAMIC_KEYMAP_ENABLE -#if RGB_BACKLIGHT_ENABLED +#if RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED case id_backlight_config_set_value: { backlight_config_set_value(command_data); @@ -166,7 +166,7 @@ void raw_hid_receive( uint8_t *data, uint8_t length ) backlight_config_save(); break; } -#endif // RGB_BACKLIGHT_ENABLED +#endif // RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED case id_eeprom_reset: { eeprom_reset(); @@ -202,16 +202,16 @@ void main_init(void) // If the EEPROM has the magic, the data is good. // OK to load from EEPROM. if (eeprom_is_valid()) { -#if RGB_BACKLIGHT_ENABLED +#if RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED backlight_config_load(); -#endif // RGB_BACKLIGHT_ENABLED +#endif // RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED } else { -#if RGB_BACKLIGHT_ENABLED +#if RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED // If the EEPROM has not been saved before, or is out of date, // save the default values to the EEPROM. Default values - // come from construction of the zeal_backlight_config instance. + // come from construction of the backlight_config instance. backlight_config_save(); -#endif // RGB_BACKLIGHT_ENABLED +#endif // RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED #ifdef DYNAMIC_KEYMAP_ENABLE // This resets the keymaps in EEPROM to what is in flash. dynamic_keymap_reset(); @@ -222,20 +222,13 @@ void main_init(void) eeprom_set_valid(true); } -#if RGB_BACKLIGHT_ENABLED +#if RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED // Initialize LED drivers for backlight. backlight_init_drivers(); backlight_timer_init(); backlight_timer_enable(); -#endif // RGB_BACKLIGHT_ENABLED -#ifdef WT_MONO_BACKLIGHT - // Initialize LED drivers for backlight. - backlight_init_drivers(); - - backlight_timer_init(); - backlight_timer_enable(); -#endif // WT_MONO_BACKLIGHT +#endif // RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED } void bootmagic_lite(void) @@ -267,22 +260,18 @@ void matrix_init_kb(void) void matrix_scan_kb(void) { -#if RGB_BACKLIGHT_ENABLED +#if RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED // This only updates the LED driver buffers if something has changed. backlight_update_pwm_buffers(); -#endif // RGB_BACKLIGHT_ENABLED -#ifdef WT_MONO_BACKLIGHT - // This only updates the LED driver buffers if something has changed. - backlight_update_pwm_buffers(); -#endif +#endif // RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED matrix_scan_user(); } bool process_record_kb(uint16_t keycode, keyrecord_t *record) { -#if RGB_BACKLIGHT_ENABLED +#if RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED process_record_backlight(keycode, record); -#endif // RGB_BACKLIGHT_ENABLED +#endif // RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED switch(keycode) { case FN_MO13: @@ -372,22 +361,23 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) void led_set_kb(uint8_t usb_led) { -#if RGB_BACKLIGHT_ENABLED +#if RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED backlight_set_indicator_state(usb_led); -#endif // RGB_BACKLIGHT_ENABLED +#endif // RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED + led_set_user(usb_led); } void suspend_power_down_kb(void) { -#if RGB_BACKLIGHT_ENABLED +#if RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED backlight_set_suspend_state(true); -#endif // RGB_BACKLIGHT_ENABLED +#endif // RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED } void suspend_wakeup_init_kb(void) { -#if RGB_BACKLIGHT_ENABLED +#if RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED backlight_set_suspend_state(false); -#endif // RGB_BACKLIGHT_ENABLED +#endif // RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED } diff --git a/keyboards/wilba_tech/wt_mono_backlight.c b/keyboards/wilba_tech/wt_mono_backlight.c index bf485bce1f..69d82e582a 100644 --- a/keyboards/wilba_tech/wt_mono_backlight.c +++ b/keyboards/wilba_tech/wt_mono_backlight.c @@ -14,20 +14,43 @@ * along with this program. If not, see . */ +#include "quantum.h" #include "wt_mono_backlight.h" +#include "wt_rgb_backlight_api.h" // reuse these for now +#include "wt_rgb_backlight_keycodes.h" // reuse these for now + #include "drivers/avr/i2c_master.h" #include "drivers/issi/is31fl3736.h" - #include +#include "progmem.h" +#include "quantum/color.h" + #define ISSI_ADDR_DEFAULT 0x50 +#define BACKLIGHT_EFFECT_MAX 3 + +#ifndef MONO_BACKLIGHT_COLOR_1 +#define MONO_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } +#endif + +backlight_config g_config = { + .disable_when_usb_suspended = MONO_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED, + .disable_after_timeout = MONO_BACKLIGHT_DISABLE_AFTER_TIMEOUT, + .brightness = MONO_BACKLIGHT_BRIGHTNESS, + .effect = MONO_BACKLIGHT_EFFECT, + .effect_speed = MONO_BACKLIGHT_EFFECT_SPEED, + .color_1 = MONO_BACKLIGHT_COLOR_1, +}; + bool g_suspend_state = false; +uint8_t g_indicator_state = 0; // Global tick at 20 Hz uint32_t g_tick = 0; -uint8_t g_config_effect_speed = 0; -uint8_t g_config_brightness = 255; + +// Ticks since any key was last hit. +uint32_t g_any_key_hit = 0; void backlight_init_drivers(void) { @@ -41,6 +64,10 @@ void backlight_init_drivers(void) IS31FL3736_update_led_control_registers( ISSI_ADDR_DEFAULT, 0x00 ); } +void backlight_set_key_hit(uint8_t row, uint8_t column) +{ + g_any_key_hit = 0; +} // This is (F_CPU/1024) / 20 Hz // = 15625 Hz / 20 Hz @@ -82,13 +109,63 @@ void backlight_set_suspend_state(bool state) g_suspend_state = state; } +void backlight_set_indicator_state(uint8_t state) +{ + g_indicator_state = state; +} + +void backlight_set_brightness_all( uint8_t value ) +{ + IS31FL3736_mono_set_brightness_all( value ); +} + +void backlight_effect_all_off(void) +{ + IS31FL3736_mono_set_brightness_all( 0 ); +} + +void backlight_effect_all_on(void) +{ + IS31FL3736_mono_set_brightness_all( g_config.brightness ); +} + +void backlight_effect_raindrops(bool initialize) +{ + // Change one LED every tick + uint8_t led_to_change = ( g_tick & 0x000 ) == 0 ? rand() % 96 : 255; + + for ( int i=0; i<96; i++ ) + { + // If initialize, all get set to random brightness + // If not, all but one will stay the same as before. + if ( initialize || i == led_to_change ) + { + IS31FL3736_mono_set_brightness(i, rand() & 0xFF ); + } + } +} + void backlight_effect_cycle_all(void) { - uint8_t offset = ( g_tick << g_config_effect_speed ) & 0xFF; + uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; backlight_set_brightness_all( offset ); } +// This runs after another backlight effect and replaces +// colors already set +void backlight_effect_indicators(void) +{ +#if defined(MONO_BACKLIGHT_WT75_A) + HSV hsv = { .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness }; + RGB rgb = hsv_to_rgb( hsv ); + // G8, H8, I8 -> (6*8+7) (7*8+7), (8*8+7) + IS31FL3736_mono_set_brightness(55, rgb.r); + IS31FL3736_mono_set_brightness(63, rgb.g); + IS31FL3736_mono_set_brightness(71, rgb.b); +#endif // MONO_BACKLIGHT_WT75_A +} + ISR(TIMER3_COMPA_vect) { // delay 1 second before driving LEDs or doing anything else @@ -100,8 +177,154 @@ ISR(TIMER3_COMPA_vect) g_tick++; - //backlight_effect_cycle_all(); - backlight_set_brightness_all( 255 ); + if ( g_any_key_hit < 0xFFFFFFFF ) + { + g_any_key_hit++; + } + + // Ideally we would also stop sending zeros to the LED driver PWM buffers + // while suspended and just do a software shutdown. This is a cheap hack for now. + bool suspend_backlight = ((g_suspend_state && g_config.disable_when_usb_suspended) || + (g_config.disable_after_timeout > 0 && g_any_key_hit > g_config.disable_after_timeout * 60 * 20)); + uint8_t effect = suspend_backlight ? 0 : g_config.effect; + + // Keep track of the effect used last time, + // detect change in effect, so each effect can + // have an optional initialization. + static uint8_t effect_last = 255; + bool initialize = effect != effect_last; + effect_last = effect; + + // this gets ticked at 20 Hz. + // each effect can opt to do calculations + // and/or request PWM buffer updates. + switch ( effect ) + { + case 0: + backlight_effect_all_off(); + break; + case 1: + backlight_effect_all_on();; + break; + case 2: + backlight_effect_raindrops(initialize); + break; + default: + backlight_effect_all_off(); + break; + } + + if ( ! suspend_backlight ) + { + backlight_effect_indicators(); + } +} + +// Some helpers for setting/getting HSV +void _set_color( HS *color, uint8_t *data ) +{ + color->h = data[0]; + color->s = data[1]; +} + +void _get_color( HS *color, uint8_t *data ) +{ + data[0] = color->h; + data[1] = color->s; +} + +void backlight_config_set_value( uint8_t *data ) +{ + bool reinitialize = false; + uint8_t *value_id = &(data[0]); + uint8_t *value_data = &(data[1]); + switch ( *value_id ) + { + case id_disable_when_usb_suspended: + { + g_config.disable_when_usb_suspended = (bool)*value_data; + break; + } + case id_disable_after_timeout: + { + g_config.disable_after_timeout = *value_data; + break; + } + case id_brightness: + { + g_config.brightness = *value_data; + break; + } + case id_effect: + { + g_config.effect = *value_data; + break; + } + case id_effect_speed: + { + g_config.effect_speed = *value_data; + break; + } + case id_color_1: + { + _set_color( &(g_config.color_1), value_data ); + break; + } + } + + if ( reinitialize ) + { + backlight_init_drivers(); + } +} + +void backlight_config_get_value( uint8_t *data ) +{ + uint8_t *value_id = &(data[0]); + uint8_t *value_data = &(data[1]); + switch ( *value_id ) + { + case id_disable_when_usb_suspended: + { + *value_data = ( g_config.disable_when_usb_suspended ? 1 : 0 ); + break; + } + case id_disable_after_timeout: + { + *value_data = g_config.disable_after_timeout; + break; + } + case id_brightness: + { + *value_data = g_config.brightness; + break; + } + case id_effect: + { + *value_data = g_config.effect; + break; + } + case id_effect_speed: + { + *value_data = g_config.effect_speed; + break; + } + case id_color_1: + { + _get_color( &(g_config.color_1), value_data ); + break; + } + } +} + +void backlight_config_load(void) +{ + eeprom_read_block( &g_config, ((void*)MONO_BACKLIGHT_CONFIG_EEPROM_ADDR), sizeof(backlight_config) ); +} + +void backlight_config_save(void) +{ + eeprom_update_block( &g_config, ((void*)MONO_BACKLIGHT_CONFIG_EEPROM_ADDR), sizeof(backlight_config) ); } void backlight_update_pwm_buffers(void) @@ -109,8 +332,110 @@ void backlight_update_pwm_buffers(void) IS31FL3736_update_pwm_buffers(ISSI_ADDR_DEFAULT,0x00); } -void backlight_set_brightness_all( uint8_t value ) +bool process_record_backlight(uint16_t keycode, keyrecord_t *record) { - IS31FL3736_mono_set_brightness_all( value ); + // Record keypresses for backlight effects + if ( record->event.pressed ) + { + backlight_set_key_hit( record->event.key.row, record->event.key.col ); + } + + switch(keycode) + { + case BR_INC: + if (record->event.pressed) + { + backlight_brightness_increase(); + } + return false; + break; + case BR_DEC: + if (record->event.pressed) + { + backlight_brightness_decrease(); + } + return false; + break; + case EF_INC: + if (record->event.pressed) + { + backlight_effect_increase(); + } + return false; + break; + case EF_DEC: + if (record->event.pressed) + { + backlight_effect_decrease(); + } + return false; + break; + case ES_INC: + if (record->event.pressed) + { + backlight_effect_speed_increase(); + } + return false; + break; + case ES_DEC: + if (record->event.pressed) + { + backlight_effect_speed_decrease(); + } + return false; + break; + } + + return true; } +// Deals with the messy details of incrementing an integer +uint8_t increment( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) +{ + int16_t new_value = value; + new_value += step; + return MIN( MAX( new_value, min ), max ); +} + +uint8_t decrement( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) +{ + int16_t new_value = value; + new_value -= step; + return MIN( MAX( new_value, min ), max ); +} + +void backlight_effect_increase(void) +{ + g_config.effect = increment( g_config.effect, 1, 0, BACKLIGHT_EFFECT_MAX ); + backlight_config_save(); +} + +void backlight_effect_decrease(void) +{ + g_config.effect = decrement( g_config.effect, 1, 0, BACKLIGHT_EFFECT_MAX ); + backlight_config_save(); +} + +void backlight_effect_speed_increase(void) +{ + g_config.effect_speed = increment( g_config.effect_speed, 1, 0, 3 ); + backlight_config_save(); +} + +void backlight_effect_speed_decrease(void) +{ + g_config.effect_speed = decrement( g_config.effect_speed, 1, 0, 3 ); + backlight_config_save(); +} + +void backlight_brightness_increase(void) +{ + g_config.brightness = increment( g_config.brightness, 8, 0, 255 ); + backlight_config_save(); +} + +void backlight_brightness_decrease(void) +{ + g_config.brightness = decrement( g_config.brightness, 8, 0, 255 ); + backlight_config_save(); +} diff --git a/keyboards/wilba_tech/wt_mono_backlight.h b/keyboards/wilba_tech/wt_mono_backlight.h index 70031bedc7..2f913d2cb6 100644 --- a/keyboards/wilba_tech/wt_mono_backlight.h +++ b/keyboards/wilba_tech/wt_mono_backlight.h @@ -19,6 +19,36 @@ #include #include +#include "quantum/color.h" + +typedef struct PACKED +{ + uint8_t h; + uint8_t s; +} HS; + +typedef struct +{ + bool disable_when_usb_suspended:1; // | + bool __pad1:1; // | + bool __pad2:1; // | + bool __pad3:1; // | + bool __pad4:1; // | + bool __pad5:1; // | + bool __pad6:1; // | + bool __pad7:1; // 1 byte + uint8_t disable_after_timeout; // 1 byte + uint8_t brightness; // 1 byte + uint8_t effect; // 1 byte + uint8_t effect_speed; // 1 byte + HS color_1; // 2 bytes (Indicator Color for Xeno) +} backlight_config; // = 7 bytes + +void backlight_config_load(void); +void backlight_config_save(void); +void backlight_config_set_value( uint8_t *data ); +void backlight_config_get_value( uint8_t *data ); + void backlight_init_drivers(void); void backlight_timer_init(void); @@ -26,8 +56,24 @@ void backlight_timer_enable(void); void backlight_timer_disable(void); void backlight_set_suspend_state(bool state); +void backlight_set_indicator_state(uint8_t state); +// This should not be called from an interrupt +// (eg. from a timer interrupt). +// Call this while idle (in between matrix scans). +// If the buffer is dirty, it will update the driver with the buffer. void backlight_update_pwm_buffers(void); -void backlight_set_brightness_all( uint8_t value ); +// Handle backlight specific keycodes +bool process_record_backlight(uint16_t keycode, keyrecord_t *record); + +void backlight_set_key_hit(uint8_t row, uint8_t col); + +void backlight_effect_increase(void); +void backlight_effect_decrease(void); +void backlight_effect_speed_increase(void); +void backlight_effect_speed_decrease(void); + +void backlight_brightness_increase(void); +void backlight_brightness_decrease(void); diff --git a/keyboards/wilba_tech/zeal60/rules.mk b/keyboards/wilba_tech/zeal60/rules.mk index 5d20659f83..b8d63050c6 100644 --- a/keyboards/wilba_tech/zeal60/rules.mk +++ b/keyboards/wilba_tech/zeal60/rules.mk @@ -1,5 +1,3 @@ - - # project specific files SRC = keyboards/wilba_tech/wt_main.c \ keyboards/wilba_tech/wt_rgb_backlight.c \ @@ -10,42 +8,14 @@ SRC = keyboards/wilba_tech/wt_main.c \ # MCU name 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 - -# Boot Section +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp BOOTLOADER = atmel-dfu # Do not put the microcontroller into power saving mode diff --git a/keyboards/wilba_tech/zeal65/rules.mk b/keyboards/wilba_tech/zeal65/rules.mk index a1cd32aad5..f0df996561 100644 --- a/keyboards/wilba_tech/zeal65/rules.mk +++ b/keyboards/wilba_tech/zeal65/rules.mk @@ -1,5 +1,3 @@ - - # project specific files SRC = keyboards/wilba_tech/wt_main.c \ keyboards/wilba_tech/wt_rgb_backlight.c \ @@ -10,42 +8,14 @@ SRC = keyboards/wilba_tech/wt_main.c \ # MCU name 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 - -# Boot Section +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp BOOTLOADER = atmel-dfu # Do not put the microcontroller into power saving mode