X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/2c806f6ceee42db9094eb11f3f32524b98440726..5cae54154506176d64a581c5b3d9550c901b570c:/Projects/HIDReportViewer/HIDReportViewer.c diff --git a/Projects/HIDReportViewer/HIDReportViewer.c b/Projects/HIDReportViewer/HIDReportViewer.c index e67cf8407..6ca33e572 100644 --- a/Projects/HIDReportViewer/HIDReportViewer.c +++ b/Projects/HIDReportViewer/HIDReportViewer.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2012. + Copyright (C) Dean Camera, 2013. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2013 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 @@ -18,7 +18,7 @@ advertising or publicity pertaining to distribution of the software without specific, written prior permission. - The author disclaim all warranties with regard to this + The author disclaims all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall the author be liable for any special, indirect or consequential damages or any damages @@ -47,14 +47,17 @@ USB_ClassInfo_HID_Host_t Device_HID_Interface = { .Config = { - .DataINPipeNumber = 1, - .DataINPipeDoubleBank = false, - - .DataOUTPipeNumber = 2, - .DataOUTPipeDoubleBank = false, - + .DataINPipe = + { + .Address = (PIPE_DIR_IN | 1), + .Banks = 1, + }, + .DataOUTPipe = + { + .Address = (PIPE_DIR_OUT | 2), + .Banks = 1, + }, .HIDInterfaceProtocol = HID_CSCP_NonBootProtocol, - .HIDParserData = &HIDReportInfo }, }; @@ -70,7 +73,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "HID Device Report Viewer Running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); - sei(); + GlobalInterruptEnable(); for (;;) { @@ -86,7 +89,7 @@ int main(void) */ void RetrieveDeviceData(void) { - if (USB_CurrentMode != USB_MODE_Host) + if (USB_HostState != HOST_STATE_Configured) return; LEDs_SetAllLEDs(LEDMASK_USB_BUSY); @@ -199,12 +202,14 @@ void OutputCollectionPath(const HID_CollectionPath_t* const CollectionPath) /** 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); @@ -311,7 +316,7 @@ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, * * \param[in] CurrentItem Pointer to the item the HID report parser is currently working with * - * \return Boolean true if the item should be stored into the HID report structure, false if it should be discarded + * \return Boolean \c true if the item should be stored into the HID report structure, \c false if it should be discarded */ bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* const CurrentItem) {