Adding more USB codes and code cleanup
This commit is contained in:
parent
61e45985c2
commit
909f20a937
@ -39,6 +39,10 @@
|
|||||||
#define KEY_RIGHT_GUI 0x80
|
#define KEY_RIGHT_GUI 0x80
|
||||||
|
|
||||||
// List of Keycodes
|
// List of Keycodes
|
||||||
|
#define KEY_NOEVENT 0 // Event, not a physical key
|
||||||
|
#define KEY_ERRORROLLOVER 1 // Event, not a physical key
|
||||||
|
#define KEY_POSTFAIL 2 // Event, not a physical key
|
||||||
|
#define KEY_ERRORUNDEFINED 3 // Event, not a physical key
|
||||||
#define KEY_A 4
|
#define KEY_A 4
|
||||||
#define KEY_B 5
|
#define KEY_B 5
|
||||||
#define KEY_C 6
|
#define KEY_C 6
|
||||||
|
@ -217,7 +217,7 @@ inline void scan_setup()
|
|||||||
//#define TERMINAL_6110668_STROBE
|
//#define TERMINAL_6110668_STROBE
|
||||||
//#define UNSAVER_STROBE
|
//#define UNSAVER_STROBE
|
||||||
#ifdef KISHSAVER_STROBE
|
#ifdef KISHSAVER_STROBE
|
||||||
total_strobes = 8;
|
total_strobes = 9;
|
||||||
|
|
||||||
strobe_map[0] = 2; // Kishsaver doesn't use strobe 0 and 1
|
strobe_map[0] = 2; // Kishsaver doesn't use strobe 0 and 1
|
||||||
strobe_map[1] = 3;
|
strobe_map[1] = 3;
|
||||||
@ -227,8 +227,6 @@ inline void scan_setup()
|
|||||||
strobe_map[5] = 7;
|
strobe_map[5] = 7;
|
||||||
strobe_map[6] = 8;
|
strobe_map[6] = 8;
|
||||||
strobe_map[7] = 9;
|
strobe_map[7] = 9;
|
||||||
// XXX - Disabling for now, not sure how to deal with test points yet (without spamming the debug)
|
|
||||||
total_strobes = 9;
|
|
||||||
strobe_map[8] = 15; // Test point strobe (3 test points, sense 1, 4, 5)
|
strobe_map[8] = 15; // Test point strobe (3 test points, sense 1, 4, 5)
|
||||||
#elif defined(TERMINAL_6110668_STROBE)
|
#elif defined(TERMINAL_6110668_STROBE)
|
||||||
total_strobes = 16;
|
total_strobes = 16;
|
||||||
@ -742,30 +740,31 @@ int sampleColumn_8x( uint8_t column, uint16_t * buffer )
|
|||||||
PORTF = 0;
|
PORTF = 0;
|
||||||
DDRF = 0;
|
DDRF = 0;
|
||||||
|
|
||||||
recovery(OFF);
|
recovery( OFF );
|
||||||
strobe_w(column);
|
strobe_w( column );
|
||||||
|
|
||||||
hold_sample(OFF);
|
hold_sample( OFF );
|
||||||
SET_FULL_MUX(0);
|
SET_FULL_MUX( 0 );
|
||||||
|
|
||||||
|
// Allow strobes to settle
|
||||||
for ( uint8_t i = 0; i < STROBE_SETTLE; ++i ) { getADC(); }
|
for ( uint8_t i = 0; i < STROBE_SETTLE; ++i ) { getADC(); }
|
||||||
|
|
||||||
hold_sample(ON);
|
hold_sample( ON );
|
||||||
|
|
||||||
uint8_t mux = 0;
|
uint8_t mux = 0;
|
||||||
SET_FULL_MUX(mux);
|
SET_FULL_MUX( mux );
|
||||||
getADC(); // throw away; unknown mux.
|
getADC(); // throw away; unknown mux.
|
||||||
do {
|
do {
|
||||||
SET_FULL_MUX(mux + 1); // our *next* sample will use this
|
SET_FULL_MUX( mux + 1 ); // our *next* sample will use this
|
||||||
|
|
||||||
// retrieve current read.
|
// retrieve current read.
|
||||||
buffer[mux] = getADC();
|
buffer[mux] = getADC();
|
||||||
mux++;
|
mux++;
|
||||||
|
|
||||||
} while (mux < 8);
|
} while ( mux < 8 );
|
||||||
|
|
||||||
hold_sample(OFF);
|
hold_sample( OFF );
|
||||||
recovery(ON);
|
recovery( ON );
|
||||||
|
|
||||||
// turn off adc.
|
// turn off adc.
|
||||||
ADCSRA &= ~(1 << ADEN);
|
ADCSRA &= ~(1 << ADEN);
|
||||||
|
Reference in New Issue
Block a user