moved `_layout` to PROGMEM

where it should have been (and i thought it was) before ... oops :)
partial-rewrite
Ben Blazak 2013-04-19 22:30:14 -07:00
parent 058981cb83
commit f9dfb539d1
3 changed files with 8 additions and 7 deletions

View File

@ -99,12 +99,12 @@ typedef void (*_key_t[2])(void);
* - The first dimension of the matrix (left blank in the typedef since it
* varies between layouts) is "layers"
*/
typedef const _key_t PROGMEM _layout_t[][OPT__KB__ROWS][OPT__KB__COLUMNS];
typedef const _key_t _layout_t[][OPT__KB__ROWS][OPT__KB__COLUMNS];
/** variables/layout/description
* The variable containing our layout matrix
*/
_layout_t _layout;
_layout_t PROGMEM _layout;
/** variables/sticky_key/description
* A pointer to the release function of the last sticky key pressed

View File

@ -46,10 +46,11 @@ void kb__layout__exec_key(bool pressed, uint8_t row, uint8_t column) {
else
layer = layer_stack__peek(i-1);
function = _layout[ layer ]
[ row ]
[ column ]
[ (pressed) ? 0 : 1 ];
function = (void (*)(void))
pgm_read_word( &( _layout[ layer ]
[ row ]
[ column ]
[ (pressed) ? 0 : 1 ] ) );
if (function == &KF(transp))
function = NULL;

View File

@ -40,7 +40,7 @@ SRC :=
CFLAGS :=
LDFLAGS :=
GENDEPFLAGS :=
# (initialize the variables so we can use `+=` below and in the included files)
# (initialize variables, so we can use `+=` below and in the included files)
CURDIRS := $(CURDIR) $(CURDIRS)
# -------