forked from mirrors/qmk_userspace
VIA Configurator Refactor (#7268)
* VIA Refactor * Remove old code * review changes * review changes * Fix cannonkeys/satisfaction75/prototype:via build * Add via.h to quantum.h * Move backlight init to after backlight config load * Merge branch 'master' into via_refactor_pr * Update user's rules.mk to new way of enabling VIA * Added id_switch_matrix_state * Review changes
This commit is contained in:
parent
b362595665
commit
320822d75b
167 changed files with 1502 additions and 3157 deletions
|
@ -20,28 +20,37 @@
|
|||
#include "progmem.h" // to read default from flash
|
||||
#include "quantum.h" // for send_string()
|
||||
#include "dynamic_keymap.h"
|
||||
#include "via.h" // for default VIA_EEPROM_ADDR_END
|
||||
|
||||
#ifdef DYNAMIC_KEYMAP_ENABLE
|
||||
#ifndef DYNAMIC_KEYMAP_LAYER_COUNT
|
||||
# define DYNAMIC_KEYMAP_LAYER_COUNT 4
|
||||
#endif
|
||||
|
||||
# ifndef DYNAMIC_KEYMAP_EEPROM_ADDR
|
||||
# error DYNAMIC_KEYMAP_EEPROM_ADDR not defined
|
||||
# endif
|
||||
#ifndef DYNAMIC_KEYMAP_MACRO_COUNT
|
||||
# define DYNAMIC_KEYMAP_MACRO_COUNT 16
|
||||
#endif
|
||||
|
||||
# ifndef DYNAMIC_KEYMAP_LAYER_COUNT
|
||||
# error DYNAMIC_KEYMAP_LAYER_COUNT not defined
|
||||
# endif
|
||||
// If DYNAMIC_KEYMAP_EEPROM_ADDR not explicitly defined in config.h,
|
||||
// default it start after VIA_EEPROM_CUSTOM_ADDR+VIA_EEPROM_CUSTOM_SIZE
|
||||
#ifndef DYNAMIC_KEYMAP_EEPROM_ADDR
|
||||
# ifdef VIA_EEPROM_CUSTOM_CONFIG_ADDR
|
||||
# define DYNAMIC_KEYMAP_EEPROM_ADDR (VIA_EEPROM_CUSTOM_CONFIG_ADDR+VIA_EEPROM_CUSTOM_CONFIG_SIZE)
|
||||
# else
|
||||
# error DYNAMIC_KEYMAP_EEPROM_ADDR not defined
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# ifndef DYNAMIC_KEYMAP_MACRO_COUNT
|
||||
# error DYNAMIC_KEYMAP_MACRO_COUNT not defined
|
||||
# endif
|
||||
// Dynamic macro starts after dynamic keymaps
|
||||
#ifndef DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR
|
||||
# define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR (DYNAMIC_KEYMAP_EEPROM_ADDR+(DYNAMIC_KEYMAP_LAYER_COUNT*MATRIX_ROWS*MATRIX_COLS*2))
|
||||
#endif
|
||||
|
||||
# ifndef DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR
|
||||
# error DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR not defined
|
||||
# endif
|
||||
|
||||
# ifndef DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE
|
||||
# error DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE not defined
|
||||
# endif
|
||||
// Dynamic macro uses up all remaining memory
|
||||
// Assumes 1K EEPROM on ATMega32U4
|
||||
// Override for anything different
|
||||
#ifndef DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE
|
||||
# define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE (1024-DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR)
|
||||
#endif
|
||||
|
||||
uint8_t dynamic_keymap_get_layer_count(void) { return DYNAMIC_KEYMAP_LAYER_COUNT; }
|
||||
|
||||
|
@ -208,5 +217,3 @@ void dynamic_keymap_macro_send(uint8_t id) {
|
|||
send_string(data);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // DYNAMIC_KEYMAP_ENABLE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue