]> git.donarmstrong.com Git - kiibohd-controller.git/blobdiff - Macro/PartialMap/kll.h
Adding KLL define support
[kiibohd-controller.git] / Macro / PartialMap / kll.h
index 6db5219611df1eac0da86b24e0f6a073e6beb2f0..c166d0c750a23ca452c444d010706b1880babad0 100644 (file)
@@ -19,6 +19,9 @@
 
 // ----- Includes -----
 
+// KLL Generated Defines
+#include <kll_defs.h>
+
 // Project Includes
 #include <print.h>
 #include <scan_loop.h>
 // It is possible to change the maximum state and indexing positions of the state machine.
 // This usually affects the SRAM usage quite a bit, so it can be used to fit the code on smaller uCs
 // Or to allow for nearly infinite states.
-// TODO Make selectable from layout variable
-//typedef uint32_t var_uint_t;
-//typedef uint16_t var_uint_t;
+#if StateWordSize_define == 32
+typedef uint32_t var_uint_t;
+#elif StateWordSize_define == 16
+typedef uint16_t var_uint_t;
+#elif StateWordSize_define == 8
 typedef uint8_t  var_uint_t;
+#else
+#error "Invalid StateWordSize, possible values: 32, 16 and 8."
+#endif
 
 // - NOTE -
 // Native pointer length
@@ -64,7 +72,7 @@ typedef uint16_t nat_ptr_t;
 // Default Args (always sent): key state/analog of last key
 // Combo Length of 0 signifies end of sequence
 //
-// ResultMacro.guide     -> [<combo length>|<capability index>|<arg1>|<argn>|<capability index>|...|<combo length>|...|0]
+// ResultMacro.guide -> [<combo length>|<capability index>|<arg1>|<argn>|<capability index>|...|<combo length>|...|0]
 //
 // ResultMacroRecord.pos       -> <current combo position>
 // ResultMacroRecord.state     -> <last key state>