]> git.donarmstrong.com Git - kiibohd-controller.git/commitdiff
Adding macroList debug function
authorJacob Alexander <haata@kiibohd.com>
Fri, 25 Jul 2014 06:42:38 +0000 (23:42 -0700)
committerJacob Alexander <haata@kiibohd.com>
Fri, 25 Jul 2014 06:42:38 +0000 (23:42 -0700)
- Fixed TriggerMacroNum and ResultMacroNum

Macro/PartialMap/generatedKeymap.h
Macro/PartialMap/macro.c

index 6fc09dad78812b045cd490a3ac4b8f8216dc351e..41f326319e386a7f3bb3dd62465453a35009c035 100644 (file)
@@ -171,7 +171,7 @@ Guide_RM( 3 ) = { 1, debugPrint2_cap( 0xCA, 0xFE ), 0 };
 
 // Total number of result macros (rm's)
 // Used to create pending rm's table
-#define ResultMacroNum sizeof( ResultMacroList )
+#define ResultMacroNum sizeof( ResultMacroList ) / sizeof( ResultMacro )
 
 // Indexed Table of Result Macros
 ResultMacro ResultMacroList[] = {
@@ -202,7 +202,7 @@ Guide_TM( 3 ) = { 1, 0x10, 0x01, 0x76, 0 };
 
 // Total number of trigger macros (tm's)
 // Used to create pending tm's table
-#define TriggerMacroNum sizeof( TriggerMacroList )
+#define TriggerMacroNum sizeof( TriggerMacroList ) / sizeof( TriggerMacro )
 
 // Indexed Table of Trigger Macros
 TriggerMacro TriggerMacroList[] = {
index ad46d95c993ac39402b5acfd0463e232501b7500..3f033d4ffef6d3231036184f158c7f6ed3f8e3a1 100644 (file)
@@ -68,7 +68,7 @@ CLIDictItem macroCLIDict[] = {
        { "macroDebug",  "Disables/Enables sending USB keycodes to the Output Module and prints U/K codes.", cliFunc_macroDebug },
        { "macroList",   "List the defined trigger and result macros.", cliFunc_macroList },
        { "macroProc",   "Pause/Resume macro processing.", cliFunc_macroProc },
-       { "macroShow",   "Show the macro corresponding to the given index or scan-code." NL "\t\t\033[35mT16\033[0m Indexed Trigger Macro 0x10, \033[35mR12\033[0m Indexed Result Macro 0x0C", cliFunc_macroShow },
+       { "macroShow",   "Show the macro corresponding to the given index." NL "\t\t\033[35mT16\033[0m Indexed Trigger Macro 0x10, \033[35mR12\033[0m Indexed Result Macro 0x0C", cliFunc_macroShow },
        { "macroStep",   "Do N macro processing steps. Defaults to 1.", cliFunc_macroStep },
        { 0, 0, 0 } // Null entry for dictionary end
 };
@@ -496,7 +496,27 @@ void cliFunc_macroDebug( char* args )
 
 void cliFunc_macroList( char* args )
 {
-       // TODO
+       // Show available trigger macro indices
+       print( NL );
+       info_msg("Trigger Macros Range: T0 -> T");
+       printInt16( (uint16_t)TriggerMacroNum - 1 ); // Hopefully large enough :P (can't assume 32-bit)
+
+       // Show available result macro indices
+       print( NL );
+       info_msg("Result  Macros Range: R0 -> R");
+       printInt16( (uint16_t)ResultMacroNum - 1 ); // Hopefully large enough :P (can't assume 32-bit)
+
+       // Show Trigger to Result Macro Links
+       print( NL );
+       info_msg("Trigger : Result Macro Pairs");
+       for ( unsigned int macro = 0; macro < TriggerMacroNum; macro++ )
+       {
+               print( NL );
+               print("\tT");
+               printInt16( (uint16_t)macro ); // Hopefully large enough :P (can't assume 32-bit)
+               print(" : R");
+               printInt16( (uint16_t)TriggerMacroList[ macro ].result ); // Hopefully large enough :P (can't assume 32-bit)
+       }
 }
 
 void cliFunc_macroProc( char* args )