@ -99,12 +99,6 @@ void SetupHardware(void)
/* Hardware Initialization */
/* Hardware Initialization */
Magstripe_Init ( ) ;
Magstripe_Init ( ) ;
USB_Init ( ) ;
USB_Init ( ) ;
/* Millisecond timer initialization, with output compare interrupt enabled for the idle timing */
OCR0A = ( ( F_CPU / 64 ) / 1000 ) ;
TCCR0A = ( 1 < < WGM01 ) ;
TCCR0B = ( ( 1 < < CS01 ) | ( 1 < < CS00 ) ) ;
TIMSK0 = ( 1 < < OCIE0A ) ;
}
}
/** Determines if a card has been inserted, and if so reads in each track's contents into the bit buffers
/** Determines if a card has been inserted, and if so reads in each track's contents into the bit buffers
@ -148,6 +142,8 @@ void ReadMagstripeData(void)
void EVENT_USB_Device_ConfigurationChanged ( void )
void EVENT_USB_Device_ConfigurationChanged ( void )
{
{
HID_Device_ConfigureEndpoints ( & Keyboard_HID_Interface ) ;
HID_Device_ConfigureEndpoints ( & Keyboard_HID_Interface ) ;
USB_Device_EnableSOFEvents ( ) ;
}
}
/** Event handler for the library USB Unhandled Control Packet event. */
/** Event handler for the library USB Unhandled Control Packet event. */
@ -156,8 +152,8 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
HID_Device_ProcessControlRequest ( & Keyboard_HID_Interface ) ;
HID_Device_ProcessControlRequest ( & Keyboard_HID_Interface ) ;
}
}
/** Timer 0 CTC ISR, firing once each millisecond to keep track of elapsed idle time in the HID interface . */
/** Event handler for the USB device Start Of Frame event . */
ISR ( TIMER0_COMPA_vect , ISR_BLOCK )
void EVENT_USB_Device_StartOfFrame ( void )
{
{
HID_Device_MillisecondElapsed ( & Keyboard_HID_Interface ) ;
HID_Device_MillisecondElapsed ( & Keyboard_HID_Interface ) ;
}
}