summary refs log tree commit diff
path: root/common/action_code.h
diff options
context:
space:
mode:
authorRalf Schmitt <ralf@bunkertor.net>2014-04-08 21:02:46 +0200
committerRalf Schmitt <ralf@bunkertor.net>2014-04-08 21:02:46 +0200
commit589d99b448e6085513799fbb183f6389d4df408d (patch)
tree3d6f83a71ffe03a2855046de58ba7ae9095f0733 /common/action_code.h
parent5c63751790bca2d7e0c6f368bd446db8fe671848 (diff)
New macro: ACTION_BACKLIGHT_LEVEL(level)
To have full control of the backlight level.
Diffstat (limited to 'common/action_code.h')
-rw-r--r--common/action_code.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/common/action_code.h b/common/action_code.h
index 8df86b1192..50112d4d20 100644
--- a/common/action_code.h
+++ b/common/action_code.h
@@ -87,7 +87,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  * 1100|1111| id(8)      Macro record?
  *
  * ACT_BACKLIGHT(1101):
- * 1101|xxxx| id(8)      Backlight commands
+ * 1101|opt |level(8)    Backlight commands
  *
  * ACT_COMMAND(1110):
  * 1110|opt | id(8)      Built-in Command exec
@@ -163,7 +163,9 @@ typedef union {
         uint8_t  kind   :4;
     } usage;
     struct action_backlight {
-        uint8_t  id     :8;
+        uint8_t  level  :8;
+        uint8_t  opt    :4;
+        uint8_t  kind   :4;
     } backlight;
     struct action_command {
         uint8_t  id     :8;
@@ -282,21 +284,23 @@ enum layer_pram_tap_op {
 /*
  * Extensions
  */
-enum backlight_id {
+enum backlight_opt {
     BACKLIGHT_INCREASE = 0,
     BACKLIGHT_DECREASE = 1,
     BACKLIGHT_TOGGLE   = 2,
     BACKLIGHT_STEP     = 3,
+    BACKLIGHT_LEVEL    = 4,
 };
 /* 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)
+#define ACTION_BACKLIGHT_INCREASE()     ACTION(ACT_BACKLIGHT, BACKLIGHT_INCREASE << 8)
+#define ACTION_BACKLIGHT_DECREASE()     ACTION(ACT_BACKLIGHT, BACKLIGHT_DECREASE << 8)
+#define ACTION_BACKLIGHT_TOGGLE()       ACTION(ACT_BACKLIGHT, BACKLIGHT_TOGGLE << 8)
+#define ACTION_BACKLIGHT_STEP()         ACTION(ACT_BACKLIGHT, BACKLIGHT_STEP << 8)
+#define ACTION_BACKLIGHT_LEVEL(level)   ACTION(ACT_BACKLIGHT, BACKLIGHT_LEVEL << 8 | level)
 /* Command */
 #define ACTION_COMMAND(id, opt)         ACTION(ACT_COMMAND,  (opt)<<8 | (addr))
 /* Function */