Porting updates for the UC3B architecture - get UC3B partially enumerating using...
[pub/USBasp.git] / Demos / Host / ClassDriver / PrinterHost / PrinterHost.c
index ebcf0b8..8d51165 100644 (file)
@@ -52,6 +52,7 @@ USB_ClassInfo_PRNT_Host_t Printer_PRNT_Interface =
                        },
        };
 
                        },
        };
 
+
 /** Main program entry point. This routine configures the hardware required by the application, then
  *  enters a loop to run the application tasks in sequence.
  */
 /** Main program entry point. This routine configures the hardware required by the application, then
  *  enters a loop to run the application tasks in sequence.
  */
@@ -134,7 +135,7 @@ int main(void)
 
                                printf_P(PSTR("Sending Test Page (%d bytes)...\r\n"), TestPageLength);
 
 
                                printf_P(PSTR("Sending Test Page (%d bytes)...\r\n"), TestPageLength);
 
-                               if (PRNT_Host_SendString(&Printer_PRNT_Interface, &TestPageData, TestPageLength) != PIPE_RWSTREAM_NoError)
+                               if (PRNT_Host_SendData(&Printer_PRNT_Interface, &TestPageData, TestPageLength) != PIPE_RWSTREAM_NoError)
                                {
                                        puts_P(PSTR("Error Sending Page Data.\r\n"));
                                        LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
                                {
                                        puts_P(PSTR("Error Sending Page Data.\r\n"));
                                        LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
@@ -165,9 +166,12 @@ void SetupHardware(void)
        clock_prescale_set(clock_div_1);
 
        /* Hardware Initialization */
        clock_prescale_set(clock_div_1);
 
        /* Hardware Initialization */
-       SerialStream_Init(9600, false);
+       Serial_Init(9600, false);
        LEDs_Init();
        USB_Init();
        LEDs_Init();
        USB_Init();
+
+       /* Create a stdio stream for the serial port for stdin and stdout */
+       Serial_CreateStream(NULL);
 }
 
 /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
 }
 
 /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
@@ -199,7 +203,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
 void EVENT_USB_Host_HostError(const uint8_t ErrorCode)
 {
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
 void EVENT_USB_Host_HostError(const uint8_t ErrorCode)
 {
-       USB_ShutDown();
+       USB_Disable();
 
        printf_P(PSTR(ESC_FG_RED "Host Mode Error\r\n"
                                 " -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode);
 
        printf_P(PSTR(ESC_FG_RED "Host Mode Error\r\n"
                                 " -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode);