diff --git a/keyboard/kimera/Makefile b/keyboard/kimera/Makefile index 468dc314..b2a308fe 100644 --- a/keyboard/kimera/Makefile +++ b/keyboard/kimera/Makefile @@ -42,7 +42,7 @@ TARGET = kimera_lufa # Directory common source filess exist -TOP_DIR = ../.. +TMK_DIR = ../../tmk_core_custom # Directory keyboard dependent files exist TARGET_DIR = . @@ -155,9 +155,8 @@ LEDMAP_IN_EEPROM_ENABLE = yes # Read LED mapping from eeprom # Search Path 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 diff --git a/keyboard/kimera/backlight.c b/keyboard/kimera/backlight.c index 1603d5d2..6cc3f0b6 100644 --- a/keyboard/kimera/backlight.c +++ b/keyboard/kimera/backlight.c @@ -115,14 +115,14 @@ void backlight_set(uint8_t level) softpwm_led_enable(); fading_led_enable_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); break; case 8: softpwm_led_enable(); fading_led_enable_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); break; #endif diff --git a/keyboard/kimera/config.h b/keyboard/kimera/config.h index 38ceef65..b08002e7 100644 --- a/keyboard/kimera/config.h +++ b/keyboard/kimera/config.h @@ -36,9 +36,9 @@ along with this program. If not, see . #define FN_ACTIONS_COUNT 32 #define KEYMAPS_COUNT 3 #ifndef TWO_HEADED_KIMERA -#define EECONFIG_KEYMAP_IN_EEPROM 45 +#define EECONFIG_KEYMAP_IN_EEPROM 49 #else -#define EECONFIG_KEYMAP_IN_EEPROM 77 +#define EECONFIG_KEYMAP_IN_EEPROM 81 #endif /* define if matrix has ghost */ @@ -90,7 +90,7 @@ along with this program. If not, see . //#define NO_ACTION_LAYER //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO +#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION #define NO_SUSPEND_POWER_DOWN diff --git a/keyboard/kimera/keymap_common.c b/keyboard/kimera/keymap_common.c index f51dfdbe..cab3f88d 100644 --- a/keyboard/kimera/keymap_common.c +++ b/keyboard/kimera/keymap_common.c @@ -18,7 +18,7 @@ along with this program. If not, see . #include "matrix.h" /* 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 return pgm_read_byte(&keymaps[(layer)][(key.row) * matrix_cols() + (key.col)]); diff --git a/keyboard/kimera/kimera.c b/keyboard/kimera/kimera.c index e75ea8ac..c4c42f8d 100644 --- a/keyboard/kimera/kimera.c +++ b/keyboard/kimera/kimera.c @@ -23,11 +23,26 @@ along with this program. If not, see . #include #include #include "action.h" -#include "suspend.h" #include "i2cmaster.h" #include "kimera.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_DURATION (1000000L/SCL_CLOCK)/2 extern uint8_t i2c_force_stop; diff --git a/keyboard/kimera/kimera.h b/keyboard/kimera/kimera.h index d4e1943a..3f5ff9f9 100644 --- a/keyboard/kimera/kimera.h +++ b/keyboard/kimera/kimera.h @@ -116,9 +116,9 @@ const uint16_t PROGMEM dummy[] = { /* 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 /* Functions */ diff --git a/keyboard/kimera/ledmap.c b/keyboard/kimera/ledmap.c index 6c173e9d..a2794068 100644 --- a/keyboard/kimera/ledmap.c +++ b/keyboard/kimera/ledmap.c @@ -21,16 +21,16 @@ along with this program. If not, see . #ifdef LEDMAP_ENABLE -static const uint8_t ledmaps[LED_COUNT] PROGMEM = { +static const uint16_t ledmaps[LED_COUNT] PROGMEM = { [0] = LEDMAP_NUM_LOCK, // LED1 [1] = LEDMAP_CAPS_LOCK, // LED2 [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) diff --git a/keyboard/kimera/matrix.c b/keyboard/kimera/matrix.c index 7754f239..bc7b9387 100644 --- a/keyboard/kimera/matrix.c +++ b/keyboard/kimera/matrix.c @@ -126,7 +126,7 @@ void matrix_print(void) print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n"); for (uint8_t row = 0; row < matrix_rows(); row++) { phex(row); print(": "); - pbin_reverse32(matrix_get_row(row)); + print_bin_reverse32(matrix_get_row(row)); print("\n"); } }