Mercurial > louis > kiibohd-controller
changeset 431:7bc4c6249dff
Move matrix information to a cli command
author | Jacob Alexander <haata@kiibohd.com> |
---|---|
date | Tue, 22 Mar 2016 19:51:43 -0700 |
parents | d3cef419c849 |
children | 1a2fb67b0237 eae9fd6acc9a |
files | Scan/MatrixARM/matrix_scan.c |
diffstat | 1 files changed, 20 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- 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