Add more const-ness to the stream endpoint/pipe functions where possible.
[pub/USBasp.git] / Demos / Host / LowLevel / MassStorageHost / MassStorageHost.c
index a595d11..dd085ef 100644 (file)
@@ -70,10 +70,13 @@ 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();
        Buttons_Init();
        USB_Init();
        LEDs_Init();
        Buttons_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
@@ -105,7 +108,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);
@@ -238,7 +241,7 @@ void MassStorage_Task(void)
 
                        for (;;)
                        {
 
                        for (;;)
                        {
-                               Serial_TxByte('.');
+                               Serial_SendByte('.');
 
                                /* Abort if device removed */
                                if (USB_HostState == HOST_STATE_Unattached)
 
                                /* Abort if device removed */
                                if (USB_HostState == HOST_STATE_Unattached)