diff options
| author | tmk <nobody@nowhere> | 2013-03-21 15:44:33 +0900 |
|---|---|---|
| committer | tmk <nobody@nowhere> | 2013-03-21 15:44:33 +0900 |
| commit | 2b08a150a41e25e87362436b7307bb1be35529f3 (patch) | |
| tree | e176fafe0e7723612f7fb34b88105ea892f35404 /common/action_oneshot.c | |
| parent | 8580c8d291a432d5004c46321aa3c1b1626cdadd (diff) | |
| parent | b2a19328ad35f51dcc9cef7c4d2801acd143582a (diff) | |
| download | qmk_firmware-2b08a150a41e25e87362436b7307bb1be35529f3.tar.gz qmk_firmware-2b08a150a41e25e87362436b7307bb1be35529f3.zip | |
Merge branch 'add_build_options'
Diffstat (limited to 'common/action_oneshot.c')
| -rw-r--r-- | common/action_oneshot.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/common/action_oneshot.c b/common/action_oneshot.c new file mode 100644 index 000000000..d34f44b5a --- /dev/null +++ b/common/action_oneshot.c | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #include "action_oneshot.h" | ||
| 2 | |||
| 3 | |||
| 4 | #ifndef NO_ACTION_ONESHOT | ||
| 5 | oneshot_state_t oneshot_state; | ||
| 6 | |||
| 7 | void oneshot_start(uint8_t mods) | ||
| 8 | { | ||
| 9 | oneshot_state.mods = mods; | ||
| 10 | } | ||
| 11 | |||
| 12 | void oneshot_cancel(void) | ||
| 13 | { | ||
| 14 | oneshot_state.mods = 0; | ||
| 15 | } | ||
| 16 | |||
| 17 | void oneshot_toggle(void) | ||
| 18 | { | ||
| 19 | oneshot_state.disabled = !oneshot_state.disabled; | ||
| 20 | } | ||
| 21 | #endif | ||
