Pseudo-port the host mode demos for possible later multi-arch support.
This commit is contained in:
parent
65a8d68c57
commit
329629a316
87 changed files with 213 additions and 127 deletions
|
@ -87,12 +87,14 @@ int main(void)
|
|||
/** Configures the board hardware and chip peripherals for the demo's functionality. */
|
||||
void SetupHardware(void)
|
||||
{
|
||||
#if (ARCH == ARCH_AVR8)
|
||||
/* Disable watchdog if enabled by bootloader/fuses */
|
||||
MCUSR &= ~(1 << WDRF);
|
||||
wdt_disable();
|
||||
|
||||
/* Disable clock division */
|
||||
clock_prescale_set(clock_div_1);
|
||||
#endif
|
||||
|
||||
/* Hardware Initialization */
|
||||
Serial_Init(9600, false);
|
||||
|
@ -170,17 +172,17 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
|||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
VirtualSerial_CDC_Interface.State.LineEncoding.BaudRateBPS = 9600;
|
||||
VirtualSerial_CDC_Interface.State.LineEncoding.CharFormat = CDC_LINEENCODING_OneStopBit;
|
||||
VirtualSerial_CDC_Interface.State.LineEncoding.ParityType = CDC_PARITY_None;
|
||||
VirtualSerial_CDC_Interface.State.LineEncoding.DataBits = 8;
|
||||
|
||||
|
||||
if (CDC_Host_SetLineEncoding(&VirtualSerial_CDC_Interface))
|
||||
{
|
||||
puts_P(PSTR("Error Setting Device Line Encoding.\r\n"));
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
puts_P(PSTR("CDC Device Enumerated.\r\n"));
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#include <LUFA/Drivers/Peripheral/Serial.h>
|
||||
#include <LUFA/Drivers/Board/LEDs.h>
|
||||
#include <LUFA/Drivers/USB/USB.h>
|
||||
#include <LUFA/Platform/Platform.h>
|
||||
|
||||
/* Macros: */
|
||||
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<asf xmlversion="1.0">
|
||||
<project caption="Virtual Serial CDC Host Demo (Class Driver APIs)" id="lufa.demos.host.class.cdc.example">
|
||||
<project caption="Virtual Serial CDC Host Demo (Class Driver APIs)" id="lufa.demos.host.class.cdc.example.avr8">
|
||||
<require idref="lufa.demos.host.class.cdc"/>
|
||||
<require idref="lufa.boards.dummy.avr8"/>
|
||||
<generator value="as5_8"/>
|
||||
|
||||
<device-support value="at90usb1287"/>
|
||||
<config name="lufa.drivers.board.name" value="usbkey"/>
|
||||
<config name="lufa.drivers.board.name" value="none"/>
|
||||
|
||||
<build type="define" name="F_CPU" value="8000000UL"/>
|
||||
<build type="define" name="F_USB" value="8000000UL"/>
|
||||
<build type="define" name="F_CPU" value="16000000UL"/>
|
||||
<build type="define" name="F_USB" value="16000000UL"/>
|
||||
</project>
|
||||
|
||||
<module type="application" id="lufa.demos.host.class.cdc" caption="Virtual Serial CDC Host Demo (Class Driver APIs)">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue