Skip to content

Commit

Permalink
Move macro definitions from lufa.c to lufa.h
Browse files Browse the repository at this point in the history
  • Loading branch information
yashikno committed Apr 25, 2014
1 parent 00e9a34 commit ad4cba1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
9 changes: 0 additions & 9 deletions protocol/lufa/lufa.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,6 @@ void EVENT_USB_Device_StartOfFrame(void)
/** Event handler for the USB_ConfigurationChanged event.
* This is fired when the host sets the current configuration of the USB device after enumeration.
*/
#if LUFA_VERSION_INTEGER < 0x120730
/* old API 120219 */
#define ENDPOINT_CONFIG(epnum, eptype, epdir, epsize, epbank) Endpoint_ConfigureEndpoint(epnum, eptype, epdir, epsize, epbank)
#else
/* new API >= 120730 */
#define ENDPOINT_BANK_SINGLE 1
#define ENDPOINT_BANK_DOUBLE 2
#define ENDPOINT_CONFIG(epnum, eptype, epdir, epsize, epbank) Endpoint_ConfigureEndpoint((epdir) | (epnum) , eptype, epsize, epbank)
#endif
void EVENT_USB_Device_ConfigurationChanged(void)
{
bool ConfigSuccess = true;
Expand Down
11 changes: 11 additions & 0 deletions protocol/lufa/lufa.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,15 @@ typedef struct {
uint16_t usage;
} __attribute__ ((packed)) report_extra_t;


#if LUFA_VERSION_INTEGER < 0x120730
/* old API 120219 */
#define ENDPOINT_CONFIG(epnum, eptype, epdir, epsize, epbank) Endpoint_ConfigureEndpoint(epnum, eptype, epdir, epsize, epbank)
#else
/* new API >= 120730 */
#define ENDPOINT_BANK_SINGLE 1
#define ENDPOINT_BANK_DOUBLE 2
#define ENDPOINT_CONFIG(epnum, eptype, epdir, epsize, epbank) Endpoint_ConfigureEndpoint((epdir) | (epnum) , eptype, epsize, epbank)
#endif

#endif

0 comments on commit ad4cba1

Please sign in to comment.