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>
29 #include "scan_loop.h"
33 // ----- Defines -----
35 // TODO dfj defines...needs commenting and maybe some cleaning...
36 #define MAX_PRESS_DELTA_MV 450 // As measured from the Teensy ADC pin
37 #define THRESHOLD_MV (MAX_PRESS_DELTA_MV >> 1)
38 //(2560 / (0x3ff/2)) ~= 5
40 #define THRESHOLD (THRESHOLD_MV / MV_PER_ADC)
42 #define STROBE_SETTLE 1
46 #define RIGHT_JUSTIFY 0
47 #define LEFT_JUSTIFY (0xff)
49 // set left or right justification here:
50 #define JUSTIFY_ADC RIGHT_JUSTIFY
51 #define ADLAR_MASK (1 << ADLAR)
54 #define ADLAR_BITS ((ADLAR_MASK) & (JUSTIFY_ADC))
55 #else // defaults to right justification.
60 #define FULL_MUX_MASK ((1 << MUX0) | (1 << MUX1) | (1 << MUX2) | (1 << MUX3) | (1 << MUX4))
62 // F0-f7 pins only muxmask.
63 #define MUX_MASK ((1 << MUX0) | (1 << MUX1) | (1 << MUX2))
70 // set ADC clock prescale
71 #define PRESCALE_MASK ((1 << ADPS0) | (1 << ADPS1) | (1 << ADPS2))
72 #define PRESCALE_SHIFT (ADPS0)
75 // Max number of strobes supported by the hardware
76 // Strobe lines are detected at startup, extra strobes cause anomalies like phantom keypresses
77 #define MAX_STROBES 18
79 // Number of consecutive samples required to pass debounce
80 #define DEBOUNCE_THRESHOLD 5
83 #define MUXES_COUNT_XSHIFT 3
85 #define WARMUP_LOOPS ( 2048 )
86 #define WARMUP_STOP (WARMUP_LOOPS - 1)
88 #define SAMPLE_CONTROL 3
90 #define KEY_COUNT ((MAX_STROBES) * (MUXES_COUNT))
92 #define RECOVERY_CONTROL 1
93 #define RECOVERY_SOURCE 0
94 #define RECOVERY_SINK 2
99 // mix in 1/4 of the current average to the running average. -> (@mux_mix = 2)
102 #define IDLE_COUNT_MASK 0xff
103 #define IDLE_COUNT_SHIFT 8
105 // av = (av << shift) - av + sample; av >>= shift
106 // e.g. 1 -> (av + sample) / 2 simple average of new and old
107 // 2 -> (3 * av + sample) / 4 i.e. 3:1 mix of old to new.
108 // 3 -> (7 * av + sample) / 8 i.e. 7:1 mix of old to new.
109 #define KEYS_AVERAGES_MIX_SHIFT 3
113 // ----- Macros -----
116 #define SET_FULL_MUX(X) ((ADMUX) = (((ADMUX) & ~(FULL_MUX_MASK)) | ((X) & (FULL_MUX_MASK))))
120 // ----- Function Declarations -----
123 void cliFunc_avgDebug ( char* args );
124 void cliFunc_echo ( char* args );
125 void cliFunc_keyDebug ( char* args );
126 void cliFunc_pressDebug ( char* args );
127 void cliFunc_problemKeys( char* args );
128 void cliFunc_senseDebug ( char* args );
131 void dumpSenseTable();
133 // High-level Capsense Functions
135 void capsense_scan();
137 // Capsense Sense Functions
138 void testColumn ( uint8_t strobe );
139 void sampleColumn( uint8_t column );
141 // Low-level Capsense Functions
142 void strobe_w( uint8_t strobe_num );
143 void recovery( uint8_t on );
147 // ----- Variables -----
149 // Buffer used to inform the macro processing module which keys have been detected as pressed
150 volatile uint8_t KeyIndex_Buffer[KEYBOARD_BUFFER];
151 volatile uint8_t KeyIndex_BufferUsed;
154 // Scan Module command dictionary
155 char* scanCLIDictName = "DPH Module Commands";
156 CLIDictItem scanCLIDict[] = {
157 { "echo", "Example command, echos the arguments.", cliFunc_echo },
158 { "avgDebug", "Enables/Disables averaging results." NL "\t\tDisplays each average, starting from Key 0x00, ignoring 0 valued averages.", cliFunc_avgDebug },
159 { "keyDebug", "Enables/Disables long debug for each keypress." NL "\t\tkeycode - [strobe:mux] : sense val : threshold+delta=total : margin", cliFunc_keyDebug },
160 { "pressDebug", "Enables/Disables short debug for each keypress.", cliFunc_pressDebug },
161 { "problemKeys", "Display current list of problem keys,", cliFunc_problemKeys },
162 { "senseDebug", "Prints out the current sense table N times." NL "\t\tsense:max sense:delta", cliFunc_senseDebug },
163 { 0, 0, 0 } // Null entry for dictionary end
166 // CLI Control Variables
167 uint8_t enableAvgDebug = 0;
168 uint8_t enableKeyDebug = 0;
169 uint8_t enablePressDebug = 1;
170 uint8_t senseDebugCount = 3; // In order to get boot-time oddities
173 // Variables used to calculate the starting sense value (averaging)
174 uint32_t full_avg = 0;
175 uint32_t high_avg = 0;
176 uint32_t low_avg = 0;
178 uint8_t high_count = 0;
179 uint8_t low_count = 0;
182 uint16_t samples[MAX_STROBES][MUXES_COUNT]; // Overall table of cap sense ADC values
183 uint16_t sampleMax[MAX_STROBES][MUXES_COUNT]; // Records the max seen ADC value
185 uint8_t key_activity = 0; // Increments for each detected key per each full scan of the keyboard, it is reset before each full scan
186 uint8_t key_release = 0; // Indicates if going from key press state to release state (some keys pressed to no keys pressed)
188 uint16_t threshold = THRESHOLD;
190 uint16_t keys_averages_acc[KEY_COUNT];
191 uint16_t keys_averages [KEY_COUNT];
192 uint8_t keys_debounce [KEY_COUNT]; // Contains debounce statistics
193 uint8_t keys_problem [KEY_COUNT]; // Marks keys that should be ignored (determined by averaging at startup)
195 // TODO: change this to 'booting', then count down.
196 uint16_t boot_count = 0;
198 uint8_t total_strobes = MAX_STROBES;
199 uint8_t strobe_map[MAX_STROBES];
203 // ----- Functions -----
205 // Initial setup for cap sense controller
206 inline void Scan_setup()
208 // Register Scan CLI dictionary
209 CLI_registerDictionary( scanCLIDict, scanCLIDictName );
211 // Scan for active strobes
212 // NOTE1: On IBM PCBs, each strobe line that is *NOT* used is connected to GND.
213 // This means, the strobe GPIO can be set to Tri-State pull-up to detect which strobe lines are not used.
214 // NOTE2: This will *NOT* detect floating strobes.
215 // NOTE3: Rev 0.4, the strobe numbers are reversed, so D0 is actually strobe 0 and C7 is strobe 17
223 // Initially there are 0 strobes
226 // Iterate over each the strobes
227 for ( uint8_t strobe = 0; strobe < MAX_STROBES; strobe++ )
229 uint8_t detected = 0;
231 // If PIN is high, then strobe is *NOT* connected to GND and may be a strobe
238 #ifndef REV0_4_DEBUG // XXX These pins should be reworked, and connect to GND on Rev 0.4
248 detected = PIND & (1 << strobe);
253 detected = PINE & (1 << (strobe - 8));
262 #ifndef REV0_2_DEBUG // XXX If not using the 18 pin connector on Rev 0.2, rework these pins to GND
266 detected = PINC & (1 << (strobe - 10));
273 // Potential strobe line detected
276 strobe_map[total_strobes] = strobe;
281 // Setup Pins for Strobing
292 // Reset debounce table
293 for ( int i = 0; i < KEY_COUNT; ++i )
295 keys_debounce[i] = 0;
298 // Warm things up a bit before we start collecting data, taking real samples.
299 for ( uint8_t i = 0; i < total_strobes; ++i )
301 sampleColumn( strobe_map[i] );
306 // Main Detection Loop
307 // This is where the important stuff happens
308 inline uint8_t Scan_loop()
312 // Return non-zero if macro and USB processing should be delayed
313 // Macro processing will always run if returning 0
314 // USB processing only happens once the USB send timer expires, if it has not, Scan_loop will be called
315 // after the macro processing has been completed
320 // Signal KeyIndex_Buffer that it has been properly read
321 // NOTE: Only really required for implementing "tricks" in converters for odd protocols
322 void Scan_finishedWithBuffer( uint8_t sentKeys )
324 // Convenient place to clear the KeyIndex_Buffer
325 KeyIndex_BufferUsed = 0;
330 // Signal KeyIndex_Buffer that it has been properly read and sent out by the USB module
331 // NOTE: Only really required for implementing "tricks" in converters for odd protocols
332 void Scan_finishedWithUSBBuffer( uint8_t sentKeys )
338 inline void capsense_scan()
340 // Accumulated average used for the next scan
341 uint32_t cur_full_avg = 0;
342 uint32_t cur_high_avg = 0;
344 // Reset average counters
350 // Reset key activity, if there is no key activity, averages will accumulate for sense deltas, otherwise they will be reset
353 // Scan each of the mapped strobes in the matrix
354 for ( uint8_t strober = 0; strober < total_strobes; ++strober )
356 uint8_t map_strobe = strobe_map[strober];
358 // Sample the ADCs for the given column/strobe
359 sampleColumn( map_strobe );
361 // Only process sense data if warmup is finished
362 if ( boot_count >= WARMUP_LOOPS )
364 testColumn( map_strobe );
367 uint8_t strobe_line = map_strobe << MUXES_COUNT_XSHIFT;
368 for ( int mux = 0; mux < MUXES_COUNT; ++mux )
370 // discard sketchy low bit, and meaningless high bits.
371 uint8_t sample = samples[map_strobe][mux] >> 1;
372 keys_averages_acc[strobe_line + mux] += sample;
375 // Accumulate 3 total averages (used for determining starting average during warmup)
376 // full_avg - Average of all sampled lines on the previous scan set
377 // cur_full_avg - Average of all sampled lines for this scan set
378 // high_avg - Average of all sampled lines above full_avg on the previous scan set
379 // cur_high_avg - Average of all sampled lines above full_avg
380 // low_avg - Average of all sampled lines below or equal to full_avg
381 if ( boot_count < WARMUP_LOOPS )
383 for ( uint8_t mux = 0; mux < MUXES_COUNT; ++mux )
385 uint8_t sample = samples[map_strobe][mux] >> 1;
387 // Sample is high, add it to high avg
388 if ( sample > full_avg )
391 cur_high_avg += sample;
393 // Sample is low, add it to low avg
400 // If sample is higher than previous high_avg, then mark as "problem key"
401 keys_problem[strobe_line + mux] = sample > high_avg ? sample : 0;
403 // Prepare for next average
404 cur_full_avg += sample;
409 // Update total sense average (only during warm-up)
410 if ( boot_count < WARMUP_LOOPS )
412 full_avg = cur_full_avg / (total_strobes * MUXES_COUNT);
413 high_avg = cur_high_avg / high_count;
414 low_avg /= low_count;
416 // Update the base average value using the low_avg (best chance of not ignoring a keypress)
417 for ( int i = 0; i < KEY_COUNT; ++i )
419 keys_averages[i] = low_avg;
420 keys_averages_acc[i] = low_avg;
424 // Warm up voltage references
425 if ( boot_count < WARMUP_LOOPS )
429 switch ( boot_count )
433 // Show msg at first iteration only
434 info_msg("Warming up the voltage references");
446 info_msg("Warmup finished using ");
447 printInt16( WARMUP_LOOPS );
448 print(" iterations" NL );
450 // Display the final calculated averages of all the sensed strobes
451 info_msg("Full average (");
452 printInt8( total_strobes * MUXES_COUNT );
454 printHex( full_avg );
456 print(" High average (");
457 printInt8( high_count );
459 printHex( high_avg );
461 print(" Low average (");
462 printInt8( low_count );
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");
486 // No keypress, accumulate averages
490 if ( enableAvgDebug )
492 print("\033[1mAvg\033[0m: ");
496 for ( uint8_t i = 0; i < KEY_COUNT; ++i )
498 uint16_t acc = keys_averages_acc[i];
499 //uint16_t acc = keys_averages_acc[i] >> IDLE_COUNT_SHIFT; // XXX This fixes things... -HaaTa
500 uint32_t av = keys_averages[i];
502 av = (av << KEYS_AVERAGES_MIX_SHIFT) - av + acc;
503 av >>= KEYS_AVERAGES_MIX_SHIFT;
505 keys_averages[i] = av;
506 keys_averages_acc[i] = 0;
509 if ( enableAvgDebug && av > 0 )
517 if ( enableAvgDebug )
522 // No key presses detected, set key_release indicator
525 // Keypresses, reset accumulators
526 else if ( key_release )
528 for ( uint8_t c = 0; c < KEY_COUNT; ++c ) { keys_averages_acc[c] = 0; }
533 // If the debugging sense table is non-zero, display
534 if ( senseDebugCount > 0 )
546 // disable adc digital pins.
547 DIDR1 |= (1 << AIN0D) | (1<<AIN1D); // set disable on pins 1,0.
550 uint8_t mux = 0 & 0x1f; // 0 == first. // 0x1e = 1.1V ref.
552 // 0 = external aref 1,1 = 2.56V internal ref
553 uint8_t aref = ((1 << REFS1) | (1 << REFS0)) & ((1 << REFS1) | (1 << REFS0));
554 uint8_t adate = (1 << ADATE) & (1 << ADATE); // trigger enable
555 uint8_t trig = 0 & ((1 << ADTS0) | (1 << ADTS1) | (1 << ADTS2)); // 0 = free running
556 // ps2, ps1 := /64 ( 2^6 ) ps2 := /16 (2^4), ps1 := 4, ps0 :=2, PS1,PS0 := 8 (2^8)
557 uint8_t prescale = ( ((PRESCALE) << PRESCALE_SHIFT) & PRESCALE_MASK ); // 001 == 2^1 == 2
558 uint8_t hispeed = (1 << ADHSM);
559 uint8_t en_mux = (1 << ACME);
561 ADCSRA = (1 << ADEN) | prescale; // ADC enable
564 //ADMUX |= ((1 << REFS1) | (1 << REFS0)); // 2.56 V internal.
565 //ADMUX |= ((1 << REFS0) ); // Vcc with external cap.
566 //ADMUX &= ~((1 << REFS1) | (1 << REFS0)); // 0,0 : aref.
567 ADMUX = aref | mux | ADLAR_BITS;
570 ADCSRA |= adate; // trigger enable
571 ADCSRB = en_mux | hispeed | trig | (ADCSRB & ~((1 << ADTS0) | (1 << ADTS1) | (1 << ADTS2))); // trigger select free running
573 ADCSRA |= (1 << ADEN); // ADC enable
574 ADCSRA |= (1 << ADSC); // start conversions q
578 void recovery( uint8_t on )
580 DDRB |= (1 << RECOVERY_CONTROL);
581 PORTB &= ~(1 << RECOVERY_SINK); // SINK always zero
582 DDRB &= ~(1 << RECOVERY_SOURCE); // SOURCE high imp
586 // set strobes to sink to gnd.
595 DDRB |= (1 << RECOVERY_SINK); // SINK pull
596 PORTB |= (1 << RECOVERY_CONTROL);
597 PORTB |= (1 << RECOVERY_SOURCE); // SOURCE high
598 DDRB |= (1 << RECOVERY_SOURCE);
602 PORTB &= ~(1 << RECOVERY_CONTROL);
603 DDRB &= ~(1 << RECOVERY_SOURCE);
604 PORTB &= ~(1 << RECOVERY_SOURCE); // SOURCE low
605 DDRB &= ~(1 << RECOVERY_SINK); // SINK high-imp
610 void hold_sample( uint8_t on )
614 PORTB |= (1 << SAMPLE_CONTROL);
615 DDRB |= (1 << SAMPLE_CONTROL);
619 DDRB |= (1 << SAMPLE_CONTROL);
620 PORTB &= ~(1 << SAMPLE_CONTROL);
625 void strobe_w( uint8_t strobe_num )
632 // Not all strobes are used depending on which are detected
633 switch ( strobe_num )
636 case 0: PORTD |= (1 << 0); break;
637 case 1: PORTD |= (1 << 1); break;
638 case 2: PORTD |= (1 << 2); break;
639 case 3: PORTD |= (1 << 3); break;
640 case 4: PORTD |= (1 << 4); break;
641 case 5: PORTD |= (1 << 5); break;
642 case 6: PORTD |= (1 << 6); break;
643 case 7: PORTD |= (1 << 7); break;
645 case 8: PORTE |= (1 << 0); break;
646 case 9: PORTE |= (1 << 1); break;
648 case 10: PORTC |= (1 << 0); break;
649 case 11: PORTC |= (1 << 1); break;
650 case 12: PORTC |= (1 << 2); break;
651 case 13: PORTC |= (1 << 3); break;
652 case 14: PORTC |= (1 << 4); break;
653 case 15: PORTC |= (1 << 5); break;
654 case 16: PORTC |= (1 << 6); break;
655 case 17: PORTC |= (1 << 7); break;
663 inline uint16_t getADC(void)
665 ADCSRA |= (1 << ADIF); // clear int flag by writing 1.
667 //wait for last read to complete.
668 while ( !( ADCSRA & (1 << ADIF) ) );
670 return ADC; // return sample
674 void sampleColumn( uint8_t column )
676 // ensure all probe lines are driven low, and chill for recovery delay.
677 ADCSRA |= (1 << ADEN) | (1 << ADSC); // enable and start conversions
692 // Allow strobes to settle
693 for ( uint8_t i = 0; i < STROBE_SETTLE; ++i ) { getADC(); }
699 getADC(); // throw away; unknown mux.
701 SET_FULL_MUX( mux + 1 ); // our *next* sample will use this
703 // retrieve current read.
704 uint16_t readVal = getADC();
705 samples[column][mux] = readVal;
707 // Update max sense sample table
708 if ( readVal > sampleMax[column][mux] )
710 sampleMax[column][mux] = readVal;
721 ADCSRA &= ~(1 << ADEN);
723 // pull all columns' strobe-lines low.
734 void testColumn( uint8_t strobe )
736 uint16_t db_delta = 0;
737 uint8_t db_sample = 0;
738 uint16_t db_threshold = 0;
743 for ( uint8_t mux = 0; mux < MUXES_COUNT; ++mux )
745 uint16_t delta = keys_averages[(strobe << MUXES_COUNT_XSHIFT) + mux];
747 uint8_t key = (strobe << MUXES_COUNT_XSHIFT) + mux;
749 // Check if this is a bad key (e.g. test point, or non-existent key)
750 if ( keys_problem[key] )
752 // If the sample value of the problem key goes below full_avg (overall initial average)
754 if ( (db_sample = samples[strobe][mux] >> 1) < full_avg )
756 info_msg("Re-enabling problem key: ");
760 keys_problem[key] = 0;
763 // Do not waste any more cycles processing, regardless, a keypress cannot be detected
768 // db_sample (uint8_t), discard meaningless high bit, and garbage low bit
769 if ( (db_sample = samples[strobe][mux] >> 1) > (db_threshold = threshold) + (db_delta = delta) )
772 key_activity++; // No longer idle, stop averaging ADC data
774 // Only register keypresses once the warmup is complete, or not enough debounce info
775 if ( keys_debounce[key] <= DEBOUNCE_THRESHOLD )
777 // Add to the Macro processing buffer if debounce criteria met
778 // Automatically handles converting to a USB code and sending off to the PC
779 if ( keys_debounce[key] == DEBOUNCE_THRESHOLD )
781 // Debug message, pressDebug CLI
782 if ( enablePressDebug )
785 printHex_op( key, 2 );
789 // Only add the key to the buffer once
790 // NOTE: Buffer can easily handle multiple adds, just more efficient
791 // and nicer debug messages :P
792 //Macro_bufferAdd( key );
795 keys_debounce[key]++;
799 // Long form key debugging
800 if ( enableKeyDebug )
803 // <key> [<strobe>:<mux>] : <sense val> : <delta + threshold> : <margin>
805 printHex_op( key, 2 );
811 printHex( db_sample ); // Sense
813 printHex( db_threshold );
815 printHex( db_delta );
817 printHex( db_threshold + db_delta ); // Sense compare
819 printHex( db_sample - ( db_threshold + db_delta ) ); // Margin
823 // Clear debounce entry if no keypress detected
826 // If the key was previously pressed, remove from the buffer
827 for ( uint8_t c = 0; c < KeyIndex_BufferUsed; c++ )
829 // Key to release found
830 if ( KeyIndex_Buffer[c] == key )
832 // Shift keys from c position
833 for ( uint8_t k = c; k < KeyIndex_BufferUsed - 1; k++ )
834 KeyIndex_Buffer[k] = KeyIndex_Buffer[k + 1];
837 KeyIndex_BufferUsed--;
844 // Clear debounce entry
845 keys_debounce[key] = 0;
853 void dumpSenseTable()
855 // Initial table alignment, with base threshold used for every key
857 printHex( threshold );
860 // Print out headers first
861 for ( uint8_t mux = 0; mux < MUXES_COUNT; ++mux )
863 print(" Mux \033[1m");
870 // Display the full strobe/sense table
871 for ( uint8_t strober = 0; strober < total_strobes; ++strober )
873 uint8_t strobe = strobe_map[strober];
875 // Display the strobe
876 print("Strobe \033[1m");
880 // For each mux, display sense:threshold:delta
881 for ( uint8_t mux = 0; mux < MUXES_COUNT; ++mux )
883 uint8_t delta = keys_averages[(strobe << MUXES_COUNT_XSHIFT) + mux];
884 uint8_t sample = samples[strobe][mux] >> 1;
885 uint8_t max = sampleMax[strobe][mux] >> 1;
887 // Indicate if the key is being pressed by displaying green
888 if ( sample > delta + threshold )
893 printHex_op( sample, 2 );
895 printHex_op( max, 2 );
897 printHex_op( delta, 2 );
901 // New line for each strobe
907 // ----- CLI Command Functions -----
909 // XXX Just an example command showing how to parse arguments (more complex than generally needed)
910 void cliFunc_echo( char* args )
914 char* arg2Ptr = args;
916 // Parse args until a \0 is found
919 print( NL ); // No \r\n by default after the command is entered
921 curArgs = arg2Ptr; // Use the previous 2nd arg pointer to separate the next arg from the list
922 CLI_argumentIsolation( curArgs, &arg1Ptr, &arg2Ptr );
924 // Stop processing args if no more are found
925 if ( *arg1Ptr == '\0' )
933 void cliFunc_avgDebug( char* args )
937 // Args ignored, just toggling
938 if ( enableAvgDebug )
940 info_print("Cap Sense averaging debug disabled.");
945 info_print("Cap Sense averaging debug enabled.");
950 void cliFunc_keyDebug( char* args )
954 // Args ignored, just toggling
955 if ( enableKeyDebug )
957 info_print("Cap Sense key long debug disabled - pre debounce.");
962 info_print("Cap Sense key long debug enabled - pre debounce.");
967 void cliFunc_pressDebug( char* args )
971 // Args ignored, just toggling
972 if ( enablePressDebug )
974 info_print("Cap Sense key debug disabled - post debounce.");
975 enablePressDebug = 0;
979 info_print("Cap Sense key debug enabled - post debounce.");
980 enablePressDebug = 1;
984 void cliFunc_problemKeys( char* args )
990 // Args ignored, just displaying
991 // Display problem keys, and the sense value at the time
992 for ( uint8_t key = 0; key < KEY_COUNT; key++ )
994 if ( keys_problem[key] )
998 warn_msg("Problem keys: ");
1002 printHex( keys_problem[key] );
1008 void cliFunc_senseDebug( char* args )
1010 // Parse code from argument
1011 // NOTE: Only first argument is used
1014 CLI_argumentIsolation( args, &arg1Ptr, &arg2Ptr );
1016 // Default to a single print
1017 senseDebugCount = 1;
1019 // If there was an argument, use that instead
1020 if ( *arg1Ptr != '\0' )
1022 senseDebugCount = decToInt( arg1Ptr );