Browse Source

kimera: Change code to fit master branch

kimera
Kai Ryu 9 years ago
parent
commit
422cfac490

+ 5
- 6
keyboard/kimera/Makefile View File

@@ -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

+ 2
- 2
keyboard/kimera/backlight.c View File

@@ -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

+ 3
- 3
keyboard/kimera/config.h View File

@@ -36,9 +36,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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 <http://www.gnu.org/licenses/>.
//#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

+ 1
- 1
keyboard/kimera/keymap_common.c View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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)]);

+ 16
- 1
keyboard/kimera/kimera.c View File

@@ -23,11 +23,26 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <avr/wdt.h>
#include <util/delay.h>
#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;

+ 3
- 3
keyboard/kimera/kimera.h View File

@@ -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 */

+ 4
- 4
keyboard/kimera/ledmap.c View File

@@ -21,16 +21,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#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)

+ 1
- 1
keyboard/kimera/matrix.c View File

@@ -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");
}
}