1 /* Copyright (C) 2011-2013 by Joseph Makuch
2 * Additions by Jacob Alexander (2013-2014)
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 3.0 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
18 // ----- Includes -----
21 #include <Lib/ScanLib.h>
30 #include "scan_loop.h"
34 // ----- Defines -----
36 // TODO dfj defines...needs commenting and maybe some cleaning...
37 #define MAX_PRESS_DELTA_MV 450 // As measured from the Teensy ADC pin
38 #define THRESHOLD_MV (MAX_PRESS_DELTA_MV >> 1)
39 //(2560 / (0x3ff/2)) ~= 5
41 #define THRESHOLD (THRESHOLD_MV / MV_PER_ADC)
43 #define STROBE_SETTLE 1
47 // Right justification of ADLAR
51 #define FULL_MUX_MASK ((1 << MUX0) | (1 << MUX1) | (1 << MUX2) | (1 << MUX3) | (1 << MUX4))
53 // F0-f7 pins only muxmask.
54 #define MUX_MASK ((1 << MUX0) | (1 << MUX1) | (1 << MUX2))
61 // set ADC clock prescale
62 #define PRESCALE_MASK ((1 << ADPS0) | (1 << ADPS1) | (1 << ADPS2))
63 #define PRESCALE_SHIFT (ADPS0)
66 // Max number of strobes supported by the hardware
67 // Strobe lines are detected at startup, extra strobes cause anomalies like phantom keypresses
68 #define MAX_STROBES 18
70 // Number of consecutive samples required to pass debounce
71 #define DEBOUNCE_THRESHOLD 5
73 // Scans to remain idle after all keys were release before starting averaging
74 // XXX So this makes the initial keypresses fast,
75 // but it's still possible to lose a keypress if you press at the wrong time -HaaTa
76 #define KEY_IDLE_SCANS 30000
78 // Total number of muxes/sense lines available
80 #define MUXES_COUNT_XSHIFT 3
82 // Number of warm-up loops before starting to scan keys
83 #define WARMUP_LOOPS ( 1024 )
84 #define WARMUP_STOP (WARMUP_LOOPS - 1)
86 #define SAMPLE_CONTROL 3
88 #define KEY_COUNT ((MAX_STROBES) * (MUXES_COUNT))
90 #define RECOVERY_CONTROL 1
91 #define RECOVERY_SOURCE 0
92 #define RECOVERY_SINK 2
97 // mix in 1/4 of the current average to the running average. -> (@mux_mix = 2)
100 #define IDLE_COUNT_SHIFT 8
102 // av = (av << shift) - av + sample; av >>= shift
103 // e.g. 1 -> (av + sample) / 2 simple average of new and old
104 // 2 -> (3 * av + sample) / 4 i.e. 3:1 mix of old to new.
105 // 3 -> (7 * av + sample) / 8 i.e. 7:1 mix of old to new.
106 #define KEYS_AVERAGES_MIX_SHIFT 3
110 // ----- Macros -----
113 #define SET_FULL_MUX(X) ((ADMUX) = (((ADMUX) & ~(FULL_MUX_MASK)) | ((X) & (FULL_MUX_MASK))))
117 // ----- Function Declarations -----
120 void cliFunc_avgDebug ( char* args );
121 void cliFunc_echo ( char* args );
122 void cliFunc_keyDebug ( char* args );
123 void cliFunc_pressDebug ( char* args );
124 void cliFunc_problemKeys( char* args );
125 void cliFunc_senseDebug ( char* args );
128 void dumpSenseTable();
130 // High-level Capsense Functions
132 void capsense_scan();
134 // Capsense Sense Functions
135 void testColumn ( uint8_t strobe );
136 void sampleColumn( uint8_t column );
138 // Low-level Capsense Functions
139 void strobe_w( uint8_t strobe_num );
140 void recovery( uint8_t on );
144 // ----- Variables -----
146 // Scan Module command dictionary
147 const char scanCLIDictName[] = "DPH Module Commands";
148 const CLIDictItem scanCLIDict[] = {
149 { "echo", "Example command, echos the arguments.", cliFunc_echo },
150 { "avgDebug", "Enables/Disables averaging results." NL "\t\tDisplays each average, starting from Key 0x00, ignoring 0 valued averages.", cliFunc_avgDebug },
151 { "keyDebug", "Enables/Disables long debug for each keypress." NL "\t\tkeycode - [strobe:mux] : sense val : threshold+delta=total : margin", cliFunc_keyDebug },
152 { "pressDebug", "Enables/Disables short debug for each keypress.", cliFunc_pressDebug },
153 { "problemKeys", "Display current list of problem keys,", cliFunc_problemKeys },
154 { "senseDebug", "Prints out the current sense table N times." NL "\t\tsense:max sense:delta", cliFunc_senseDebug },
155 { 0, 0, 0 } // Null entry for dictionary end
158 // CLI Control Variables
159 uint8_t enableAvgDebug = 0;
160 uint8_t enableKeyDebug = 0;
161 uint8_t enablePressDebug = 0;
162 uint8_t senseDebugCount = 3; // In order to get boot-time oddities
165 // Variables used to calculate the starting sense value (averaging)
166 uint32_t full_avg = 0;
167 uint32_t high_avg = 0;
168 uint32_t low_avg = 0;
170 uint8_t high_count = 0;
171 uint8_t low_count = 0;
174 uint16_t samples[MAX_STROBES][MUXES_COUNT]; // Overall table of cap sense ADC values
175 uint16_t sampleMax[MAX_STROBES][MUXES_COUNT]; // Records the max seen ADC value
177 uint8_t key_activity = 0; // Increments for each detected key per each full scan of the keyboard, it is reset before each full scan
178 uint16_t key_idle = 0; // Defines how scans after all keys were released before starting averaging again
179 uint8_t key_release = 0; // Indicates if going from key press state to release state (some keys pressed to no keys pressed)
181 uint16_t threshold = THRESHOLD;
183 uint16_t keys_averages_acc[KEY_COUNT];
184 uint16_t keys_averages [KEY_COUNT];
185 uint8_t keys_debounce [KEY_COUNT]; // Contains debounce statistics
186 uint8_t keys_problem [KEY_COUNT]; // Marks keys that should be ignored (determined by averaging at startup)
188 // TODO: change this to 'booting', then count down.
189 uint16_t boot_count = 0;
191 uint8_t total_strobes = MAX_STROBES;
192 uint8_t strobe_map[MAX_STROBES];
196 // ----- Functions -----
198 // Initial setup for cap sense controller
199 inline void Scan_setup()
201 // Register Scan CLI dictionary
202 CLI_registerDictionary( scanCLIDict, scanCLIDictName );
204 // Scan for active strobes
205 // NOTE1: On IBM PCBs, each strobe line that is *NOT* used is connected to GND.
206 // This means, the strobe GPIO can be set to Tri-State pull-up to detect which strobe lines are not used.
207 // NOTE2: This will *NOT* detect floating strobes.
208 // NOTE3: Rev 0.4, the strobe numbers are reversed, so D0 is actually strobe 0 and C7 is strobe 17
209 info_msg("Detecting Strobes...");
218 // Initially there are 0 strobes
221 // Iterate over each the strobes
222 for ( uint8_t strobe = 0; strobe < MAX_STROBES; strobe++ )
224 uint8_t detected = 0;
226 // If PIN is high, then strobe is *NOT* connected to GND and may be a strobe
233 #ifndef REV0_4_DEBUG // XXX These pins should be reworked, and connect to GND on Rev 0.4
243 detected = PIND & (1 << strobe);
248 detected = PINE & (1 << (strobe - 8));
257 #ifndef REV0_2_DEBUG // XXX If not using the 18 pin connector on Rev 0.2, rework these pins to GND
261 detected = PINC & (1 << (strobe - 10));
268 // Potential strobe line detected
271 strobe_map[total_strobes] = strobe;
276 printInt8( total_strobes );
277 print( " strobes found." NL );
279 // Setup Pins for Strobing
290 // Reset debounce table
291 for ( int i = 0; i < KEY_COUNT; ++i )
293 keys_debounce[i] = 0;
296 // Warm things up a bit before we start collecting data, taking real samples.
297 for ( uint8_t i = 0; i < total_strobes; ++i )
299 sampleColumn( strobe_map[i] );
304 // Main Detection Loop
305 // This is where the important stuff happens
306 inline uint8_t Scan_loop()
310 // Return non-zero if macro and USB processing should be delayed
311 // Macro processing will always run if returning 0
312 // USB processing only happens once the USB send timer expires, if it has not, Scan_loop will be called
313 // after the macro processing has been completed
318 // Signal from macro module that keys have been processed
319 // NOTE: Only really required for implementing "tricks" in converters for odd protocols
320 void Scan_finishedWithMacro( uint8_t sentKeys )
326 // Signal from output module that keys have been processed/sent
327 // NOTE: Only really required for implementing "tricks" in converters for odd protocols
328 void Scan_finishedWithOutput( uint8_t sentKeys )
334 inline void capsense_scan()
336 // Accumulated average used for the next scan
337 uint32_t cur_full_avg = 0;
338 uint32_t cur_high_avg = 0;
340 // Reset average counters
346 // Reset key activity, if there is no key activity, averages will accumulate for sense deltas, otherwise they will be reset
349 // Scan each of the mapped strobes in the matrix
350 for ( uint8_t strober = 0; strober < total_strobes; ++strober )
352 uint8_t map_strobe = strobe_map[strober];
354 // Sample the ADCs for the given column/strobe
355 sampleColumn( map_strobe );
357 // Only process sense data if warmup is finished
358 if ( boot_count >= WARMUP_LOOPS )
360 testColumn( map_strobe );
363 uint8_t strobe_line = map_strobe << MUXES_COUNT_XSHIFT;
364 for ( int mux = 0; mux < MUXES_COUNT; ++mux )
366 // discard sketchy low bit, and meaningless high bits.
367 uint8_t sample = samples[map_strobe][mux] >> 1;
368 keys_averages_acc[strobe_line + mux] += sample;
371 // Accumulate 3 total averages (used for determining starting average during warmup)
372 // full_avg - Average of all sampled lines on the previous scan set
373 // cur_full_avg - Average of all sampled lines for this scan set
374 // high_avg - Average of all sampled lines above full_avg on the previous scan set
375 // cur_high_avg - Average of all sampled lines above full_avg
376 // low_avg - Average of all sampled lines below or equal to full_avg
377 if ( boot_count < WARMUP_LOOPS )
379 for ( uint8_t mux = 0; mux < MUXES_COUNT; ++mux )
381 uint8_t sample = samples[map_strobe][mux] >> 1;
383 // Sample is high, add it to high avg
384 if ( sample > full_avg )
387 cur_high_avg += sample;
389 // Sample is low, add it to low avg
396 // If sample is higher than previous high_avg, then mark as "problem key"
397 // XXX Giving a bit more margin to pass (high_avg vs. high_avg + high_avg - full_avg) -HaaTa
398 keys_problem[strobe_line + mux] = sample > high_avg + (high_avg - full_avg) ? sample : 0;
400 // Prepare for next average
401 cur_full_avg += sample;
406 // Update total sense average (only during warm-up)
407 if ( boot_count < WARMUP_LOOPS )
409 full_avg = cur_full_avg / (total_strobes * MUXES_COUNT);
410 high_avg = cur_high_avg / high_count;
411 low_avg /= low_count;
413 // Update the base average value using the low_avg (best chance of not ignoring a keypress)
414 for ( int i = 0; i < KEY_COUNT; ++i )
416 keys_averages[i] = low_avg;
417 keys_averages_acc[i] = low_avg;
421 // Warm up voltage references
422 if ( boot_count < WARMUP_LOOPS )
426 switch ( boot_count )
430 // Show msg at first iteration only
431 info_msg("Warming up the voltage references");
443 info_msg("Warmup finished using ");
444 printInt16( WARMUP_LOOPS );
445 print(" iterations" NL );
447 // Display the final calculated averages of all the sensed strobes
448 info_msg("Full average (");
449 printInt8( total_strobes * MUXES_COUNT );
451 printHex( full_avg );
453 print(" High average (");
454 printInt8( high_count );
456 printHex( high_avg );
458 print(" Low average (");
459 printInt8( low_count );
463 print(" Rejection threshold: ");
464 printHex( high_avg + (high_avg - full_avg) );
467 // Display problem keys, and the sense value at the time
468 for ( uint8_t key = 0; key < KEY_COUNT; key++ )
470 if ( keys_problem[key] )
472 warn_msg("Problem key detected: ");
475 printHex( keys_problem[key] );
480 info_print("If problem keys were detected, and were being held down, they will be reset as soon as let go.");
481 info_print("Some keys have unusually high sense values, on the first press they should be re-enabled.");
487 // No keypress, accumulate averages
490 // Only start averaging once the idle counter has counted down to 0
494 if ( enableAvgDebug )
496 print("\033[1mAvg\033[0m: ");
500 for ( uint8_t i = 0; i < KEY_COUNT; ++i )
502 uint16_t acc = keys_averages_acc[i];
503 //uint16_t acc = keys_averages_acc[i] >> IDLE_COUNT_SHIFT; // XXX This fixes things... -HaaTa
504 uint32_t av = keys_averages[i];
506 av = (av << KEYS_AVERAGES_MIX_SHIFT) - av + acc;
507 av >>= KEYS_AVERAGES_MIX_SHIFT;
509 keys_averages[i] = av;
510 keys_averages_acc[i] = 0;
513 if ( enableAvgDebug && av > 0 )
521 if ( enableAvgDebug )
526 // No key presses detected, set key_release indicator
529 // Otherwise decrement the idle counter
535 // Keypresses, reset accumulators
536 else if ( key_release )
538 for ( uint8_t c = 0; c < KEY_COUNT; ++c ) { keys_averages_acc[c] = 0; }
543 // If the debugging sense table is non-zero, display
544 if ( senseDebugCount > 0 )
556 // disable adc digital pins.
557 DIDR1 |= (1 << AIN0D) | (1<<AIN1D); // set disable on pins 1,0.
560 uint8_t mux = 0 & 0x1f; // 0 == first. // 0x1e = 1.1V ref.
562 // 0 = external aref 1,1 = 2.56V internal ref
563 uint8_t aref = ((1 << REFS1) | (1 << REFS0)) & ((1 << REFS1) | (1 << REFS0));
564 uint8_t adate = (1 << ADATE) & (1 << ADATE); // trigger enable
565 uint8_t trig = 0 & ((1 << ADTS0) | (1 << ADTS1) | (1 << ADTS2)); // 0 = free running
566 // ps2, ps1 := /64 ( 2^6 ) ps2 := /16 (2^4), ps1 := 4, ps0 :=2, PS1,PS0 := 8 (2^8)
567 uint8_t prescale = ( ((PRESCALE) << PRESCALE_SHIFT) & PRESCALE_MASK ); // 001 == 2^1 == 2
568 uint8_t hispeed = (1 << ADHSM);
569 uint8_t en_mux = (1 << ACME);
571 ADCSRA = (1 << ADEN) | prescale; // ADC enable
574 //ADMUX |= ((1 << REFS1) | (1 << REFS0)); // 2.56 V internal.
575 //ADMUX |= ((1 << REFS0) ); // Vcc with external cap.
576 //ADMUX &= ~((1 << REFS1) | (1 << REFS0)); // 0,0 : aref.
577 ADMUX = aref | mux | ADLAR_BITS;
580 ADCSRA |= adate; // trigger enable
581 ADCSRB = en_mux | hispeed | trig | (ADCSRB & ~((1 << ADTS0) | (1 << ADTS1) | (1 << ADTS2))); // trigger select free running
583 ADCSRA |= (1 << ADEN); // ADC enable
584 ADCSRA |= (1 << ADSC); // start conversions q
588 void recovery( uint8_t on )
590 DDRB |= (1 << RECOVERY_CONTROL);
591 PORTB &= ~(1 << RECOVERY_SINK); // SINK always zero
592 DDRB &= ~(1 << RECOVERY_SOURCE); // SOURCE high imp
596 // set strobes to sink to gnd.
605 DDRB |= (1 << RECOVERY_SINK); // SINK pull
606 PORTB |= (1 << RECOVERY_CONTROL);
607 PORTB |= (1 << RECOVERY_SOURCE); // SOURCE high
608 DDRB |= (1 << RECOVERY_SOURCE);
612 PORTB &= ~(1 << RECOVERY_CONTROL);
613 DDRB &= ~(1 << RECOVERY_SOURCE);
614 PORTB &= ~(1 << RECOVERY_SOURCE); // SOURCE low
615 DDRB &= ~(1 << RECOVERY_SINK); // SINK high-imp
620 void hold_sample( uint8_t on )
624 PORTB |= (1 << SAMPLE_CONTROL);
625 DDRB |= (1 << SAMPLE_CONTROL);
629 DDRB |= (1 << SAMPLE_CONTROL);
630 PORTB &= ~(1 << SAMPLE_CONTROL);
635 void strobe_w( uint8_t strobe_num )
642 // Not all strobes are used depending on which are detected
643 switch ( strobe_num )
646 case 0: PORTD |= (1 << 0); break;
647 case 1: PORTD |= (1 << 1); break;
648 case 2: PORTD |= (1 << 2); break;
649 case 3: PORTD |= (1 << 3); break;
650 case 4: PORTD |= (1 << 4); break;
651 case 5: PORTD |= (1 << 5); break;
652 case 6: PORTD |= (1 << 6); break;
653 case 7: PORTD |= (1 << 7); break;
655 case 8: PORTE |= (1 << 0); break;
656 case 9: PORTE |= (1 << 1); break;
658 case 10: PORTC |= (1 << 0); break;
659 case 11: PORTC |= (1 << 1); break;
660 case 12: PORTC |= (1 << 2); break;
661 case 13: PORTC |= (1 << 3); break;
662 case 14: PORTC |= (1 << 4); break;
663 case 15: PORTC |= (1 << 5); break;
664 case 16: PORTC |= (1 << 6); break;
665 case 17: PORTC |= (1 << 7); break;
673 inline uint16_t getADC(void)
675 ADCSRA |= (1 << ADIF); // clear int flag by writing 1.
677 //wait for last read to complete.
678 while ( !( ADCSRA & (1 << ADIF) ) );
680 return ADC; // return sample
684 void sampleColumn( uint8_t column )
686 // ensure all probe lines are driven low, and chill for recovery delay.
687 ADCSRA |= (1 << ADEN) | (1 << ADSC); // enable and start conversions
702 // Allow strobes to settle
703 for ( uint8_t i = 0; i < STROBE_SETTLE; ++i ) { getADC(); }
709 getADC(); // throw away; unknown mux.
711 SET_FULL_MUX( mux + 1 ); // our *next* sample will use this
713 // retrieve current read.
714 uint16_t readVal = getADC();
715 samples[column][mux] = readVal;
717 // Update max sense sample table
718 if ( readVal > sampleMax[column][mux] )
720 sampleMax[column][mux] = readVal;
731 ADCSRA &= ~(1 << ADEN);
733 // pull all columns' strobe-lines low.
744 void testColumn( uint8_t strobe )
746 uint16_t db_delta = 0;
747 uint8_t db_sample = 0;
748 uint16_t db_threshold = 0;
753 for ( uint8_t mux = 0; mux < MUXES_COUNT; ++mux )
755 uint16_t delta = keys_averages[(strobe << MUXES_COUNT_XSHIFT) + mux];
757 uint8_t key = (strobe << MUXES_COUNT_XSHIFT) + mux;
759 // Check if this is a bad key (e.g. test point, or non-existent key)
760 if ( keys_problem[key] )
762 // If the sample value of the problem key goes above initally recorded result + threshold
764 if ( (db_sample = samples[strobe][mux] >> 1) > keys_problem[key] + threshold )
765 //if ( (db_sample = samples[strobe][mux] >> 1) < high_avg )
767 info_msg("Re-enabling problem key: ");
771 keys_problem[key] = 0;
774 // Do not waste any more cycles processing, regardless, a keypress cannot be detected
779 // db_sample (uint8_t), discard meaningless high bit, and garbage low bit
780 if ( (db_sample = samples[strobe][mux] >> 1) > (db_threshold = threshold) + (db_delta = delta) )
783 key_activity++; // No longer idle, stop averaging ADC data
784 key_idle = KEY_IDLE_SCANS; // Reset idle count-down
786 // Only register keypresses once the warmup is complete, or not enough debounce info
787 if ( keys_debounce[key] <= DEBOUNCE_THRESHOLD )
789 // Add to the Macro processing buffer if debounce criteria met
790 // Automatically handles converting to a USB code and sending off to the PC
791 if ( keys_debounce[key] == DEBOUNCE_THRESHOLD )
793 // Debug message, pressDebug CLI
794 if ( enablePressDebug )
797 printHex_op( key, 2 );
802 Macro_keyState( key, 0x01 );
805 keys_debounce[key]++;
808 else if ( keys_debounce[key] >= DEBOUNCE_THRESHOLD )
811 Macro_keyState( key, 0x02 );
814 // Long form key debugging
815 if ( enableKeyDebug )
818 // <key> [<strobe>:<mux>] : <sense val> : <delta + threshold> : <margin>
820 printHex_op( key, 1 );
826 printHex( db_sample ); // Sense
828 printHex( db_threshold );
830 printHex( db_delta );
832 printHex( db_threshold + db_delta ); // Sense compare
834 printHex( db_sample - ( db_threshold + db_delta ) ); // Margin
838 // Clear debounce entry if no keypress detected
842 if ( keys_debounce[key] >= DEBOUNCE_THRESHOLD )
844 Macro_keyState( key, 0x03 );
847 // Clear debounce entry
848 keys_debounce[key] = 0;
856 void dumpSenseTable()
858 // Initial table alignment, with base threshold used for every key
860 printHex( threshold );
863 // Print out headers first
864 for ( uint8_t mux = 0; mux < MUXES_COUNT; ++mux )
866 print(" Mux \033[1m");
873 // Display the full strobe/sense table
874 for ( uint8_t strober = 0; strober < total_strobes; ++strober )
876 uint8_t strobe = strobe_map[strober];
878 // Display the strobe
879 print("Strobe \033[1m");
883 // For each mux, display sense:threshold:delta
884 for ( uint8_t mux = 0; mux < MUXES_COUNT; ++mux )
886 uint8_t delta = keys_averages[(strobe << MUXES_COUNT_XSHIFT) + mux];
887 uint8_t sample = samples[strobe][mux] >> 1;
888 uint8_t max = sampleMax[strobe][mux] >> 1;
890 // Indicate if the key is being pressed by displaying green
891 if ( sample > delta + threshold )
896 printHex_op( sample, 2 );
898 printHex_op( max, 2 );
900 printHex_op( delta, 2 );
904 // New line for each strobe
910 // ----- CLI Command Functions -----
912 // XXX Just an example command showing how to parse arguments (more complex than generally needed)
913 void cliFunc_echo( char* args )
917 char* arg2Ptr = args;
919 // Parse args until a \0 is found
922 print( NL ); // No \r\n by default after the command is entered
924 curArgs = arg2Ptr; // Use the previous 2nd arg pointer to separate the next arg from the list
925 CLI_argumentIsolation( curArgs, &arg1Ptr, &arg2Ptr );
927 // Stop processing args if no more are found
928 if ( *arg1Ptr == '\0' )
936 void cliFunc_avgDebug( char* args )
940 // Args ignored, just toggling
941 if ( enableAvgDebug )
943 info_print("Cap Sense averaging debug disabled.");
948 info_print("Cap Sense averaging debug enabled.");
953 void cliFunc_keyDebug( char* args )
957 // Args ignored, just toggling
958 if ( enableKeyDebug )
960 info_print("Cap Sense key long debug disabled - pre debounce.");
965 info_print("Cap Sense key long debug enabled - pre debounce.");
970 void cliFunc_pressDebug( char* args )
974 // Args ignored, just toggling
975 if ( enablePressDebug )
977 info_print("Cap Sense key debug disabled - post debounce.");
978 enablePressDebug = 0;
982 info_print("Cap Sense key debug enabled - post debounce.");
983 enablePressDebug = 1;
987 void cliFunc_problemKeys( char* args )
993 // Args ignored, just displaying
994 // Display problem keys, and the sense value at the time
995 for ( uint8_t key = 0; key < KEY_COUNT; key++ )
997 if ( keys_problem[key] )
1001 warn_msg("Problem keys: ");
1005 printHex( keys_problem[key] );
1011 void cliFunc_senseDebug( char* args )
1013 // Parse code from argument
1014 // NOTE: Only first argument is used
1017 CLI_argumentIsolation( args, &arg1Ptr, &arg2Ptr );
1019 // Default to a single print
1020 senseDebugCount = 1;
1022 // If there was an argument, use that instead
1023 if ( *arg1Ptr != '\0' )
1025 senseDebugCount = numToInt( arg1Ptr );