1
0

Improve flexibility

This commit is contained in:
Kai Ryu 2014-05-26 12:48:10 +09:00
parent f8443e306b
commit f0eb462c0a
2 changed files with 5 additions and 2 deletions

View File

@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <avr/eeprom.h> #include <avr/eeprom.h>
#include "eeconfig.h" #include "eeconfig.h"
#include "keymap_in_eeprom.h" #include "keymap_in_eeprom.h"
#include "matrix.h"
#include "debug.h" #include "debug.h"
#ifdef KEYMAP_IN_EEPROM_ENABLE #ifdef KEYMAP_IN_EEPROM_ENABLE

View File

@ -23,14 +23,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#ifndef EECONFIG_KEYMAP_IN_EEPROM
#define EECONFIG_KEYMAP_IN_EEPROM 0x10 #define EECONFIG_KEYMAP_IN_EEPROM 0x10
#endif
#ifndef FN_ACTIONS_COUNT #ifndef FN_ACTIONS_COUNT
#define FN_ACTIONS_COUNT 32 #define FN_ACTIONS_COUNT 32
#endif #endif
#ifndef KEYMAPS_COUNT #ifndef KEYMAPS_COUNT
#define KEYMAPS_COUNT 1 #define KEYMAPS_COUNT 1
#endif #endif
#define KEYS_COUNT (KEYMAPS_COUNT * MATRIX_ROWS * MATRIX_COLS) #define KEYS_COUNT (KEYMAPS_COUNT * matrix_rows() * matrix_cols())
typedef struct { typedef struct {
uint16_t checksum; uint16_t checksum;
@ -45,7 +47,7 @@ typedef struct {
#define KEYMAP_SIZE (sizeof(uint16_t) * FN_ACTIONS_COUNT + sizeof(uint8_t) * KEYS_COUNT) #define KEYMAP_SIZE (sizeof(uint16_t) * FN_ACTIONS_COUNT + sizeof(uint8_t) * KEYS_COUNT)
#define KEYMAP_WORD_SIZE ((KEYMAP_SIZE + 1) / 2) #define KEYMAP_WORD_SIZE ((KEYMAP_SIZE + 1) / 2)
#define KEY_OFFSET(layer, row, col) (layer * MATRIX_ROWS * MATRIX_COLS + row * MATRIX_COLS + col) #define KEY_OFFSET(layer, row, col) (layer * matrix_rows() * matrix_cols() + row * matrix_cols() + col)
void keymap_in_eeprom_init(void); void keymap_in_eeprom_init(void);
void keymap_in_eeprom_disable(void); void keymap_in_eeprom_disable(void);