@ -141,6 +141,7 @@ void SetupHardware(void)
clock_prescale_set ( clock_div_1 ) ;
clock_prescale_set ( clock_div_1 ) ;
/* Hardware Initialization */
/* Hardware Initialization */
Serial_Init ( 9600 , false ) ;
LEDs_Init ( ) ;
LEDs_Init ( ) ;
USB_Init ( ) ;
USB_Init ( ) ;
@ -165,17 +166,17 @@ void EVENT_USB_Device_Connect(void)
void EVENT_USB_Device_Disconnect ( void )
void EVENT_USB_Device_Disconnect ( void )
{
{
PingPongMSRemaining = 0 ;
PingPongMSRemaining = 0 ;
LEDs_ TurnOffLEDs( LEDMASK_BUSY ) ;
LEDs_ SetAllLEDs( LEDS_NO_LEDS ) ;
}
}
/** Event handler for the library USB Configuration Changed event. */
/** Event handler for the library USB Configuration Changed event. */
void EVENT_USB_Device_ConfigurationChanged ( void )
void EVENT_USB_Device_ConfigurationChanged ( void )
{
{
PingPongMSRemaining = 0 ;
PingPongMSRemaining = 0 ;
LEDs_ TurnOffLEDs( LEDMASK_BUSY ) ;
LEDs_ SetAllLEDs( LEDS_NO_LEDS ) ;
if ( ! ( CDC_Device_ConfigureEndpoints ( & VirtualSerial_CDC_Interface ) ) )
if ( ! ( CDC_Device_ConfigureEndpoints ( & VirtualSerial_CDC_Interface ) ) )
LEDs_ TurnOn LEDs( LEDMASK_ERROR ) ;
LEDs_ SetAll LEDs( LEDMASK_ERROR ) ;
}
}
/** Event handler for the library USB Unhandled Control Request event. */
/** Event handler for the library USB Unhandled Control Request event. */
@ -233,7 +234,7 @@ void EVENT_CDC_Device_ControLineStateChanged(USB_ClassInfo_CDC_Device_t* const C
/* Check if the DTR line has been asserted - if so, start the target AVR's reset pulse */
/* Check if the DTR line has been asserted - if so, start the target AVR's reset pulse */
if ( CDCInterfaceInfo - > State . ControlLineStates . HostToDevice & CDC_CONTROL_LINE_OUT_DTR )
if ( CDCInterfaceInfo - > State . ControlLineStates . HostToDevice & CDC_CONTROL_LINE_OUT_DTR )
{
{
LEDs_ TurnOn LEDs( LEDMASK_BUSY ) ;
LEDs_ SetAll LEDs( LEDMASK_BUSY ) ;
AVR_RESET_LINE_DDR | = AVR_RESET_LINE_MASK ;
AVR_RESET_LINE_DDR | = AVR_RESET_LINE_MASK ;
ResetPulseMSRemaining = AVR_RESET_PULSE_MS ;
ResetPulseMSRemaining = AVR_RESET_PULSE_MS ;