aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/common/action_code.h
diff options
context:
space:
mode:
authorJames Young <xxiinophobia@yahoo.com>2020-02-29 12:00:00 -0800
committerJames Young <xxiinophobia@yahoo.com>2020-02-29 11:59:30 -0800
commit26eef35f07698d23aafae90e1c230b52e100a334 (patch)
treeeb8e43fc58ca55788e6e89430af0db55ea79e324 /tmk_core/common/action_code.h
parent85041ff05bf0e5f4ff4535caf6e638491a5614c8 (diff)
downloadqmk_firmware-26eef35f07698d23aafae90e1c230b52e100a334.tar.gz
qmk_firmware-26eef35f07698d23aafae90e1c230b52e100a334.zip
2020 February 29 Breaking Changes Update (#8064)
Diffstat (limited to 'tmk_core/common/action_code.h')
-rw-r--r--tmk_core/common/action_code.h33
1 files changed, 4 insertions, 29 deletions
diff --git a/tmk_core/common/action_code.h b/tmk_core/common/action_code.h
index 03fcb3382..6c005b76d 100644
--- a/tmk_core/common/action_code.h
+++ b/tmk_core/common/action_code.h
@@ -86,8 +86,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
86 * 1100|opt | id(8) Macro play? 86 * 1100|opt | id(8) Macro play?
87 * 1100|1111| id(8) Macro record? 87 * 1100|1111| id(8) Macro record?
88 * 88 *
89 * ACT_BACKLIGHT(1101): 89 * 1101|xxxx xxxx xxxx (reserved)
90 * 1101|opt |level(8) Backlight commands
91 * 90 *
92 * ACT_COMMAND(1110): 91 * ACT_COMMAND(1110):
93 * 1110|opt | id(8) Built-in Command exec 92 * 1110|opt | id(8) Built-in Command exec
@@ -115,10 +114,9 @@ enum action_kind_id {
115 ACT_LAYER_TAP = 0b1010, /* Layer 0-15 */ 114 ACT_LAYER_TAP = 0b1010, /* Layer 0-15 */
116 ACT_LAYER_TAP_EXT = 0b1011, /* Layer 16-31 */ 115 ACT_LAYER_TAP_EXT = 0b1011, /* Layer 16-31 */
117 /* Extensions */ 116 /* Extensions */
118 ACT_MACRO = 0b1100, 117 ACT_MACRO = 0b1100,
119 ACT_BACKLIGHT = 0b1101, 118 ACT_COMMAND = 0b1110,
120 ACT_COMMAND = 0b1110, 119 ACT_FUNCTION = 0b1111
121 ACT_FUNCTION = 0b1111
122}; 120};
123 121
124/** \brief Action Code Struct 122/** \brief Action Code Struct
@@ -169,11 +167,6 @@ typedef union {
169 uint8_t page : 2; 167 uint8_t page : 2;
170 uint8_t kind : 4; 168 uint8_t kind : 4;
171 } usage; 169 } usage;
172 struct action_backlight {
173 uint8_t level : 8;
174 uint8_t opt : 4;
175 uint8_t kind : 4;
176 } backlight;
177 struct action_command { 170 struct action_command {
178 uint8_t id : 8; 171 uint8_t id : 8;
179 uint8_t opt : 4; 172 uint8_t opt : 4;
@@ -290,28 +283,10 @@ enum layer_param_tap_op {
290#define ACTION_DEFAULT_LAYER_BIT_XOR(part, bits) ACTION_LAYER_BITOP(OP_BIT_XOR, (part), (bits), 0) 283#define ACTION_DEFAULT_LAYER_BIT_XOR(part, bits) ACTION_LAYER_BITOP(OP_BIT_XOR, (part), (bits), 0)
291#define ACTION_DEFAULT_LAYER_BIT_SET(part, bits) ACTION_LAYER_BITOP(OP_BIT_SET, (part), (bits), 0) 284#define ACTION_DEFAULT_LAYER_BIT_SET(part, bits) ACTION_LAYER_BITOP(OP_BIT_SET, (part), (bits), 0)
292 285
293/** \brief Extensions
294 */
295enum backlight_opt {
296 BACKLIGHT_INCREASE = 0,
297 BACKLIGHT_DECREASE = 1,
298 BACKLIGHT_TOGGLE = 2,
299 BACKLIGHT_STEP = 3,
300 BACKLIGHT_ON = 4,
301 BACKLIGHT_OFF = 5,
302};
303
304/* Macro */ 286/* Macro */
305#define ACTION_MACRO(id) ACTION(ACT_MACRO, (id)) 287#define ACTION_MACRO(id) ACTION(ACT_MACRO, (id))
306#define ACTION_MACRO_TAP(id) ACTION(ACT_MACRO, FUNC_TAP << 8 | (id)) 288#define ACTION_MACRO_TAP(id) ACTION(ACT_MACRO, FUNC_TAP << 8 | (id))
307#define ACTION_MACRO_OPT(id, opt) ACTION(ACT_MACRO, (opt) << 8 | (id)) 289#define ACTION_MACRO_OPT(id, opt) ACTION(ACT_MACRO, (opt) << 8 | (id))
308/* Backlight */
309#define ACTION_BACKLIGHT_INCREASE() ACTION(ACT_BACKLIGHT, BACKLIGHT_INCREASE << 8)
310#define ACTION_BACKLIGHT_DECREASE() ACTION(ACT_BACKLIGHT, BACKLIGHT_DECREASE << 8)
311#define ACTION_BACKLIGHT_TOGGLE() ACTION(ACT_BACKLIGHT, BACKLIGHT_TOGGLE << 8)
312#define ACTION_BACKLIGHT_STEP() ACTION(ACT_BACKLIGHT, BACKLIGHT_STEP << 8)
313#define ACTION_BACKLIGHT_ON() ACTION(ACT_BACKLIGHT, BACKLIGHT_ON << 8)
314#define ACTION_BACKLIGHT_OFF() ACTION(ACT_BACKLIGHT, BACKLIGHT_OFF << 8)
315/* Command */ 290/* Command */
316#define ACTION_COMMAND(id, opt) ACTION(ACT_COMMAND, (opt) << 8 | (id)) 291#define ACTION_COMMAND(id, opt) ACTION(ACT_COMMAND, (opt) << 8 | (id))
317/* Function */ 292/* Function */