Use immediate variable expansion in the second-deepest level makefile scripts to...
[pub/USBasp.git] / Demos / Device / Incomplete / Sideshow / Sideshow.c
index 670299b..41009f3 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2010.
+     Copyright (C) Dean Camera, 2012.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
-  Copyright 2010  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
@@ -80,7 +80,10 @@ void SetupHardware(void)
        /* 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)
@@ -98,16 +101,14 @@ void EVENT_USB_Device_ConfigurationChanged(void)
        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);
 }
 
-void EVENT_USB_Device_UnhandledControlRequest(void)
+void EVENT_USB_Device_ControlRequest(void)
 {
        switch (USB_ControlRequest.bRequest)
        {
@@ -139,7 +140,7 @@ void SideShow_Task(void)
          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())