~ruther/qmk_firmware

a058ae40e268b34ba5db45f5fd5d557d50fa5437 — Gergely Nagy 9 years ago a920548
quantum: Move qk_ucis_state to process_unicode.c

In order to not declare the same variable in multiple objects (which
happens when building UCIS-enabled keymap for both the ErgoDox EZ and
the ErgoDox Infinity), move the declaration to the .c file, and keep
only an extern reference in the header.

Many thanks to @fredizzimo for spotting the error in Travis, and
suggesting the fix.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2 files changed, 6 insertions(+), 2 deletions(-)

M quantum/process_keycode/process_unicode.c
M quantum/process_keycode/process_unicode.h
M quantum/process_keycode/process_unicode.c => quantum/process_keycode/process_unicode.c +2 -0
@@ 74,6 74,8 @@ bool process_unicode(uint16_t keycode, keyrecord_t *record) {
}

#ifdef UCIS_ENABLE
qk_ucis_state_t qk_ucis_state;

void qk_ucis_start(void) {
  qk_ucis_state.count = 0;
  qk_ucis_state.in_progress = true;

M quantum/process_keycode/process_unicode.h => quantum/process_keycode/process_unicode.h +4 -2
@@ 29,11 29,13 @@ typedef struct {
  char *code;
} qk_ucis_symbol_t;

struct {
typedef struct {
  uint8_t count;
  uint16_t codes[UCIS_MAX_SYMBOL_LENGTH];
  bool in_progress:1;
} qk_ucis_state;
} qk_ucis_state_t;

extern qk_ucis_state_t qk_ucis_state;

#define UCIS_TABLE(...) {__VA_ARGS__, {NULL, NULL}}
#define UCIS_SYM(name, code) {name, #code}