Use immediate variable expansion in the second-deepest level makefile scripts to...
[pub/USBasp.git] / Demos / Device / Incomplete / Sideshow / Sideshow.c
index 4b6b268..41009f3 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2011.
+     Copyright (C) Dean Camera, 2012.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
-  Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2012  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
@@ -80,7 +80,10 @@ void SetupHardware(void)
        /* Hardware Initialization */
        LEDs_Init();
        USB_Init();
        /* Hardware Initialization */
        LEDs_Init();
        USB_Init();
-       SerialStream_Init(9600, false);
+       Serial_Init(9600, false);
+
+       /* Create a stdio stream for the serial port for stdin and stdout */
+       Serial_CreateStream(NULL);
 }
 
 void EVENT_USB_Device_Connect(void)
 }
 
 void EVENT_USB_Device_Connect(void)
@@ -98,10 +101,8 @@ void EVENT_USB_Device_ConfigurationChanged(void)
        bool ConfigSuccess = true;
 
        /* Setup Sideshow Data Endpoints */
        bool ConfigSuccess = true;
 
        /* Setup Sideshow Data Endpoints */
-       ConfigSuccess &= Endpoint_ConfigureEndpoint(SIDESHOW_IN_EPNUM,  EP_TYPE_BULK, ENDPOINT_DIR_IN,
-                                                   SIDESHOW_IO_EPSIZE, ENDPOINT_BANK_SINGLE);
-       ConfigSuccess &= Endpoint_ConfigureEndpoint(SIDESHOW_OUT_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT,
-                                                   SIDESHOW_IO_EPSIZE, ENDPOINT_BANK_SINGLE);
+       ConfigSuccess &= Endpoint_ConfigureEndpoint(SIDESHOW_IN_EPADDR,  EP_TYPE_BULK, SIDESHOW_IO_EPSIZE, 1);
+       ConfigSuccess &= Endpoint_ConfigureEndpoint(SIDESHOW_OUT_EPADDR, EP_TYPE_BULK, SIDESHOW_IO_EPSIZE, 1);
 
        /* Indicate endpoint configuration success or failure */
        LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
 
        /* Indicate endpoint configuration success or failure */
        LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
@@ -139,7 +140,7 @@ void SideShow_Task(void)
          return;
 
        /* Select the SideShow data out endpoint */
          return;
 
        /* Select the SideShow data out endpoint */
-       Endpoint_SelectEndpoint(SIDESHOW_OUT_EPNUM);
+       Endpoint_SelectEndpoint(SIDESHOW_OUT_EPADDR);
 
        /* Check to see if a new SideShow message has been received */
        if (Endpoint_IsReadWriteAllowed())
 
        /* Check to see if a new SideShow message has been received */
        if (Endpoint_IsReadWriteAllowed())