Fix compile errors & drop the END state

We can't ++ enums in C++, it seems, so use a switch statement instead. Also
qualify the EEPROMKeymap object, so we call the object method, instead of trying
to call a method on a class as if it was an object. Oops.

Within this process, drop the END state, it is not required anymore.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/389/head
Gergely Nagy 8 years ago
parent 0fadb782ca
commit af56e5b5a5

@ -33,11 +33,17 @@ namespace KaleidoscopePlugins {
void
EEPROMKeymapProgrammer::nextState (void) {
state++;
if (state == END) {
EEPROMKeymap.updateKey (updatePosition, newKey);
switch (state) {
case INACTIVE:
state = WAIT_FOR_KEY;
break;
case WAIT_FOR_KEY:
state = WAIT_FOR_CODE;
break;
case WAIT_FOR_CODE:
::EEPROMKeymap.updateKey (updatePosition, newKey);
cancel ();
break;
}
}
@ -50,7 +56,7 @@ namespace KaleidoscopePlugins {
Key
EEPROMKeymapProgrammer::eventHandlerHook (Key mappedKey, byte row, byte col, uint8_t keyState) {
if (state == INACTIVE || state == END)
if (state == INACTIVE)
return mappedKey;
if (state == WAIT_FOR_KEY) {

@ -38,7 +38,6 @@ namespace KaleidoscopePlugins {
INACTIVE,
WAIT_FOR_KEY,
WAIT_FOR_CODE,
END
} state_t;
static state_t state;

Loading…
Cancel
Save