Commit 59c4871f authored by Dean Camera's avatar Dean Camera
Browse files

USB_Init() no longer calls sei() to enable global interrupts - this must now...

USB_Init() no longer calls sei() to enable global interrupts - this must now be done in the user application once all init code has run.
parent 85aaaf84
......@@ -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"
......
......@@ -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 (;;)
{
......
......@@ -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>
......
......@@ -76,6 +76,8 @@ int main(void)
for (uint8_t Buffer = 0; Buffer < TOTAL_TRACKS; Buffer++)
BitBuffer_Init(&TrackDataBuffers[Buffer]);
sei();
for (;;)
{
......
......@@ -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"
......
......@@ -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();
......
......@@ -44,6 +44,8 @@
int main(void)
{
SetupHardware();
sei();
for (;;)
USB_USBTask();
......
......@@ -41,6 +41,7 @@
#include <avr/io.h>
#include <avr/wdt.h>
#include <avr/power.h>
#include <avr/interrupt.h>
#include "Descriptors.h"
......
......@@ -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;
......
......@@ -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"
......
......@@ -77,6 +77,7 @@ int main(void)
Buffer_Initialize(&USARTtoUSB_Buffer);
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
sei();
for (;;)
{
......
......@@ -44,6 +44,7 @@ int main(void)
SetupHardware();
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
sei();
for (;;)
{
......
......@@ -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>
......
......@@ -81,6 +81,7 @@ int main(void)
Buffer_Initialize(&UARTtoUSB_Buffer);
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
sei();
for (;;)
{
......
......@@ -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"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment