#---------------------------------------------------------------------------- | #---------------------------------------------------------------------------- | ||||
# Target file name (without extension). | # Target file name (without extension). | ||||
TARGET = lr92_lufa | |||||
TARGET = lr94_lufa | |||||
# Directory common source filess exist | # Directory common source filess exist | ||||
TOP_DIR = ../.. | TOP_DIR = ../.. | ||||
# USBaspLoader 2048 | # USBaspLoader 2048 | ||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096 | OPT_DEFS += -DBOOTLOADER_SIZE=4096 | ||||
# PCB Revision | |||||
ifdef REV | |||||
OPT_DEFS += -DGH60_REV_$(REV) | |||||
endif | |||||
# Additional definitions from command line | # Additional definitions from command line | ||||
ifdef DEFS | ifdef DEFS | ||||
OPT_DEFS += $(foreach DEF,$(DEFS),-D$(DEF)) | OPT_DEFS += $(foreach DEF,$(DEFS),-D$(DEF)) | ||||
CONSOLE_ENABLE = yes # Console for debug(+400) | CONSOLE_ENABLE = yes # Console for debug(+400) | ||||
COMMAND_ENABLE = yes # Commands for debug and configuration | COMMAND_ENABLE = yes # Commands for debug and configuration | ||||
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | ||||
NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA | |||||
NKRO_ENABLE = yes # USB Nkey Rollover | |||||
USB_6KRO_ENABLE = yes # USB 6key Rollover | |||||
#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support | #PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support | ||||
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality | BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality | ||||
KEYMAP_EX_ENABLE = yes # External keymap in eeprom | |||||
KEYMAP_IN_EEPROM_ENABLE = yes # Read keymap from eeprom | |||||
KEYMAP_SECTION_ENABLE = yes # Fixed address keymap for keymap editor | KEYMAP_SECTION_ENABLE = yes # Fixed address keymap for keymap editor | ||||
BREATHING_LED_ENABLE = yes # Enable breathing backlight | BREATHING_LED_ENABLE = yes # Enable breathing backlight | ||||
#---------------------------------------------------------------------------- | #---------------------------------------------------------------------------- | ||||
# Target file name (without extension). | # Target file name (without extension). | ||||
TARGET = lr92_pjrc | |||||
TARGET = lr94_pjrc | |||||
# Directory common source filess exist | # Directory common source filess exist | ||||
TOP_DIR = ../.. | TOP_DIR = ../.. | ||||
# LUFA bootloader 4096 | # LUFA bootloader 4096 | ||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096 | OPT_DEFS += -DBOOTLOADER_SIZE=4096 | ||||
# PCB Revision | |||||
ifdef REV | |||||
OPT_DEFS += -DGH60_REV_$(REV) | |||||
endif | |||||
# Additional definitions from command line | # Additional definitions from command line | ||||
ifdef DEFS | ifdef DEFS | ||||
OPT_DEFS += $(foreach DEF,$(DEFS),-D$(DEF)) | OPT_DEFS += $(foreach DEF,$(DEFS),-D$(DEF)) | ||||
CONSOLE_ENABLE = yes # Console for debug(+400) | CONSOLE_ENABLE = yes # Console for debug(+400) | ||||
COMMAND_ENABLE = yes # Commands for debug and configuration | COMMAND_ENABLE = yes # Commands for debug and configuration | ||||
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | ||||
NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA | |||||
NKRO_ENABLE = yes # USB Nkey Rollover | |||||
USB_6KRO_ENABLE = yes # USB 6key Rollover | |||||
#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support | #PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support | ||||
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality | BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality | ||||
KEYMAP_EX_ENABLE = yes # External keymap in eeprom | |||||
KEYMAP_IN_EEPROM_ENABLE = yes # Read keymap from eeprom | |||||
KEYMAP_SECTION_ENABLE = yes # Fixed address keymap for keymap editor | KEYMAP_SECTION_ENABLE = yes # Fixed address keymap for keymap editor | ||||
BREATHING_LED_ENABLE = yes # Enable breathing backlight | |||||
# Search Path | # Search Path |
/* translates key to keycode */ | /* translates key to keycode */ | ||||
uint8_t keymap_key_to_keycode(uint8_t layer, key_t key) | uint8_t keymap_key_to_keycode(uint8_t layer, key_t key) | ||||
{ | { | ||||
#ifndef KEYMAP_EX_ENABLE | |||||
#ifndef KEYMAP_IN_EEPROM_ENABLE | |||||
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); | return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); | ||||
#else | #else | ||||
return eeconfig_read_keymap_key(layer, key.row, key.col); | return eeconfig_read_keymap_key(layer, key.row, key.col); | ||||
action_t keymap_fn_to_action(uint8_t keycode) | action_t keymap_fn_to_action(uint8_t keycode) | ||||
{ | { | ||||
return (action_t) { | return (action_t) { | ||||
#ifndef KEYMAP_EX_ENABLE | |||||
#ifndef KEYMAP_IN_EEPROM_ENABLE | |||||
.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) | .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) | ||||
#else | #else | ||||
.code = eeconfig_read_keymap_fn_action(FN_INDEX(keycode)) | .code = eeconfig_read_keymap_fn_action(FN_INDEX(keycode)) | ||||
}; | }; | ||||
} | } | ||||
#ifdef KEYMAP_EX_ENABLE | |||||
#ifdef KEYMAP_IN_EEPROM_ENABLE | |||||
const uint8_t* keymaps_pointer(void) { | const uint8_t* keymaps_pointer(void) { | ||||
return (const uint8_t*)keymaps; | return (const uint8_t*)keymaps; | ||||
} | } |
#include "print.h" | #include "print.h" | ||||
#include "debug.h" | #include "debug.h" | ||||
#include "keymap.h" | #include "keymap.h" | ||||
#include "keymap_ex.h" | |||||
#include "keymap_in_eeprom.h" | |||||
/* | |||||
#ifdef KEYMAP_EX_ENABLE | |||||
extern const uint8_t keymaps[KEYMAPS_COUNT][MATRIX_ROWS][MATRIX_COLS]; | |||||
extern const uint16_t fn_actions[FN_ACTIONS_COUNT]; | |||||
#else | |||||
*/ | |||||
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; | extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; | ||||
extern const uint16_t fn_actions[]; | extern const uint16_t fn_actions[]; | ||||
//#endif | |||||
/* LR92 keymap definition macro | |||||
/* LR94 keymap definition macro | |||||
* K1J, K3M and K2B are extra keys for ISO | * K1J, K3M and K2B are extra keys for ISO | ||||
*/ | */ | ||||
#define KEYMAP( \ | #define KEYMAP( \ |
[4] = ACTION_BACKLIGHT_INCREASE() | [4] = ACTION_BACKLIGHT_INCREASE() | ||||
}; | }; | ||||
#ifdef KEYMAP_EX_ENABLE | |||||
#ifdef KEYMAP_IN_EEPROM_ENABLE | |||||
uint16_t keys_count(void) { | uint16_t keys_count(void) { | ||||
return sizeof(keymaps) / sizeof(keymaps[0]) * MATRIX_ROWS * MATRIX_COLS; | return sizeof(keymaps) / sizeof(keymaps[0]) * MATRIX_ROWS * MATRIX_COLS; | ||||
} | } |