# HG changeset patch # User Jacob Alexander # Date 1458701503 25200 # Node ID 7bc4c6249dff8f868fb6db0ebda2068a1b27fc71 # Parent d3cef419c84965d59c62bc7cc1e5fca99eeb4b42 Move matrix information to a cli command diff -r d3cef419c849 -r 7bc4c6249dff Scan/MatrixARM/matrix_scan.c --- a/Scan/MatrixARM/matrix_scan.c Mon Mar 21 22:23:57 2016 -0700 +++ b/Scan/MatrixARM/matrix_scan.c Tue Mar 22 19:51:43 2016 -0700 @@ -52,6 +52,7 @@ // CLI Functions void cliFunc_matrixDebug( char* args ); +void cliFunc_matrixInfo( char* args ); void cliFunc_matrixState( char* args ); @@ -60,10 +61,12 @@ // Scan Module command dictionary CLIDict_Entry( matrixDebug, "Enables matrix debug mode, prints out each scan code." NL "\t\tIf argument \033[35mT\033[0m is given, prints out each scan code state transition." ); +CLIDict_Entry( matrixInfo, "Print info about the configured matrix." ); CLIDict_Entry( matrixState, "Prints out the current scan table N times." NL "\t\t \033[1mO\033[0m - Off, \033[1;33mP\033[0m - Press, \033[1;32mH\033[0m - Hold, \033[1;35mR\033[0m - Release, \033[1;31mI\033[0m - Invalid" ); CLIDict_Def( matrixCLIDict, "Matrix Module Commands" ) = { CLIDict_Item( matrixDebug ), + CLIDict_Item( matrixInfo ), CLIDict_Item( matrixState ), { 0, 0, 0 } // Null entry for dictionary end }; @@ -204,30 +207,18 @@ // Register Matrix CLI dictionary CLI_registerDictionary( matrixCLIDict, matrixCLIDictName ); - info_msg("Columns: "); - printHex( Matrix_colsNum ); - // Setup Strobe Pins for ( uint8_t pin = 0; pin < Matrix_colsNum; pin++ ) { Matrix_pin( Matrix_cols[ pin ], Type_StrobeSetup ); } - print( NL ); - info_msg("Rows: "); - printHex( Matrix_rowsNum ); - // Setup Sense Pins for ( uint8_t pin = 0; pin < Matrix_rowsNum; pin++ ) { Matrix_pin( Matrix_rows[ pin ], Type_SenseSetup ); } - print( NL ); - info_msg("Max Keys: "); - printHex( Matrix_maxKeys ); - print( NL ); - // Clear out Debounce Array for ( uint8_t item = 0; item < Matrix_maxKeys; item++ ) { @@ -598,7 +589,22 @@ // ----- CLI Command Functions ----- -void cliFunc_matrixDebug ( char* args ) +void cliFunc_matrixInfo( char* args ) +{ + print( NL ); + info_msg("Columns: "); + printHex( Matrix_colsNum ); + + print( NL ); + info_msg("Rows: "); + printHex( Matrix_rowsNum ); + + print( NL ); + info_msg("Max Keys: "); + printHex( Matrix_maxKeys ); +} + +void cliFunc_matrixDebug( char* args ) { // Parse number from argument // NOTE: Only first argument is used @@ -632,7 +638,7 @@ printInt8( matrixDebugMode ); } -void cliFunc_matrixState ( char* args ) +void cliFunc_matrixState( char* args ) { // Parse number from argument // NOTE: Only first argument is used