Make `programmerMode` (now `mode`) public

Instead of using a setter, just make the variable public.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/389/head
Gergely Nagy 8 years ago
parent 98650dae19
commit 3ac9b54ca9

@ -21,7 +21,7 @@
namespace KaleidoscopePlugins { namespace KaleidoscopePlugins {
uint16_t EEPROMKeymapProgrammer::updatePosition; uint16_t EEPROMKeymapProgrammer::updatePosition;
EEPROMKeymapProgrammer::state_t EEPROMKeymapProgrammer::state; EEPROMKeymapProgrammer::state_t EEPROMKeymapProgrammer::state;
EEPROMKeymapProgrammer::mode_t EEPROMKeymapProgrammer::programmerMode; EEPROMKeymapProgrammer::mode_t EEPROMKeymapProgrammer::mode;
Key EEPROMKeymapProgrammer::newKey; Key EEPROMKeymapProgrammer::newKey;
EEPROMKeymapProgrammer::EEPROMKeymapProgrammer (void) { EEPROMKeymapProgrammer::EEPROMKeymapProgrammer (void) {
@ -32,11 +32,6 @@ namespace KaleidoscopePlugins {
event_handler_hook_use (eventHandlerHook); event_handler_hook_use (eventHandlerHook);
} }
void
EEPROMKeymapProgrammer::mode (mode_t programmerMode_) {
programmerMode = programmerMode_;
}
void void
EEPROMKeymapProgrammer::nextState (void) { EEPROMKeymapProgrammer::nextState (void) {
switch (state) { switch (state) {
@ -44,7 +39,7 @@ namespace KaleidoscopePlugins {
state = WAIT_FOR_KEY; state = WAIT_FOR_KEY;
break; break;
case WAIT_FOR_KEY: case WAIT_FOR_KEY:
if (programmerMode == CODE) if (mode == CODE)
state = WAIT_FOR_CODE; state = WAIT_FOR_CODE;
else else
state = WAIT_FOR_SOURCE_KEY; state = WAIT_FOR_SOURCE_KEY;

@ -28,17 +28,16 @@ namespace KaleidoscopePlugins {
CODE, CODE,
COPY, COPY,
} mode_t; } mode_t;
static mode_t mode;
EEPROMKeymapProgrammer (void); EEPROMKeymapProgrammer (void);
virtual void begin (void) final; virtual void begin (void) final;
static void mode (mode_t programmerMode);
static void nextState (void); static void nextState (void);
static void cancel (void); static void cancel (void);
private: private:
static mode_t programmerMode;
typedef enum { typedef enum {
INACTIVE, INACTIVE,
WAIT_FOR_KEY, WAIT_FOR_KEY,

Loading…
Cancel
Save