From 1eb8523e9506c752fb726208d8853a82f06e6659 Mon Sep 17 00:00:00 2001 From: Wraul Date: Thu, 30 May 2013 20:24:39 +0200 Subject: Add support for backlight --- common/action_code.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'common/action_code.h') diff --git a/common/action_code.h b/common/action_code.h index 0933dce136..d28b74f843 100644 --- a/common/action_code.h +++ b/common/action_code.h @@ -85,6 +85,9 @@ along with this program. If not, see . * 1100|opt | id(8) Macro play? * 1100|1111| id(8) Macro record? * + * ACT_BACKLIGHT(1101): + * 1110|xxxx| id(8) Backlight commands + * * ACT_COMMAND(1110): * 1110|opt | id(8) Built-in Command exec * @@ -109,6 +112,7 @@ enum action_kind_id { ACT_LAYER_TAP1 = 0b1011, /* Extensions */ ACT_MACRO = 0b1100, + ACT_BACKLIGHT = 0b1101, ACT_COMMAND = 0b1110, ACT_FUNCTION = 0b1111 }; @@ -157,6 +161,9 @@ typedef union { uint8_t page :2; uint8_t kind :4; } usage; + struct action_backlight { + uint8_t id :8; + } backlight; struct action_command { uint8_t id :8; uint8_t opt :4; @@ -272,10 +279,21 @@ enum layer_pram_tap_op { /* * Extensions */ +enum backlight_id { + BACKLIGHT_INCREASE = 0, + BACKLIGHT_DECREASE = 1, + BACKLIGHT_TOGGLE = 2, + BACKLIGHT_STEP = 3, +}; /* Macro */ #define ACTION_MACRO(id) ACTION(ACT_MACRO, (id)) #define ACTION_MACRO_TAP(id) ACTION(ACT_MACRO, FUNC_TAP<<8 | (id)) #define ACTION_MACRO_OPT(id, opt) ACTION(ACT_MACRO, (opt)<<8 | (id)) +/* Backlight */ +#define ACTION_BACKLIGHT_INCREASE() ACTION(ACT_BACKLIGHT, BACKLIGHT_INCREASE) +#define ACTION_BACKLIGHT_DECREASE() ACTION(ACT_BACKLIGHT, BACKLIGHT_DECREASE) +#define ACTION_BACKLIGHT_TOGGLE() ACTION(ACT_BACKLIGHT, BACKLIGHT_TOGGLE) +#define ACTION_BACKLIGHT_STEP() ACTION(ACT_BACKLIGHT, BACKLIGHT_STEP) /* Command */ #define ACTION_COMMAND(id, opt) ACTION(ACT_COMMAND, (opt)<<8 | (addr)) /* Function */ -- cgit v1.2.3 From 82aec4672213171b706f62862044b68d255bc4e9 Mon Sep 17 00:00:00 2001 From: tmk Date: Sat, 22 Jun 2013 17:32:53 +0900 Subject: Fix typo --- common/action_code.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/action_code.h') diff --git a/common/action_code.h b/common/action_code.h index d28b74f843..2272091cc4 100644 --- a/common/action_code.h +++ b/common/action_code.h @@ -86,7 +86,7 @@ along with this program. If not, see . * 1100|1111| id(8) Macro record? * * ACT_BACKLIGHT(1101): - * 1110|xxxx| id(8) Backlight commands + * 1101|xxxx| id(8) Backlight commands * * ACT_COMMAND(1110): * 1110|opt | id(8) Built-in Command exec -- cgit v1.2.3