projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix incorrect macro guard in the UC3 EndpointStream header file.
[pub/USBasp.git]
/
Demos
/
Host
/
ClassDriver
/
VirtualSerialHost
/
VirtualSerialHost.c
diff --git
a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c
b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c
index
6bb43bb
..
4668908
100644
(file)
--- a/
Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c
+++ b/
Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c
@@
-1,13
+1,13
@@
/*
LUFA Library
/*
LUFA Library
- Copyright (C) Dean Camera, 201
0
.
+ Copyright (C) Dean Camera, 201
1
.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
- Copyright 201
0
Dean Camera (dean [at] fourwalledcubicle [dot] com)
+ Copyright 201
1
Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@
-55,13
+55,14
@@
USB_ClassInfo_CDC_Host_t VirtualSerial_CDC_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.
*/
int main(void)
{
SetupHardware();
/** Main program entry point. This routine configures the hardware required by the application, then
* enters a loop to run the application tasks in sequence.
*/
int main(void)
{
SetupHardware();
-
+
puts_P(PSTR(ESC_FG_CYAN "CDC Host Demo running.\r\n" ESC_FG_WHITE));
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
puts_P(PSTR(ESC_FG_CYAN "CDC Host Demo running.\r\n" ESC_FG_WHITE));
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
@@
-135,9
+136,12
@@
void SetupHardware(void)
clock_prescale_set(clock_div_1);
/* Hardware Initialization */
clock_prescale_set(clock_div_1);
/* Hardware Initialization */
- Serial
Stream
_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
@@
-169,7
+173,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);