diff --git a/Bootloaders/CDC/BootloaderCDC.c b/Bootloaders/CDC/BootloaderCDC.c index 482859bda047373d2b674f76bba15ec59c4ad664..83fd0ee924045b96c807038b687e4d2f48e670e6 100644 --- a/Bootloaders/CDC/BootloaderCDC.c +++ b/Bootloaders/CDC/BootloaderCDC.c @@ -69,6 +69,9 @@ int main(void) /* Setup hardware required for the bootloader */ SetupHardware(); + /* Enable global interrupts so that the USB stack can function */ + sei(); + while (RunBootloader) { CDC_Task(); diff --git a/Bootloaders/CDC/BootloaderCDC.h b/Bootloaders/CDC/BootloaderCDC.h index 8367002798ff571249b0c91666d71383956496aa..22b57438dfec36779bc899cd0bcb71d7d6e10185 100644 --- a/Bootloaders/CDC/BootloaderCDC.h +++ b/Bootloaders/CDC/BootloaderCDC.h @@ -42,6 +42,7 @@ #include <avr/boot.h> #include <avr/eeprom.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdbool.h> #include "Descriptors.h" diff --git a/Bootloaders/DFU/BootloaderDFU.c b/Bootloaders/DFU/BootloaderDFU.c index 157b78ffbfec636628c2b6dbb5348fe0c85bdd9c..d90accb6c5ea8c30519d72c267a1d3a67fa49a3c 100644 --- a/Bootloaders/DFU/BootloaderDFU.c +++ b/Bootloaders/DFU/BootloaderDFU.c @@ -101,6 +101,9 @@ int main(void) { /* Configure hardware required by the bootloader */ SetupHardware(); + + /* Enable global interrupts so that the USB stack can function */ + sei(); /* Run the USB management task while the bootloader is supposed to be running */ while (RunBootloader || WaitForExit) diff --git a/Bootloaders/DFU/BootloaderDFU.h b/Bootloaders/DFU/BootloaderDFU.h index ca53266bf876c7a20c819592646b491090091c03..4583d6ce10126fbcc88fd77d13d19f8567d66338 100644 --- a/Bootloaders/DFU/BootloaderDFU.h +++ b/Bootloaders/DFU/BootloaderDFU.h @@ -43,6 +43,7 @@ #include <avr/pgmspace.h> #include <avr/eeprom.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdbool.h> #include "Descriptors.h" diff --git a/Bootloaders/Incomplete/MIDI/BootloaderMIDI.c b/Bootloaders/Incomplete/MIDI/BootloaderMIDI.c index 8d26d56a05b5618ea5869676cfe63f1558fd687e..863820157dfa25c77600d1e61d4d7db4aa977385 100644 --- a/Bootloaders/Incomplete/MIDI/BootloaderMIDI.c +++ b/Bootloaders/Incomplete/MIDI/BootloaderMIDI.c @@ -42,8 +42,6 @@ int main(void) { SetupHardware(); - - LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); for (;;) { @@ -63,48 +61,22 @@ void SetupHardware(void) clock_prescale_set(clock_div_1); /* Hardware Initialization */ - LEDs_Init(); USB_Init(); } -/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs. */ -void EVENT_USB_Device_Connect(void) -{ - /* Indicate USB enumerating */ - LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING); -} - -/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via - * the status LEDs, disables the sample update and PWM output timers and stops the USB and MIDI management tasks. - */ -void EVENT_USB_Device_Disconnect(void) -{ - /* Indicate USB not ready */ - LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); -} - /** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration * of the USB device after enumeration - the device endpoints are configured and the MIDI management task started. */ void EVENT_USB_Device_ConfigurationChanged(void) { - /* Indicate USB connected and ready */ - LEDs_SetAllLEDs(LEDMASK_USB_READY); - /* Setup MIDI stream endpoints */ - if (!(Endpoint_ConfigureEndpoint(MIDI_STREAM_OUT_EPNUM, EP_TYPE_BULK, - ENDPOINT_DIR_OUT, MIDI_STREAM_EPSIZE, - ENDPOINT_BANK_SINGLE))) - { - LEDs_SetAllLEDs(LEDMASK_USB_ERROR); - } + Endpoint_ConfigureEndpoint(MIDI_STREAM_OUT_EPNUM, EP_TYPE_BULK, + ENDPOINT_DIR_OUT, MIDI_STREAM_EPSIZE, + ENDPOINT_BANK_SINGLE); - if (!(Endpoint_ConfigureEndpoint(MIDI_STREAM_IN_EPNUM, EP_TYPE_BULK, - ENDPOINT_DIR_IN, MIDI_STREAM_EPSIZE, - ENDPOINT_BANK_SINGLE))) - { - LEDs_SetAllLEDs(LEDMASK_USB_ERROR); - } + Endpoint_ConfigureEndpoint(MIDI_STREAM_IN_EPNUM, EP_TYPE_BULK, + ENDPOINT_DIR_IN, MIDI_STREAM_EPSIZE, + ENDPOINT_BANK_SINGLE); } /** Task to handle the generation of MIDI note change events in response to presses of the board joystick, and send them @@ -122,9 +94,7 @@ void MIDI_Task(void) if (Endpoint_IsOUTReceived()) { USB_MIDI_EventPacket_t InPacket; - Endpoint_Read_Stream_LE(&InPacket, sizeof(InPacket)); - - LEDs_SetAllLEDs(InPacket.Data2 > 64 ? LEDS_LED1 : LEDS_LED2); + Endpoint_Read_Stream_LE(&InPacket, sizeof(InPacket)); Endpoint_ClearOUT(); uint8_t Channel = InPacket.Data1; diff --git a/Bootloaders/Incomplete/MIDI/BootloaderMIDI.h b/Bootloaders/Incomplete/MIDI/BootloaderMIDI.h index 5af684da4663702edfe59687a995cd6304b1ac1f..b5688195b36ac97465c99b4c8f7a9786cbc34abc 100644 --- a/Bootloaders/Incomplete/MIDI/BootloaderMIDI.h +++ b/Bootloaders/Incomplete/MIDI/BootloaderMIDI.h @@ -41,12 +41,12 @@ #include <avr/wdt.h> #include <avr/boot.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdbool.h> #include "Descriptors.h" #include <LUFA/Version.h> - #include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/USB/USB.h> /* Macros: */ diff --git a/Bootloaders/TeensyHID/TeensyHID.c b/Bootloaders/TeensyHID/TeensyHID.c index 2317ea4e5dee1765cc4fa7e63d7133929551bffd..5431a57004f640b6869d464d5c447e35f854bf20 100644 --- a/Bootloaders/TeensyHID/TeensyHID.c +++ b/Bootloaders/TeensyHID/TeensyHID.c @@ -49,6 +49,9 @@ int main(void) /* Setup hardware required for the bootloader */ SetupHardware(); + /* Enable global interrupts so that the USB stack can function */ + sei(); + while (RunBootloader) USB_USBTask(); diff --git a/Bootloaders/TeensyHID/TeensyHID.h b/Bootloaders/TeensyHID/TeensyHID.h index 6393898705ac1f954df1568341ab1fcc856f189d..7e3d72dcf71d4b1a4a32bc3ead823f302039acdb 100644 --- a/Bootloaders/TeensyHID/TeensyHID.h +++ b/Bootloaders/TeensyHID/TeensyHID.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/boot.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdbool.h> #include "Descriptors.h" diff --git a/Demos/Device/ClassDriver/AudioInput/AudioInput.c b/Demos/Device/ClassDriver/AudioInput/AudioInput.c index 22d0173a9f3bbd06e2da774d78f2b23996047d7e..09a2f0f01ded5e447f7fd902e22f60a9b06156ec 100644 --- a/Demos/Device/ClassDriver/AudioInput/AudioInput.c +++ b/Demos/Device/ClassDriver/AudioInput/AudioInput.c @@ -59,6 +59,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/ClassDriver/AudioInput/AudioInput.h b/Demos/Device/ClassDriver/AudioInput/AudioInput.h index 98fec78133b78a3c8782dd139de8110bc9e29826..dc3475e693b103644249b778b4cc4b07107d1d04 100644 --- a/Demos/Device/ClassDriver/AudioInput/AudioInput.h +++ b/Demos/Device/ClassDriver/AudioInput/AudioInput.h @@ -40,6 +40,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <LUFA/Version.h> #include <LUFA/Drivers/Board/LEDs.h> diff --git a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c index be3eb42c9576fdfd2dc73fed4b728d1fe2f6f125..0dda68c3724eae605875a33159f781d717cf5540 100644 --- a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c +++ b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c @@ -59,6 +59,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.h b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.h index e8bd76914559d632cdb30f0033fa751d1e916d67..cf0034f8782cb526a49ace654e0628297b5e83a5 100644 --- a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.h +++ b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.h @@ -40,6 +40,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdlib.h> #include "Descriptors.h" diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c index dd64c2851389a993d2c0d87b8a96fdb84c87f09e..ba3b86f12122b52dfb8aeb2d2ae0b1ca80e8970a 100644 --- a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c +++ b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c @@ -94,6 +94,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.h b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.h index a7ce35df71b7ffbee4a32b36f73b87391e1209ac..1c99cfde8f60482fa3b8feb625b8ddcfd2f5bd3d 100644 --- a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.h +++ b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.h @@ -40,6 +40,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <string.h> #include "Descriptors.h" diff --git a/Demos/Device/ClassDriver/GenericHID/GenericHID.c b/Demos/Device/ClassDriver/GenericHID/GenericHID.c index 3516f08573924966b5c8418a489bda52bd2a70f1..285a197b76e90ea5558b7c4419f38aed8759546e 100644 --- a/Demos/Device/ClassDriver/GenericHID/GenericHID.c +++ b/Demos/Device/ClassDriver/GenericHID/GenericHID.c @@ -74,6 +74,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/ClassDriver/GenericHID/GenericHID.h b/Demos/Device/ClassDriver/GenericHID/GenericHID.h index 423e28f430a9b09142313839f5decc2e7f2a5e4b..595bd0ea04862da00780f9a24a0c4c98b83f239d 100644 --- a/Demos/Device/ClassDriver/GenericHID/GenericHID.h +++ b/Demos/Device/ClassDriver/GenericHID/GenericHID.h @@ -40,6 +40,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <string.h> #include "Descriptors.h" diff --git a/Demos/Device/ClassDriver/Joystick/Joystick.c b/Demos/Device/ClassDriver/Joystick/Joystick.c index 518c86e8f3c97e198437ead1e9e4137b3e1cf3c4..6a259d7c3ed85a3460dbe1c69216f31a8744bd1c 100644 --- a/Demos/Device/ClassDriver/Joystick/Joystick.c +++ b/Demos/Device/ClassDriver/Joystick/Joystick.c @@ -66,6 +66,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/ClassDriver/Joystick/Joystick.h b/Demos/Device/ClassDriver/Joystick/Joystick.h index 7932ab5c27a231e0ec4a3e50f269f788967a0191..9f666fe72c438e27b51b5d49eed199a8d954b307 100644 --- a/Demos/Device/ClassDriver/Joystick/Joystick.h +++ b/Demos/Device/ClassDriver/Joystick/Joystick.h @@ -40,6 +40,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <string.h> #include "Descriptors.h" diff --git a/Demos/Device/ClassDriver/Keyboard/Keyboard.c b/Demos/Device/ClassDriver/Keyboard/Keyboard.c index ea4fbf8192a41483db7a47415ce5f3c4843f7062..0da529543e7761f4012ce2e87452a48cc0118e7e 100644 --- a/Demos/Device/ClassDriver/Keyboard/Keyboard.c +++ b/Demos/Device/ClassDriver/Keyboard/Keyboard.c @@ -66,6 +66,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/ClassDriver/Keyboard/Keyboard.h b/Demos/Device/ClassDriver/Keyboard/Keyboard.h index 945c7e89452fad6fc3f8ff0235e9417bce268a80..2c86bf5a2c263029f074c922454ae9a6cfb7d548 100644 --- a/Demos/Device/ClassDriver/Keyboard/Keyboard.h +++ b/Demos/Device/ClassDriver/Keyboard/Keyboard.h @@ -40,8 +40,8 @@ /* Includes: */ #include <avr/io.h> #include <avr/wdt.h> - #include <avr/interrupt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdbool.h> #include <string.h> diff --git a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c index 1f87a7a6b09a8b0567b704c577890ae81e11d272..94f27bd1bd1578f4efb73c5efd9ad27611c553ac 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c +++ b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c @@ -89,6 +89,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h index ca4cfecd8598b9d050569977b960d1d7d0f2e66d..4c540ccb0f4bbbdf0730fa19c023c181cb64db6f 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h +++ b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h @@ -36,6 +36,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdbool.h> #include <string.h> diff --git a/Demos/Device/ClassDriver/MIDI/MIDI.c b/Demos/Device/ClassDriver/MIDI/MIDI.c index 5c0f25e6498a1c691c27a5d58bb8eb2a931ae88f..7fcdfcc5fef1010c62e24bbeecca980b05328ddc 100644 --- a/Demos/Device/ClassDriver/MIDI/MIDI.c +++ b/Demos/Device/ClassDriver/MIDI/MIDI.c @@ -64,6 +64,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/ClassDriver/MIDI/MIDI.h b/Demos/Device/ClassDriver/MIDI/MIDI.h index c8cb4268df09851e66e6971f2870559d3f49d41a..96e2b40d8622ac346d5611df57e8b57a632d99ba 100644 --- a/Demos/Device/ClassDriver/MIDI/MIDI.h +++ b/Demos/Device/ClassDriver/MIDI/MIDI.h @@ -40,7 +40,9 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdbool.h> + #include <string.h> #include "Descriptors.h" diff --git a/Demos/Device/ClassDriver/MassStorage/MassStorage.c b/Demos/Device/ClassDriver/MassStorage/MassStorage.c index ce8e04bc93e65edfb62e8476825a790718d63b13..c58dff95f742049049f5e9a63f24cab1f2782db7 100644 --- a/Demos/Device/ClassDriver/MassStorage/MassStorage.c +++ b/Demos/Device/ClassDriver/MassStorage/MassStorage.c @@ -66,6 +66,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/ClassDriver/MassStorage/MassStorage.h b/Demos/Device/ClassDriver/MassStorage/MassStorage.h index 2c7fa7d7febc567da593813cb6a55c38889c084d..64da5b3bc67d366a06e4f3d43fefc6a68d8d79e5 100644 --- a/Demos/Device/ClassDriver/MassStorage/MassStorage.h +++ b/Demos/Device/ClassDriver/MassStorage/MassStorage.h @@ -40,6 +40,8 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> + #include <string.h> #include "Descriptors.h" diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c index 828699af56d4648845ac89a5d95a21a5b9aff771..9b4efb67988fe58fa3a8dd01fa64d0a6f8664536 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c @@ -89,6 +89,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h index deeb6e048e1f1e4c34f9da83b5ce0ed230ed7236..65600eef1f79fbe8fefa16f2f93c6b48644a104d 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h @@ -42,6 +42,7 @@ #include <avr/wdt.h> #include <avr/power.h> #include <avr/interrupt.h> + #include <avr/interrupt.h> #include <stdbool.h> #include <string.h> diff --git a/Demos/Device/ClassDriver/Mouse/Mouse.c b/Demos/Device/ClassDriver/Mouse/Mouse.c index 48348c774a85ae6fd234ecd57a13016052831ba7..96af145587411fde99aa3bb554abfdd49d5a769c 100644 --- a/Demos/Device/ClassDriver/Mouse/Mouse.c +++ b/Demos/Device/ClassDriver/Mouse/Mouse.c @@ -66,6 +66,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/ClassDriver/Mouse/Mouse.h b/Demos/Device/ClassDriver/Mouse/Mouse.h index 79d56aa506d6d752b0030cbee787068b5163ede4..818d540691b38e0e4eee98265fea3c9a454974d3 100644 --- a/Demos/Device/ClassDriver/Mouse/Mouse.h +++ b/Demos/Device/ClassDriver/Mouse/Mouse.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/interrupt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdbool.h> #include <string.h> diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/ProtocolDecoders.h b/Demos/Device/ClassDriver/RNDISEthernet/Lib/ProtocolDecoders.h index a3b92fa5bbf746f4c1add0de653ed2e413c012ad..2dfc6086888335bf5fe36ffb736a74b2ff0a1879 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/ProtocolDecoders.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/ProtocolDecoders.h @@ -38,6 +38,8 @@ /* Includes: */ #include <avr/io.h> + #include <avr/pgmspace.h> + #include <stdio.h> #include <LUFA/Drivers/USB/Class/RNDIS.h> #include <LUFA/Drivers/Peripheral/SerialStream.h> diff --git a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c index dbdbb8ab86ce9c0bf8659b4376cf19392610bdb4..14016aa64c150accfb81e22ee0070e19350e2842 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c @@ -70,12 +70,11 @@ int main(void) { SetupHardware(); - LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); - TCP_Init(); Webserver_Init(); - printf_P(PSTR("\r\n\r\n****** RNDIS Demo running. ******\r\n")); + LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.h b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.h index 3bed7f8514ff108b786a993ffe320a0564bb73af..c6c092ccc38c4c572284c342f15b678de0626e06 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.h @@ -39,10 +39,9 @@ /* Includes: */ #include <avr/io.h> #include <avr/wdt.h> - #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <string.h> - #include <stdio.h> #include "Descriptors.h" diff --git a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c index 30cbc6695cfed212c04cb2e57ef60ffe27e0d16d..1a8d6ede83357564766464eaeff25d34a08760e8 100644 --- a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c +++ b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c @@ -76,6 +76,7 @@ int main(void) CDC_Device_CreateStream(&VirtualSerial_CDC_Interface, &USBSerialStream); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.h b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.h index 96d83800b2515fa1f2799923e0ec5fea84e3b3a3..0edac545b84506cf7e9e4e431cda2b50394966b3 100644 --- a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.h +++ b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.h @@ -40,6 +40,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <string.h> #include <stdio.h> diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c index e7c899b79ddf3d37b563e528c1e25734b55abb81..c55d6d00143fd8e90a5e67962d78b2f28268a860 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c @@ -90,6 +90,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h index c0e6e7903810cbcedbd84bbaa8fb1661d9904ccb..3d6d3a7e3998423f9f204e02b6effe5904d09093 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h @@ -40,6 +40,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <string.h> #include "Descriptors.h" diff --git a/Demos/Device/Incomplete/Sideshow/Sideshow.c b/Demos/Device/Incomplete/Sideshow/Sideshow.c index 6c48c34e3cf38ed3bd02d67e12adae36cf8ecf55..5f70b34c6c13e7b3eaad41a1925e63b0d329f740 100644 --- a/Demos/Device/Incomplete/Sideshow/Sideshow.c +++ b/Demos/Device/Incomplete/Sideshow/Sideshow.c @@ -58,6 +58,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/Incomplete/Sideshow/Sideshow.h b/Demos/Device/Incomplete/Sideshow/Sideshow.h index a75d3d9bcd6870d4eabd116a6834163c87f26800..871e4770617c1ee0c00cb9da7769ff55254799b3 100644 --- a/Demos/Device/Incomplete/Sideshow/Sideshow.h +++ b/Demos/Device/Incomplete/Sideshow/Sideshow.h @@ -35,6 +35,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include "Descriptors.h" #include "Lib/SideshowCommands.h" diff --git a/Demos/Device/LowLevel/AudioInput/AudioInput.c b/Demos/Device/LowLevel/AudioInput/AudioInput.c index 392609b0721268ea4dc9222bbee8fd4e20b5bf4a..aa8967cd06d85c1c5cc734270f4e2dc707ed8b86 100644 --- a/Demos/Device/LowLevel/AudioInput/AudioInput.c +++ b/Demos/Device/LowLevel/AudioInput/AudioInput.c @@ -47,6 +47,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/LowLevel/AudioInput/AudioInput.h b/Demos/Device/LowLevel/AudioInput/AudioInput.h index 4585ab5b6de581dddbdabfc7c3aba5acababf354..6902dc8f0849bd54ce738d5290e215755e3c72eb 100644 --- a/Demos/Device/LowLevel/AudioInput/AudioInput.h +++ b/Demos/Device/LowLevel/AudioInput/AudioInput.h @@ -40,6 +40,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include "Descriptors.h" diff --git a/Demos/Device/LowLevel/AudioOutput/AudioOutput.c b/Demos/Device/LowLevel/AudioOutput/AudioOutput.c index 5dcb5c576c7f9a0b4a0cefdc628fedb4f7bb69a9..8cd6be17bb98d694ff35badd3129ddad5faa38ec 100644 --- a/Demos/Device/LowLevel/AudioOutput/AudioOutput.c +++ b/Demos/Device/LowLevel/AudioOutput/AudioOutput.c @@ -47,6 +47,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/LowLevel/AudioOutput/AudioOutput.h b/Demos/Device/LowLevel/AudioOutput/AudioOutput.h index 3812ae0fd14ebd723614b7533fefd527ea75189d..69b59b8fad8eec2dd447a3df60cc3f689d54f82a 100644 --- a/Demos/Device/LowLevel/AudioOutput/AudioOutput.h +++ b/Demos/Device/LowLevel/AudioOutput/AudioOutput.h @@ -40,7 +40,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> - #include <stdlib.h> + #include <avr/interrupt.h> #include "Descriptors.h" diff --git a/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c b/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c index 9be089b2b06c3ba5371f7ad3b4b0a021e649f4d7..5c90c6ab81a59398c61538e8b1eec29fcfb969b9 100644 --- a/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c +++ b/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c @@ -69,6 +69,9 @@ CDC_Line_Coding_t LineEncoding2 = { .BaudRateBPS = 0, int main(void) { SetupHardware(); + + LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.h b/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.h index a4c8f97ca58935503de2b2f76b98b812fa643aa2..6ca8b72a6dadb6c5a56fd137a3a5da5694d19056 100644 --- a/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.h +++ b/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.h @@ -40,6 +40,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <string.h> #include "Descriptors.h" diff --git a/Demos/Device/LowLevel/GenericHID/GenericHID.c b/Demos/Device/LowLevel/GenericHID/GenericHID.c index 4d3f4c1bab3abf0cc9ee8cd8e3277b1a06f46de4..9d9012aff1f72bf15caff9f9b13b026d32146d54 100644 --- a/Demos/Device/LowLevel/GenericHID/GenericHID.c +++ b/Demos/Device/LowLevel/GenericHID/GenericHID.c @@ -48,6 +48,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/LowLevel/GenericHID/GenericHID.h b/Demos/Device/LowLevel/GenericHID/GenericHID.h index c79ed6f449d680a2b71cac116949dc31ecfe2e0c..deaee336c0aa7632c3f610c5ab59c1e57bbf7986 100644 --- a/Demos/Device/LowLevel/GenericHID/GenericHID.h +++ b/Demos/Device/LowLevel/GenericHID/GenericHID.h @@ -40,6 +40,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdbool.h> #include <string.h> diff --git a/Demos/Device/LowLevel/Joystick/Joystick.c b/Demos/Device/LowLevel/Joystick/Joystick.c index 0edead5c8ea1f52ea072521b735115fef70e94ae..e84eef04245cf0e3b0bb5376089bae6ae307da07 100644 --- a/Demos/Device/LowLevel/Joystick/Joystick.c +++ b/Demos/Device/LowLevel/Joystick/Joystick.c @@ -44,6 +44,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/LowLevel/Joystick/Joystick.h b/Demos/Device/LowLevel/Joystick/Joystick.h index 811cb4e427912245747f935750f7978123432797..761582d45165fa9e23437d993ebd6d782ba5a9a6 100644 --- a/Demos/Device/LowLevel/Joystick/Joystick.h +++ b/Demos/Device/LowLevel/Joystick/Joystick.h @@ -40,6 +40,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <string.h> #include "Descriptors.h" diff --git a/Demos/Device/LowLevel/Keyboard/Keyboard.c b/Demos/Device/LowLevel/Keyboard/Keyboard.c index fd7e63e2b565904f70c9f18b70e2b0131de8c08b..67715843b9a66753e6acb37a73d59c599c408729 100644 --- a/Demos/Device/LowLevel/Keyboard/Keyboard.c +++ b/Demos/Device/LowLevel/Keyboard/Keyboard.c @@ -62,6 +62,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/LowLevel/Keyboard/Keyboard.h b/Demos/Device/LowLevel/Keyboard/Keyboard.h index 4cb3616c7d7e035178fcd5cd96a0c9dc8f17d7e9..f41f6d4c31a4a9a83804208d5c6533b51e0cde5e 100644 --- a/Demos/Device/LowLevel/Keyboard/Keyboard.h +++ b/Demos/Device/LowLevel/Keyboard/Keyboard.h @@ -41,6 +41,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdbool.h> #include <string.h> diff --git a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c index e41b7090bdcc6c6ef5952da23f357d103f9f2333..ddcd3ce8ecd767613889abb3979103256a3370b1 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c +++ b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c @@ -52,6 +52,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.h b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.h index 7fcec978ba3014adab6b06b2eb4a3e389e1b3f06..993b326a298de0792b82a8e6a5ec14393ca0ebba 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.h +++ b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.h @@ -36,6 +36,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdbool.h> #include <string.h> diff --git a/Demos/Device/LowLevel/MIDI/MIDI.c b/Demos/Device/LowLevel/MIDI/MIDI.c index edfc56f48c4eff6122d3cc95acbe58909925194b..03536b2c56a6b94924d909d97958656852359b40 100644 --- a/Demos/Device/LowLevel/MIDI/MIDI.c +++ b/Demos/Device/LowLevel/MIDI/MIDI.c @@ -44,7 +44,8 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); - + sei(); + for (;;) { MIDI_Task(); diff --git a/Demos/Device/LowLevel/MIDI/MIDI.h b/Demos/Device/LowLevel/MIDI/MIDI.h index 82e42da0d9dc8e0afb43757acfde59e96fa495bf..a497527298779aaf1b768621299c619cf5cda395 100644 --- a/Demos/Device/LowLevel/MIDI/MIDI.h +++ b/Demos/Device/LowLevel/MIDI/MIDI.h @@ -40,6 +40,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdbool.h> #include "Descriptors.h" diff --git a/Demos/Device/LowLevel/MassStorage/MassStorage.c b/Demos/Device/LowLevel/MassStorage/MassStorage.c index fc9a97de48c231bd8713bb3528bc8d81bb5505dc..1ed84d326b6359229840ed709e45782653d2f3a0 100644 --- a/Demos/Device/LowLevel/MassStorage/MassStorage.c +++ b/Demos/Device/LowLevel/MassStorage/MassStorage.c @@ -55,6 +55,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/LowLevel/MassStorage/MassStorage.h b/Demos/Device/LowLevel/MassStorage/MassStorage.h index 44302084c3775335f75ec0eea47a807291611c79..27d1e3b000cbbd277964379516ec99e8fae6ab38 100644 --- a/Demos/Device/LowLevel/MassStorage/MassStorage.h +++ b/Demos/Device/LowLevel/MassStorage/MassStorage.h @@ -40,6 +40,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include "Descriptors.h" diff --git a/Demos/Device/LowLevel/Mouse/Mouse.c b/Demos/Device/LowLevel/Mouse/Mouse.c index 70ed82cc844ada2038fda01a4cb4f6bd9b0e1dcc..3fce5221004f830920a6faa93b36f949ba1db9f4 100644 --- a/Demos/Device/LowLevel/Mouse/Mouse.c +++ b/Demos/Device/LowLevel/Mouse/Mouse.c @@ -61,6 +61,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/LowLevel/Mouse/Mouse.h b/Demos/Device/LowLevel/Mouse/Mouse.h index 884482b3d183eb7684c332e9837d30ad84af3286..6a1a518fbc98a4e2a796b51164e860e97ca0f723 100644 --- a/Demos/Device/LowLevel/Mouse/Mouse.h +++ b/Demos/Device/LowLevel/Mouse/Mouse.h @@ -40,6 +40,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdbool.h> #include <string.h> diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/ProtocolDecoders.h b/Demos/Device/LowLevel/RNDISEthernet/Lib/ProtocolDecoders.h index 7bae188e88403aac6628a3e731591726ffc908b7..01856755042320d7832801813744e9babac7357d 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/ProtocolDecoders.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/ProtocolDecoders.h @@ -38,6 +38,8 @@ /* Includes: */ #include <avr/io.h> + #include <avr/pgmspace.h> + #include <stdio.h> #include <LUFA/Drivers/Peripheral/SerialStream.h> diff --git a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c index 1b617dd2ecddf434275ed2d2616f15476fcd48c2..cb06bc33358e159a7719cea341acbb11ba30bd42 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c +++ b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c @@ -47,9 +47,8 @@ int main(void) TCP_Init(); Webserver_Init(); - printf_P(PSTR("\r\n\r\n****** RNDIS Demo running. ******\r\n")); - LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.h b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.h index 3828134acd06728ac82bd219592a964f5ebc969c..478ed1a23c4b7575b155143862b904811a1ea4d6 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.h +++ b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.h @@ -39,10 +39,9 @@ /* Includes: */ #include <avr/io.h> #include <avr/wdt.h> - #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <string.h> - #include <stdio.h> #include "Descriptors.h" diff --git a/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c b/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c index bad87578a41ee30e8fd1513591a6fa2432d15ab5..52ef28c6fa0bdfc13e01d50367504e7b3cbb0f3e 100644 --- a/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c +++ b/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c @@ -57,6 +57,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.h b/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.h index 5427a6902c7d7291a1350327ed30a9dbf07a6dd4..1ec261c41901fe24718495170e456a010a34f159 100644 --- a/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.h +++ b/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.h @@ -40,6 +40,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <string.h> #include "Descriptors.h" diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.c b/Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.c index dc94e1fba4df78614444a05b50790a0dd6b368eb..98bf50bfffe7c9393b74d3366804b0a06f7b5f65 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.c +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.c @@ -46,6 +46,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "Mouse Host/Device Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.h b/Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.h index 50b89ad3211094f5df247eb8f0f042bd9c305a34..48035d624576db4bebc5b4be485c26ca04574415 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.h +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include <LUFA/Version.h> diff --git a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c index 0e7e579824324cf6e22911b0b77e584625c4d89a..32c9b698f880864fd17c0723f30ef3fca4ae0598 100644 --- a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c +++ b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c @@ -70,6 +70,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "Joystick Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.h b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.h index b47630ae4864af4988809781fe02282fb029bba8..7ee7b80d7e3d1777ce7b9d90e3a5ba36efd88d3f 100644 --- a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.h +++ b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include <LUFA/Version.h> diff --git a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c index 15b93199effad37b0dd3c548349a7e4c7e304dba..61292a4d02b70f34a68aad917bca489747b5551b 100644 --- a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c +++ b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c @@ -65,7 +65,8 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "Keyboard Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); - + sei(); + for (;;) { switch (USB_HostState) diff --git a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.h b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.h index 0dc2d3bf5fa9aace68ddfc3cdcca08d3ac5b9087..2e5f1caeef665e9f69400adb13107c52d2a4ee44 100644 --- a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.h +++ b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include <LUFA/Version.h> diff --git a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c index 14b65012065ed4566344165acc388bc0de3ce211..531757a4ae6e99063780f15eb1ba745b819df2ca 100644 --- a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c +++ b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c @@ -70,6 +70,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "Keyboard Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.h b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.h index 8f4194816187e8a442e099c17b1ddf6d7064963b..98d00fb3ce9853f77c623c1a20603aeb99c9db12 100644 --- a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.h +++ b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include <LUFA/Version.h> diff --git a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c index 064c22dd6336fcd70b711cfe54599f9f7d832f02..8fbf31b86d2bd21669ec8f8f05cabee2ccec350f 100644 --- a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c +++ b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c @@ -63,6 +63,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "MIDI Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.h b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.h index 6a93c97174b8a93a73c20cfe597029259576229f..8da4a95ef4a8b8e42d9198ae7d8e9b56dffcda8e 100644 --- a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.h +++ b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include <LUFA/Version.h> diff --git a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c index 6740d9cb7f6e2dc0c9a7813a36e169c9bdf6d0e4..a442c1b47c886c60e9821a96febd074ba8a1325a 100644 --- a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c +++ b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c @@ -63,6 +63,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "Mass Storage Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h index 5a61c268ed2751389ca09b3e0683686d7037d74f..e97d1e3fecff0eca660132c074345a763eb02f6c 100644 --- a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h +++ b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <ctype.h> #include <stdio.h> diff --git a/Demos/Host/ClassDriver/MouseHost/MouseHost.c b/Demos/Host/ClassDriver/MouseHost/MouseHost.c index 4501a25dc22b139a12e249ba4ef54b85ebdac9a8..af75d4ba54b5d370cb8e1dc4ae2efa8d2e40b81e 100644 --- a/Demos/Host/ClassDriver/MouseHost/MouseHost.c +++ b/Demos/Host/ClassDriver/MouseHost/MouseHost.c @@ -65,6 +65,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "Mouse Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Host/ClassDriver/MouseHost/MouseHost.h b/Demos/Host/ClassDriver/MouseHost/MouseHost.h index 1fdf42b8687c837e3b941f069067cb55f84c048b..bc64120f05a69d4978e5139ee8d0d9c86fb7a968 100644 --- a/Demos/Host/ClassDriver/MouseHost/MouseHost.h +++ b/Demos/Host/ClassDriver/MouseHost/MouseHost.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include <LUFA/Version.h> diff --git a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c index c735b5c005149517593b4973928dd30e332412c0..296f86bfb543f15c4c392e552d20965c9669924e 100644 --- a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c +++ b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c @@ -68,6 +68,7 @@ int main(void) SetupHardware(); puts_P(PSTR(ESC_FG_CYAN "Mouse Host Demo running.\r\n" ESC_FG_WHITE)); + sei(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); diff --git a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.h b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.h index 8d798ab37bd4707594ceaf96603142282fc7150e..e88738d5af56e278bbcc32f3dc424f1c91fa993b 100644 --- a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.h +++ b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include <LUFA/Version.h> diff --git a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c index 2df65729324cab94b88952af060dda636619770e..d2baad6200de462e8a73a3f772ffe24b09701a23 100644 --- a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c +++ b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c @@ -62,6 +62,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "Printer Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.h b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.h index c2ebede684a2be5d3f5e246e1e50a7f61cd8b4c4..2fb7c8cefb920e1559090d737e09c6876bf9aeb3 100644 --- a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.h +++ b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include <LUFA/Version.h> diff --git a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c index e31f9a3362ba5610b6aadf31f5a8b6fde3caebcc..f5c3e4256f503ae2be42dd1fe23bf11b280356d9 100644 --- a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c +++ b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c @@ -70,6 +70,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "RNDIS Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h index 06b9fd525d99c8134d861ee3225dd613ac671530..c0d0c60832ca11864b282630fcdb39be5378c870 100644 --- a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h +++ b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include <LUFA/Version.h> diff --git a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c index ff33c457d5629e0108a036da40357c895a67a37a..81bfbe4212fa254a742d4193bb8c5e654d400e53 100644 --- a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c +++ b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c @@ -65,6 +65,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "Still Image Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.h b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.h index 35c9f127600d637e885c5009a9935ae015c5b564..4078238e08cb8e6f14392f1df9cee59910468014 100644 --- a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.h +++ b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include <LUFA/Version.h> diff --git a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c index d5ec0417b976800a02d0a79eff2c3504291d9d84..df6ad9796e3aa1760194495c1cb02070847b7cbb 100644 --- a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c +++ b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c @@ -65,6 +65,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "CDC Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.h b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.h index 785a605a06033b525d6871f638156d0bf3ca097e..a54e75f9f995333bbd18fd72df782bd2515141b9 100644 --- a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.h +++ b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include <LUFA/Version.h> diff --git a/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c b/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c index 8f6e1f2ffff635b5b1febee7ceb33b177c5097a8..e74d37749d02c9332922b9fe052484a4f62b9c76 100644 --- a/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c +++ b/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c @@ -54,6 +54,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "Bluetooth Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.h b/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.h index 62baf06abe8e593e97ac65f5c73a5c7d6ac979ea..8a2817cb7108be42594157565049fc757ed7ed6f 100644 --- a/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.h +++ b/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include "Lib/ServiceDiscoveryProtocol.h" diff --git a/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.c b/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.c index 38d96a3dfa3eb45709225f5fb1cf01523c5eea5b..3dc314e49c6959bef28de6a9eac267ce7bbcf659 100644 --- a/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.c +++ b/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.c @@ -46,6 +46,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "Generic HID Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c index 144830ec4e9d29ed0c3f5bf16a3e4de6107418c1..04870b10acfe8c24fe394a0e7d50b40518285474 100644 --- a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c +++ b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c @@ -46,6 +46,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "Joystick HID Parser Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h index 38fe3e44b3a28a1bc215dde4fa651a2904e15fa5..2ac9d5cffe7a94ccb5dd9ef3080bc4c4e39e0b1f 100644 --- a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h +++ b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include <LUFA/Version.h> diff --git a/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c b/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c index b85d40d186706cb465d74b59d62a7bbb95edb4f7..633094f138f8109741cdfb41c6c487d37e0f0ea2 100644 --- a/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c +++ b/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c @@ -46,6 +46,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "Keyboard HID Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c index 778220b470e8cef17b9b9bca6206f0b5608531db..431e76aea114d8206c32a42d0c90371dc9f05b72 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c @@ -46,6 +46,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "Keyboard HID Parser Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h index f5aaf2da8163b0ce67987499d95e6064ad9dbf44..5df5622d7d75e26bd32981d12faa6825de5f9e0a 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h @@ -36,6 +36,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include <LUFA/Version.h> diff --git a/Demos/Host/LowLevel/MIDIHost/MIDIHost.c b/Demos/Host/LowLevel/MIDIHost/MIDIHost.c index 6964f71eaea494efcd190eb3bda7ab3d62e82d5d..cbbb0c565fbb803936b147732abefdcfd66b1cbf 100644 --- a/Demos/Host/LowLevel/MIDIHost/MIDIHost.c +++ b/Demos/Host/LowLevel/MIDIHost/MIDIHost.c @@ -46,6 +46,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "MIDI Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Host/LowLevel/MIDIHost/MIDIHost.h b/Demos/Host/LowLevel/MIDIHost/MIDIHost.h index 094adcc4a8fd1e17344b455682c95e1f6cdfdb33..576ad601e2f7bd3d07fd7e4545e8b75355fcf3cb 100644 --- a/Demos/Host/LowLevel/MIDIHost/MIDIHost.h +++ b/Demos/Host/LowLevel/MIDIHost/MIDIHost.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include <LUFA/Version.h> diff --git a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c index 55b85939f103a0b8d2971e016fb05af21020f86b..31d2c104d50f79ce61ec44cd31fd16792476819e 100644 --- a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c +++ b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c @@ -50,6 +50,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "Mass Storage Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h index fad372c4e6eb3bd9534fed5bfaa10e44a5adf99f..0d92fd5338665e1347247f1d1675ca722ca190c4 100644 --- a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h +++ b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include <ctype.h> #include <string.h> diff --git a/Demos/Host/LowLevel/MouseHost/MouseHost.c b/Demos/Host/LowLevel/MouseHost/MouseHost.c index 1c59400052202095d386c73c72b88fc74aec501d..5cf5e4485fa8029af30b3dcef20beefa5b558647 100644 --- a/Demos/Host/LowLevel/MouseHost/MouseHost.c +++ b/Demos/Host/LowLevel/MouseHost/MouseHost.c @@ -46,6 +46,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "Mouse HID Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c index 14883018c3e0ed383d036af2d9d17ba2ede5fff0..e13f5f48ed330c598ea82ca49d2ff2926d152c75 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c +++ b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c @@ -46,6 +46,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "Mouse HID Parser Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h index e05beb8dd4a1fe6dd1711f75a3b4c8447a1179cb..10cd8ecefeb01fa4fd050ce677718956c3a06df3 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h +++ b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include <LUFA/Version.h> diff --git a/Demos/Host/LowLevel/PrinterHost/PrinterHost.c b/Demos/Host/LowLevel/PrinterHost/PrinterHost.c index 6840138b592cb5bb435c312643261e0622cf7647..a2c9fd86342a4adb95131d047031db0868e79924 100644 --- a/Demos/Host/LowLevel/PrinterHost/PrinterHost.c +++ b/Demos/Host/LowLevel/PrinterHost/PrinterHost.c @@ -46,6 +46,7 @@ int main(void) LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); puts_P(PSTR(ESC_FG_CYAN "Printer Host Demo running.\r\n" ESC_FG_WHITE)); + sei(); for (;;) { diff --git a/Demos/Host/LowLevel/PrinterHost/PrinterHost.h b/Demos/Host/LowLevel/PrinterHost/PrinterHost.h index 7fa572cf92a687e744dcf56f688f97eeed877d33..9b0bb5dda21c52bb8255ea17fa52c10e9641634a 100644 --- a/Demos/Host/LowLevel/PrinterHost/PrinterHost.h +++ b/Demos/Host/LowLevel/PrinterHost/PrinterHost.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include <string.h> diff --git a/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.c b/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.c index 5ca591578791e4d2405056413ae0c8a7d3df1980..8e274302e9c326945602d40dd3e66cda4bf1b178 100644 --- a/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.c +++ b/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.c @@ -46,6 +46,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "RNDIS Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h b/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h index 20a48ac104998e81010e56e3d30a3a0f9dad332b..8e9215751c043d86935369cab246cc6e3a01989a 100644 --- a/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h +++ b/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include <LUFA/Version.h> diff --git a/Demos/Host/LowLevel/StillImageHost/StillImageHost.c b/Demos/Host/LowLevel/StillImageHost/StillImageHost.c index 45613197f100acb17d75c0f1607f6bee37cd0aae..2daf3ef4b44d252143f20c604a8054f99d9c5745 100644 --- a/Demos/Host/LowLevel/StillImageHost/StillImageHost.c +++ b/Demos/Host/LowLevel/StillImageHost/StillImageHost.c @@ -46,6 +46,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "Still Image Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Host/LowLevel/StillImageHost/StillImageHost.h b/Demos/Host/LowLevel/StillImageHost/StillImageHost.h index ddbffeec4b1408f2df77886b45568ce49cae61e7..92f007be9f6cf92d1c26463a246b42ca74e7aaaa 100644 --- a/Demos/Host/LowLevel/StillImageHost/StillImageHost.h +++ b/Demos/Host/LowLevel/StillImageHost/StillImageHost.h @@ -40,6 +40,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include "ConfigDescriptor.h" diff --git a/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c b/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c index 588198bb40abd8bb5c4363aff925d7bbb19fd536..735ebba3196f03a82be07214f64b4e06f391b458 100644 --- a/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c +++ b/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c @@ -46,6 +46,7 @@ int main(void) puts_P(PSTR(ESC_FG_CYAN "CDC Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.h b/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.h index 7bfc13f3155409e5a4d32587143f8a21b40ab164..ecf35229d73a954821ff208bda340cf65c3ae1f6 100644 --- a/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.h +++ b/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include <LUFA/Version.h> diff --git a/LUFA/Drivers/USB/LowLevel/LowLevel.c b/LUFA/Drivers/USB/LowLevel/LowLevel.c index c9d0493b4ca517f521a5cf2967dcc389ede3a784..a088654f78117457fc20f726196fe3b4ade7a376 100644 --- a/LUFA/Drivers/USB/LowLevel/LowLevel.c +++ b/LUFA/Drivers/USB/LowLevel/LowLevel.c @@ -103,8 +103,6 @@ void USB_Init( #endif USB_IsInitialized = true; - - sei(); } void USB_ShutDown(void) diff --git a/LUFA/Drivers/USB/LowLevel/LowLevel.h b/LUFA/Drivers/USB/LowLevel/LowLevel.h index 79261cd441b927591ceec5463c33e7bc214db2fe..337a004a58efd9ac58147dff15b015a498c5fdd3 100644 --- a/LUFA/Drivers/USB/LowLevel/LowLevel.h +++ b/LUFA/Drivers/USB/LowLevel/LowLevel.h @@ -236,8 +236,12 @@ * allow for device connection to a host when in device mode, or for device enumeration while in * host mode. * - * As the USB library relies on USB interrupts for some of its functionality, this routine will - * enable global interrupts. + * As the USB library relies on interrupts for the device and host mode enumeration processes, + * the user must enable global interrupts before or shortly after this function is called. In + * device mode, interrupts must be enabled within 500ms of this function being called to ensure + * that the host does not time out whilst enumerating the device. In host mode, interrupts may be + * enabled at the application's leisure however enumeration will not begin of an attached device + * until after this has occurred. * * Calling this function when the USB interface is already initialized will cause a complete USB * interface reset and re-enumeration. diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt index 425cb4372c3411c4b0052336e65866696233cfe3..2a772b88097d2adfad7217f47da9e0a2b5317e07 100644 --- a/LUFA/ManPages/ChangeLog.txt +++ b/LUFA/ManPages/ChangeLog.txt @@ -28,6 +28,7 @@ * - Added LIBUSB_FILTERDRV_COMPAT compile time option to the AVRISP programmer project to make the code compatible with Windows * builds of avrdude at the expense of AVRStudio compatibility * - Removed two-step endpoint/pipe bank clear and switch sequence for smaller, faster endpoint/pipe code + * - The USB_Init() function no longer calls sei() - the user is now responsible for enabling interrupts when they are ready * * <b>Fixed:</b> * - Fixed software PDI/TPI programming mode in the AVRISP project not correctly toggling just the clock pin diff --git a/LUFA/ManPages/MigrationInformation.txt b/LUFA/ManPages/MigrationInformation.txt index 8467e0019371a5386c3d08c6cabfd1a16b922282..baed509879848c1cae59e964763d3ff8231dd498 100644 --- a/LUFA/ManPages/MigrationInformation.txt +++ b/LUFA/ManPages/MigrationInformation.txt @@ -16,6 +16,18 @@ * - The \ref TWI_StartTransmission() function now takes in a timeout period, expressed in milliseconds, within which the addressed * device must respond or the function will abort. * + * <b>Device Mode</b> + * - The \ref USB_Init() function no longer calls sei() to enable global interrupts, as the user application may need + * to perform other initialization before it is ready to handle global interrupts. The user application is now responsible + * for enabling global interrupts before or shortly after calling \ref USB_Init() to ensure that the enumeration process + * functions correctly. + * + * <b>Host Mode</b> + * - The \ref USB_Init() function no longer calls sei() to enable global interrupts, as the user application may need + * to perform other initialization before it is ready to handle global interrupts. The user application is now responsible + * for enabling global interrupts before or shortly after calling \ref USB_Init() to ensure that the enumeration process + * functions correctly. + * * \section Sec_Migration100219 Migrating from 091223 to 100219 * * <b>Non-USB Library Components</b> diff --git a/Projects/AVRISP-MKII/AVRISP.c b/Projects/AVRISP-MKII/AVRISP.c index 2ba8001994921f29a3c193d649ea29ed2cb3f560..cea1161d515d930098b67e570d13814ea20712ab 100644 --- a/Projects/AVRISP-MKII/AVRISP.c +++ b/Projects/AVRISP-MKII/AVRISP.c @@ -44,6 +44,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Projects/Benito/Benito.c b/Projects/Benito/Benito.c index 86da27a129792e3db8f33c7384708d5135bc7704..be623e90ef29e534e73a217959f90b3de219de4c 100644 --- a/Projects/Benito/Benito.c +++ b/Projects/Benito/Benito.c @@ -83,6 +83,8 @@ int main(void) SetupHardware(); Buffer_Initialize(&Tx_Buffer); + + sei(); for (;;) { diff --git a/Projects/Incomplete/MIDIToneGenerator/MIDIToneGenerator.c b/Projects/Incomplete/MIDIToneGenerator/MIDIToneGenerator.c index 4df37504f5e205fd1ef8ea94137e7f507c8f3ddc..c86cd07529a081bd66803ee0721f58e69f1dd493 100644 --- a/Projects/Incomplete/MIDIToneGenerator/MIDIToneGenerator.c +++ b/Projects/Incomplete/MIDIToneGenerator/MIDIToneGenerator.c @@ -88,6 +88,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Projects/Incomplete/MIDIToneGenerator/MIDIToneGenerator.h b/Projects/Incomplete/MIDIToneGenerator/MIDIToneGenerator.h index f7f39d5a908ce11e16055b9ce65650044e570b3c..d2405f881cf05bff469430bb94e4c011c24efba3 100644 --- a/Projects/Incomplete/MIDIToneGenerator/MIDIToneGenerator.h +++ b/Projects/Incomplete/MIDIToneGenerator/MIDIToneGenerator.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/power.h> #include <avr/pgmspace.h> + #include <avr/interrupt.h> #include <stdbool.h> #include "Descriptors.h" diff --git a/Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.c b/Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.c index 8090b5d158a0b89f9377faeb1431239cbaa4b50c..239eb7137f5285ef0f177758093e4ef2de31f305 100644 --- a/Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.c +++ b/Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.c @@ -108,6 +108,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.h b/Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.h index 5623945458ec7d77dbec10edacc56da5d4e1e104..f61e369ebb8e3969dbf888273600f434d696aa1a 100644 --- a/Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.h +++ b/Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.h @@ -40,6 +40,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include "DiskDevice.h" diff --git a/Projects/LEDNotifier/LEDNotifier.c b/Projects/LEDNotifier/LEDNotifier.c index 61d5efcbb5790f6560c69f9de44a1355e096fb88..5b53900249ef1885179b0d6b88a03871a45cc156 100644 --- a/Projects/LEDNotifier/LEDNotifier.c +++ b/Projects/LEDNotifier/LEDNotifier.c @@ -107,6 +107,8 @@ int main(void) /* Create a regular blocking character stream for the interface so that it can be used with the stdio.h functions */ CDC_Device_CreateBlockingStream(&VirtualSerial_CDC_Interface, &USBSerialStream); + + sei(); for (;;) { diff --git a/Projects/LEDNotifier/LEDNotifier.h b/Projects/LEDNotifier/LEDNotifier.h index ee41d7d9336163825879ed3061e3ef8c43adff69..243723ec8b04f90c5a61f98e65162d2057962467 100644 --- a/Projects/LEDNotifier/LEDNotifier.h +++ b/Projects/LEDNotifier/LEDNotifier.h @@ -40,6 +40,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <string.h> #include <stdio.h> diff --git a/Projects/Magstripe/Magstripe.c b/Projects/Magstripe/Magstripe.c index 88950cc2177aca76da6f5fc820eaaa9ea577c0e2..39149b48056a871d42fb6e3c23aafd6b083358a0 100644 --- a/Projects/Magstripe/Magstripe.c +++ b/Projects/Magstripe/Magstripe.c @@ -76,6 +76,8 @@ int main(void) for (uint8_t Buffer = 0; Buffer < TOTAL_TRACKS; Buffer++) BitBuffer_Init(&TrackDataBuffers[Buffer]); + + sei(); for (;;) { diff --git a/Projects/Magstripe/Magstripe.h b/Projects/Magstripe/Magstripe.h index ddadd0d7537ce5cfded4fc5934b08721032e4155..8a48e7c1ad4d3bef92450f9d42a30446e2ec575d 100644 --- a/Projects/Magstripe/Magstripe.h +++ b/Projects/Magstripe/Magstripe.h @@ -41,6 +41,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include "Descriptors.h" #include "Lib/MagstripeHW.h" diff --git a/Projects/MissileLauncher/MissileLauncher.c b/Projects/MissileLauncher/MissileLauncher.c index a186732905030d3f07a802a34cb4a3a6464b26ed..cb0bd8570c09eff5febbd9674fef8cea6cb1b712 100644 --- a/Projects/MissileLauncher/MissileLauncher.c +++ b/Projects/MissileLauncher/MissileLauncher.c @@ -95,10 +95,11 @@ int main(void) { SetupHardware(); - LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); - CmdState = CMD_STOP; + LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); + for (;;) { Read_Joystick_Status(); diff --git a/Projects/RelayBoard/RelayBoard.c b/Projects/RelayBoard/RelayBoard.c index a496679aea25c49e21015884a12188da7ffc207b..2fb7b696cee7ba416c2170f6653b3ac9484471f6 100644 --- a/Projects/RelayBoard/RelayBoard.c +++ b/Projects/RelayBoard/RelayBoard.c @@ -44,6 +44,8 @@ int main(void) { SetupHardware(); + + sei(); for (;;) USB_USBTask(); diff --git a/Projects/RelayBoard/RelayBoard.h b/Projects/RelayBoard/RelayBoard.h index 2ffa59023c867fe0332b65da037da1c650334e25..f42d78cde06fc833bedebcc89cd4742a74b090ca 100644 --- a/Projects/RelayBoard/RelayBoard.h +++ b/Projects/RelayBoard/RelayBoard.h @@ -41,6 +41,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include "Descriptors.h" diff --git a/Projects/TemperatureDataLogger/TempDataLogger.c b/Projects/TemperatureDataLogger/TempDataLogger.c index 35bf68bd6c31f7c4da0ff048a62759c62c04dfbc..59105286e8828e2011602be502f6f892a9a6a96d 100644 --- a/Projects/TemperatureDataLogger/TempDataLogger.c +++ b/Projects/TemperatureDataLogger/TempDataLogger.c @@ -137,16 +137,17 @@ ISR(TIMER1_COMPA_vect, ISR_BLOCK) */ int main(void) { - /* Fetch logging interval from EEPROM */ - LoggingInterval500MS_SRAM = eeprom_read_byte(&LoggingInterval500MS_EEPROM); - SetupHardware(); - LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + /* Fetch logging interval from EEPROM */ + LoggingInterval500MS_SRAM = eeprom_read_byte(&LoggingInterval500MS_EEPROM); /* Mount and open the log file on the dataflash FAT partition */ OpenLogFile(); + LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); + /* Discard the first sample from the temperature sensor, as it is generally incorrect */ volatile uint8_t Dummy = Temperature_GetTemperature(); (void)Dummy; diff --git a/Projects/TemperatureDataLogger/TempDataLogger.h b/Projects/TemperatureDataLogger/TempDataLogger.h index 3f3a3c04e23e3c9b01e514ab8dbd4c882d0f4482..a6e770bb0c43e60867834f735fa96ba8b98c097e 100644 --- a/Projects/TemperatureDataLogger/TempDataLogger.h +++ b/Projects/TemperatureDataLogger/TempDataLogger.h @@ -40,6 +40,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <stdio.h> #include "Descriptors.h" diff --git a/Projects/USBtoSerial/USBtoSerial.c b/Projects/USBtoSerial/USBtoSerial.c index 73be33e1fd1aab8454b0bcc237f700dce6663241..c9bc717341ec8c6d3ba801633705415d6c841a60 100644 --- a/Projects/USBtoSerial/USBtoSerial.c +++ b/Projects/USBtoSerial/USBtoSerial.c @@ -77,6 +77,7 @@ int main(void) Buffer_Initialize(&USARTtoUSB_Buffer); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Projects/Webserver/Webserver.c b/Projects/Webserver/Webserver.c index 541e0e2c528dfcd90ac3369ccfdec63de5be14f0..cecd881688f69a3bd5cd731141618edb59ddc242 100644 --- a/Projects/Webserver/Webserver.c +++ b/Projects/Webserver/Webserver.c @@ -44,6 +44,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Projects/Webserver/Webserver.h b/Projects/Webserver/Webserver.h index f1351d8913ab165df24e02c3baa3568d31892272..4fb5b37b4803f2d2f5d353a275acb8de3e1184cf 100644 --- a/Projects/Webserver/Webserver.h +++ b/Projects/Webserver/Webserver.h @@ -41,6 +41,7 @@ #include <avr/wdt.h> #include <avr/pgmspace.h> #include <avr/power.h> + #include <avr/interrupt.h> #include <LUFA/Version.h> #include <LUFA/Drivers/Board/LEDs.h> diff --git a/Projects/XPLAINBridge/XPLAINBridge.c b/Projects/XPLAINBridge/XPLAINBridge.c index 090b7679194ae2583647fcfe9ed6c2b8df35148d..5457a2283eab18ed580af44583b2322a5e6e4a8e 100644 --- a/Projects/XPLAINBridge/XPLAINBridge.c +++ b/Projects/XPLAINBridge/XPLAINBridge.c @@ -81,6 +81,7 @@ int main(void) Buffer_Initialize(&UARTtoUSB_Buffer); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { diff --git a/Projects/XPLAINBridge/XPLAINBridge.h b/Projects/XPLAINBridge/XPLAINBridge.h index 0c3a56c9dc3b10f2488af81e5e8673c582e376d9..877792d7ff2d83da0f18d15b524a6b3341d0658a 100644 --- a/Projects/XPLAINBridge/XPLAINBridge.h +++ b/Projects/XPLAINBridge/XPLAINBridge.h @@ -40,6 +40,7 @@ #include <avr/io.h> #include <avr/wdt.h> #include <avr/power.h> + #include <avr/interrupt.h> #include "AVRISPDescriptors.h" #include "USARTDescriptors.h"