-// Initial Pin Setup
-// If the matrix is properly set, this function does not need to be changed
-inline void pinSetup(void)
-{
- // For each pin, 0=input, 1=output
- DDRA = 0x00;
- DDRB = 0x00;
- DDRC = 0x00;
- DDRD = 0x40; // LED Setup
- DDRE = 0x00;
- DDRF = 0x00;
-
-
- // Setting pins to either high or pull-up resistor
- PORTA = 0x00;
- PORTB = 0x00;
- PORTC = 0x00;
- PORTD = 0x40; // LED Enable
- PORTE = 0x00;
- PORTF = 0x00;
-}
-
-int main( void )
-{
- // Setup with 16 MHz clock
- CPU_PRESCALE( 0 );
-
- // Configuring Pins
- pinSetup();
-
- // Initialize the USB, and then wait for the host to set configuration.
- // If the Teensy is powered without a PC connected to the USB port,
- // this will wait forever.
- usb_init();
- while ( !usb_configured() ) /* wait */ ;
-
- // Wait an extra second for the PC's operating system to load drivers
- // and do whatever it does to actually be ready for input
- _delay_ms(1000);
-
- // Setup ISR Timer for flagging a kepress send to USB
- // Set to 256 * 1024 (8 bit timer with Clock/1024 prescalar) timer
- TCCR0A = 0x00;
- TCCR0B = 0x03;
- TIMSK0 = (1 << TOIE0);
-
- uint16_t led = 0;