TARGET = kimera_lufa | TARGET = kimera_lufa | ||||
# Directory common source filess exist | # Directory common source filess exist | ||||
TOP_DIR = ../.. | |||||
TMK_DIR = ../../tmk_core_custom | |||||
# Directory keyboard dependent files exist | # Directory keyboard dependent files exist | ||||
TARGET_DIR = . | TARGET_DIR = . | ||||
# Search Path | # Search Path | ||||
VPATH += $(TARGET_DIR) | VPATH += $(TARGET_DIR) | ||||
VPATH += $(TOP_DIR) | |||||
VPATH += $(TMK_DIR) | |||||
include $(TOP_DIR)/protocol/lufa.mk | |||||
include $(TOP_DIR)/protocol.mk | |||||
include $(TOP_DIR)/common.mk | |||||
include $(TOP_DIR)/rules.mk | |||||
include $(TMK_DIR)/protocol/lufa.mk | |||||
include $(TMK_DIR)/common.mk | |||||
include $(TMK_DIR)/rules.mk |
softpwm_led_enable(); | softpwm_led_enable(); | ||||
fading_led_enable_all(); | fading_led_enable_all(); | ||||
breathing_led_disable_all(); | breathing_led_disable_all(); | ||||
fading_led_set_direction(FADING_LED_FADE_IN); | |||||
fading_led_set_direction_all(FADING_LED_FADE_IN); | |||||
fading_led_set_duration(3); | fading_led_set_duration(3); | ||||
break; | break; | ||||
case 8: | case 8: | ||||
softpwm_led_enable(); | softpwm_led_enable(); | ||||
fading_led_enable_all(); | fading_led_enable_all(); | ||||
breathing_led_disable_all(); | breathing_led_disable_all(); | ||||
fading_led_set_direction(FADING_LED_FADE_OUT); | |||||
fading_led_set_direction_all(FADING_LED_FADE_OUT); | |||||
fading_led_set_duration(3); | fading_led_set_duration(3); | ||||
break; | break; | ||||
#endif | #endif |
#define FN_ACTIONS_COUNT 32 | #define FN_ACTIONS_COUNT 32 | ||||
#define KEYMAPS_COUNT 3 | #define KEYMAPS_COUNT 3 | ||||
#ifndef TWO_HEADED_KIMERA | #ifndef TWO_HEADED_KIMERA | ||||
#define EECONFIG_KEYMAP_IN_EEPROM 45 | |||||
#define EECONFIG_KEYMAP_IN_EEPROM 49 | |||||
#else | #else | ||||
#define EECONFIG_KEYMAP_IN_EEPROM 77 | |||||
#define EECONFIG_KEYMAP_IN_EEPROM 81 | |||||
#endif | #endif | ||||
/* define if matrix has ghost */ | /* define if matrix has ghost */ | ||||
//#define NO_ACTION_LAYER | //#define NO_ACTION_LAYER | ||||
//#define NO_ACTION_TAPPING | //#define NO_ACTION_TAPPING | ||||
//#define NO_ACTION_ONESHOT | //#define NO_ACTION_ONESHOT | ||||
//#define NO_ACTION_MACRO | |||||
#define NO_ACTION_MACRO | |||||
//#define NO_ACTION_FUNCTION | //#define NO_ACTION_FUNCTION | ||||
#define NO_SUSPEND_POWER_DOWN | #define NO_SUSPEND_POWER_DOWN |
#include "matrix.h" | #include "matrix.h" | ||||
/* 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, keypos_t key) | |||||
{ | { | ||||
#ifndef KEYMAP_IN_EEPROM_ENABLE | #ifndef KEYMAP_IN_EEPROM_ENABLE | ||||
return pgm_read_byte(&keymaps[(layer)][(key.row) * matrix_cols() + (key.col)]); | return pgm_read_byte(&keymaps[(layer)][(key.row) * matrix_cols() + (key.col)]); |
#include <avr/wdt.h> | #include <avr/wdt.h> | ||||
#include <util/delay.h> | #include <util/delay.h> | ||||
#include "action.h" | #include "action.h" | ||||
#include "suspend.h" | |||||
#include "i2cmaster.h" | #include "i2cmaster.h" | ||||
#include "kimera.h" | #include "kimera.h" | ||||
#include "debug.h" | #include "debug.h" | ||||
#define wdt_intr_enable(value) \ | |||||
__asm__ __volatile__ ( \ | |||||
"in __tmp_reg__,__SREG__" "\n\t" \ | |||||
"cli" "\n\t" \ | |||||
"wdr" "\n\t" \ | |||||
"sts %0,%1" "\n\t" \ | |||||
"out __SREG__,__tmp_reg__" "\n\t" \ | |||||
"sts %0,%2" "\n\t" \ | |||||
: /* no outputs */ \ | |||||
: "M" (_SFR_MEM_ADDR(_WD_CONTROL_REG)), \ | |||||
"r" (_BV(_WD_CHANGE_BIT) | _BV(WDE)), \ | |||||
"r" ((uint8_t) ((value & 0x08 ? _WD_PS3_MASK : 0x00) | \ | |||||
_BV(WDIE) | (value & 0x07)) ) \ | |||||
: "r0" \ | |||||
) | |||||
#define SCL_CLOCK 400000L | #define SCL_CLOCK 400000L | ||||
#define SCL_DURATION (1000000L/SCL_CLOCK)/2 | #define SCL_DURATION (1000000L/SCL_CLOCK)/2 | ||||
extern uint8_t i2c_force_stop; | extern uint8_t i2c_force_stop; |
/* Matrix Mapping in EEPROM */ | /* Matrix Mapping in EEPROM */ | ||||
#define EECONFIG_ROW_COUNT (uint8_t *)11 | |||||
#define EECONFIG_COL_COUNT (uint8_t *)12 | |||||
#define EECONFIG_ROW_COL_MAPPING (uint8_t *)13 | |||||
#define EECONFIG_ROW_COUNT (uint8_t *)15 | |||||
#define EECONFIG_COL_COUNT (uint8_t *)16 | |||||
#define EECONFIG_ROW_COL_MAPPING (uint8_t *)17 | |||||
#define UNCONFIGURED 0xFF | #define UNCONFIGURED 0xFF | ||||
/* Functions */ | /* Functions */ |
#ifdef LEDMAP_ENABLE | #ifdef LEDMAP_ENABLE | ||||
static const uint8_t ledmaps[LED_COUNT] PROGMEM = { | |||||
static const uint16_t ledmaps[LED_COUNT] PROGMEM = { | |||||
[0] = LEDMAP_NUM_LOCK, // LED1 | [0] = LEDMAP_NUM_LOCK, // LED1 | ||||
[1] = LEDMAP_CAPS_LOCK, // LED2 | [1] = LEDMAP_CAPS_LOCK, // LED2 | ||||
[2] = LEDMAP_SCROLL_LOCK, // LED3 | [2] = LEDMAP_SCROLL_LOCK, // LED3 | ||||
[3] = LEDMAP_NO | LEDMAP_BACKLIGHT, // LED4 | |||||
[3] = LEDMAP_BACKLIGHT, // LED4 | |||||
}; | }; | ||||
uint8_t ledmap_get_code(uint8_t index) | |||||
ledmap_t ledmap_get_code(uint8_t index) | |||||
{ | { | ||||
return pgm_read_byte(&ledmaps[index]); | |||||
return (ledmap_t) { .code = pgm_read_word(&ledmaps[index]) }; | |||||
} | } | ||||
void ledmap_led_init(void) | void ledmap_led_init(void) |
print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n"); | print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n"); | ||||
for (uint8_t row = 0; row < matrix_rows(); row++) { | for (uint8_t row = 0; row < matrix_rows(); row++) { | ||||
phex(row); print(": "); | phex(row); print(": "); | ||||
pbin_reverse32(matrix_get_row(row)); | |||||
print_bin_reverse32(matrix_get_row(row)); | |||||
print("\n"); | print("\n"); | ||||
} | } | ||||
} | } |