1
0
Fork 0

Added Dynamic Keymaps to M10-B

This commit is contained in:
Wilba6582 2018-12-13 19:33:04 +11:00 committed by Drashna Jaelre
parent 24b17c9619
commit cc45f62d75
11 changed files with 62 additions and 71 deletions

View file

@ -26,7 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DEVICE_VER 0x0001 #define DEVICE_VER 0x0001
#define MANUFACTURER RAMA.WORKS #define MANUFACTURER RAMA.WORKS
#define PRODUCT RAMA M10-B #define PRODUCT RAMA M10-B
#define DESCRIPTION RAMA M10-B Macropad #define DESCRIPTION RAMA M10-B
/* key matrix size */ /* key matrix size */
#define MATRIX_ROWS 1 #define MATRIX_ROWS 1
@ -186,4 +186,26 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 1 //#define MIDI_TONE_KEYCODE_OCTAVES 1
//#define WT_MONO_BACKLIGHT
#define DYNAMIC_KEYMAP_LAYER_COUNT 4
// EEPROM usage
// TODO: refactor with new user EEPROM code (coming soon)
#define EEPROM_MAGIC 0x451F
#define EEPROM_MAGIC_ADDR 32
// 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 34
// Dynamic keymap starts after EEPROM version
#define DYNAMIC_KEYMAP_EEPROM_ADDR 35
// Dynamic macro starts after dynamic keymaps (35+(4*10*2)) = (35+80)
#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 115
#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 909
#define DYNAMIC_KEYMAP_MACRO_COUNT 16
#endif #endif

View file

@ -6,21 +6,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_0 ) KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_0 )
}; };
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
return MACRO_NONE;
}
void matrix_init_user(void)
{
}
void matrix_scan_user(void)
{
}
bool process_record_user(uint16_t keycode, keyrecord_t *record)
{
return true;
}

View file

@ -19,6 +19,7 @@
#include "../../config.h" #include "../../config.h"
// place overrides here #undef RAW_ENABLE
#undef DYNAMIC_KEYMAP_ENABLE
#endif #endif

View file

@ -1,4 +1,4 @@
/* Copyright 2018 Wilba /* Copyright 2018 Jason Williams (Wilba)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -13,32 +13,5 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "m10_b.h"
/*
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user(); // Nothing to see here, move along... ;-)
}
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware
return process_record_user(keycode, record);
}
void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
led_set_user(usb_led);
}
*/

View file

@ -1,5 +1,7 @@
# project specific files
SRC = keyboards/wilba_tech/wt_main.c
# MCU name # MCU name
#MCU = at90usb1286
MCU = atmega32u4 MCU = atmega32u4
# Processor frequency. # Processor frequency.
@ -39,30 +41,28 @@ F_USB = $(F_CPU)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Boot Section Size in *bytes* # Boot Section
# Teensy halfKay 512 BOOTLOADER = atmel-dfu
# Teensy++ halfKay 1024
# Atmel DFU loader 4096
# LUFA bootloader 4096
# USBaspLoader 2048
OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options # Build Options
# change yes to no to disable # change yes to no to disable
# #
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) MOUSEKEY_ENABLE = no # Mouse keys(+4700)
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE ?= yes # Console for debug(+400) CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE ?= yes # Commands for debug and configuration COMMAND_ENABLE = no # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend 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 # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE ?= no # USB Nkey Rollover NKRO_ENABLE = yes # USB Nkey Rollover
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality on B7 by default BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
MIDI_ENABLE ?= no # MIDI support (+2400 to 4200, depending on config) MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
UNICODE_ENABLE ?= no # Unicode UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE ?= no # Audio output on port C6 AUDIO_ENABLE = no # Audio output on port C6
FAUXCLICKY_ENABLE ?= no # Use buzzer to emulate clicky switches FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
RAW_ENABLE = yes
DYNAMIC_KEYMAP_ENABLE = yes

View file

@ -185,6 +185,8 @@
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 1 //#define MIDI_TONE_KEYCODE_OCTAVES 1
#define WT_MONO_BACKLIGHT
#define DYNAMIC_KEYMAP_LAYER_COUNT 4 #define DYNAMIC_KEYMAP_LAYER_COUNT 4
// EEPROM usage // EEPROM usage

View file

@ -69,4 +69,3 @@ FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
RAW_ENABLE = yes RAW_ENABLE = yes
DYNAMIC_KEYMAP_ENABLE = yes DYNAMIC_KEYMAP_ENABLE = yes
CIE1931_CURVE = yes

View file

@ -185,6 +185,8 @@
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 1 //#define MIDI_TONE_KEYCODE_OCTAVES 1
#define WT_MONO_BACKLIGHT
#define DYNAMIC_KEYMAP_LAYER_COUNT 4 #define DYNAMIC_KEYMAP_LAYER_COUNT 4
// EEPROM usage // EEPROM usage

View file

@ -185,6 +185,8 @@
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 1 //#define MIDI_TONE_KEYCODE_OCTAVES 1
#define WT_MONO_BACKLIGHT
#define DYNAMIC_KEYMAP_LAYER_COUNT 4 #define DYNAMIC_KEYMAP_LAYER_COUNT 4
// EEPROM usage // EEPROM usage

View file

@ -185,6 +185,8 @@
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 1 //#define MIDI_TONE_KEYCODE_OCTAVES 1
#define WT_MONO_BACKLIGHT
#define DYNAMIC_KEYMAP_LAYER_COUNT 4 #define DYNAMIC_KEYMAP_LAYER_COUNT 4
// EEPROM usage // EEPROM usage

View file

@ -15,7 +15,9 @@
*/ */
#include "quantum.h" #include "quantum.h"
#ifdef WT_MONO_BACKLIGHT
#include "keyboards/wilba_tech/wt_mono_backlight.h" #include "keyboards/wilba_tech/wt_mono_backlight.h"
#endif
#include "keyboards/zeal60/zeal60_api.h" // Temporary hack #include "keyboards/zeal60/zeal60_api.h" // Temporary hack
#include "keyboards/zeal60/zeal60_keycodes.h" // Temporary hack #include "keyboards/zeal60/zeal60_keycodes.h" // Temporary hack
@ -194,11 +196,13 @@ void main_init(void)
eeprom_set_valid(true); eeprom_set_valid(true);
} }
#ifdef WT_MONO_BACKLIGHT
// Initialize LED drivers for backlight. // Initialize LED drivers for backlight.
backlight_init_drivers(); backlight_init_drivers();
backlight_timer_init(); backlight_timer_init();
backlight_timer_enable(); backlight_timer_enable();
#endif
} }
void bootmagic_lite(void) void bootmagic_lite(void)
@ -230,8 +234,10 @@ void matrix_init_kb(void)
void matrix_scan_kb(void) void matrix_scan_kb(void)
{ {
#ifdef WT_MONO_BACKLIGHT
// This only updates the LED driver buffers if something has changed. // This only updates the LED driver buffers if something has changed.
backlight_update_pwm_buffers(); backlight_update_pwm_buffers();
#endif
matrix_scan_user(); matrix_scan_user();
} }