changeset 255:8d41330c194d

Adding KLL define support
author Jacob Alexander <haata@kiibohd.com>
date Fri, 21 Nov 2014 14:58:50 -0800
parents 45cb81040110
children 98d1981f4dd3
files Lib/CMake/kll.cmake Macro/PartialMap/capabilities.kll Macro/PartialMap/kll.h
diffstat 3 files changed, 23 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/Lib/CMake/kll.cmake	Sun Nov 16 13:03:31 2014 -0800
+++ b/Lib/CMake/kll.cmake	Fri Nov 21 14:58:50 2014 -0800
@@ -114,13 +114,15 @@
 #
 
 #| KLL Options
-set ( kll_backend    -b kiibohd )
-set ( kll_template   -t ${PROJECT_SOURCE_DIR}/kll/templates/kiibohdKeymap.h )
+set ( kll_backend   -b kiibohd )
+set ( kll_template  -t ${PROJECT_SOURCE_DIR}/kll/templates/kiibohdKeymap.h )
 set ( kll_outputname generatedKeymap.h )
-set ( kll_output     -o ${kll_outputname} )
+set ( kll_output    -o ${kll_outputname} )
+set ( kll_define_output   --defines-output kll_defs.h )
+set ( kll_define_template --defines-template ${PROJECT_SOURCE_DIR}/kll/templates/kiibohdDefs.h )
 
 #| KLL Cmd
-set ( kll_cmd ${PROJECT_SOURCE_DIR}/kll/kll.py ${BaseMap_Args} ${DefaultMap_Args} ${PartialMap_Args} ${kll_backend} ${kll_template} ${kll_output} )
+set ( kll_cmd ${PROJECT_SOURCE_DIR}/kll/kll.py ${BaseMap_Args} ${DefaultMap_Args} ${PartialMap_Args} ${kll_backend} ${kll_template} ${kll_output} ${kll_define_template} ${kll_define_output} )
 add_custom_command ( OUTPUT ${kll_outputname}
 	COMMAND ${kll_cmd}
 	DEPENDS ${KLL_DEPENDS}
--- a/Macro/PartialMap/capabilities.kll	Sun Nov 16 13:03:31 2014 -0800
+++ b/Macro/PartialMap/capabilities.kll	Fri Nov 21 14:58:50 2014 -0800
@@ -1,10 +1,10 @@
 Name = PartialMapCapabilities;
 Version = 0.1;
 Author = "HaaTa (Jacob Alexander) 2014";
-KLL = 0.3;
+KLL = 0.3a;
 
 # Modified Date
-Date = 2014-09-14;
+Date = 2014-11-21;
 
 
 # Capabilties available to the PartialMap module
@@ -13,3 +13,7 @@
 layerLock  => Macro_layerLock_capability( layer : 2 );
 layerShift => Macro_layerShift_capability( layer : 2 );
 
+# Defines available to the PartialMap module
+stateWordSize => StateWordSize_define;
+stateWordSize = 8; # Default for now, increase to 16 or 32 for higher limits
+
--- a/Macro/PartialMap/kll.h	Sun Nov 16 13:03:31 2014 -0800
+++ b/Macro/PartialMap/kll.h	Fri Nov 21 14:58:50 2014 -0800
@@ -19,6 +19,9 @@
 
 // ----- Includes -----
 
+// KLL Generated Defines
+#include <kll_defs.h>
+
 // Project Includes
 #include <print.h>
 #include <scan_loop.h>
@@ -36,10 +39,15 @@
 // 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