X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/1d433d4506113c95285f633e3553ff62d4cfd05d..1f1d0710f379a8b08ef646cbadb63d92c35e47fb:/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c diff --git a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c index ffc11d8ff..34a329194 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c +++ b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c @@ -66,9 +66,12 @@ void SetupHardware(void) clock_prescale_set(clock_div_1); /* Hardware Initialization */ - SerialStream_Init(9600, false); + Serial_Init(9600, false); 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 @@ -100,7 +103,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) { - USB_ShutDown(); + USB_Disable(); printf_P(PSTR(ESC_FG_RED "Host Mode Error\r\n" " -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode); @@ -225,7 +228,7 @@ void Mouse_HID_Task(void) uint8_t MouseReport[Pipe_BytesInPipe()]; /* Load in the mouse report */ - Pipe_Read_Stream_LE(MouseReport, Pipe_BytesInPipe()); + Pipe_Read_Stream_LE(MouseReport, Pipe_BytesInPipe(), NULL); /* Process the read in mouse report from the device */ ProcessMouseReport(MouseReport);