Skip to content

Commit

Permalink
Merge pull request #94 from stek29/button_toggle_readonly
Browse files Browse the repository at this point in the history
Add new button action (toggle readonly)
  • Loading branch information
iceman1001 authored Apr 18, 2019
2 parents c5882e3 + 06d3360 commit e2d8d34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Firmware/Chameleon-Mini/Button.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ static const char PROGMEM ButtonActionTable[][32] =
[BUTTON_ACTION_UID_RIGHT_INCREMENT] = "UID_RIGHT_INCREMENT",
[BUTTON_ACTION_UID_LEFT_DECREMENT] = "UID_LEFT_DECREMENT",
[BUTTON_ACTION_UID_RIGHT_DECREMENT] = "UID_RIGHT_DECREMENT",
[BUTTON_ACTION_CYCLE_SETTINGS] = "SWITCHCARD"
[BUTTON_ACTION_CYCLE_SETTINGS] = "SWITCHCARD",
[BUTTON_ACTION_TOGGLE_READONLY] = "READONLY",
};

void ButtonInit(void)
Expand Down Expand Up @@ -114,6 +115,8 @@ static void ExecuteButtonAction(ButtonActionEnum ButtonAction)
ApplicationSetUid(UidBuffer);
} else if (ButtonAction == BUTTON_ACTION_CYCLE_SETTINGS) {
SettingsCycle();
} else if (ButtonAction == BUTTON_ACTION_TOGGLE_READONLY) {
ActiveConfiguration.ReadOnly = !ActiveConfiguration.ReadOnly;
}
}

Expand Down
1 change: 1 addition & 0 deletions Firmware/Chameleon-Mini/Button.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ typedef enum {
BUTTON_ACTION_UID_LEFT_DECREMENT,
BUTTON_ACTION_UID_RIGHT_DECREMENT,
BUTTON_ACTION_CYCLE_SETTINGS,
BUTTON_ACTION_TOGGLE_READONLY,

/* This has to be last element */
BUTTON_ACTION_COUNT
Expand Down

0 comments on commit e2d8d34

Please sign in to comment.