Skip to content

Added macros to alias the endpoint callback functions to support configurability #979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libraries/USBDevice/USBAudio/USBAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ float USBAudio::getVolume() {
}


bool USBAudio::EP3_OUT_callback() {
bool USBAudio::EPISO_OUT_callback() {
uint32_t size = 0;
interruptOUT = true;
if (buf_stream_in != NULL) {
Expand All @@ -132,7 +132,7 @@ bool USBAudio::EP3_OUT_callback() {
}


bool USBAudio::EP3_IN_callback() {
bool USBAudio::EPISO_IN_callback() {
interruptIN = true;
writeIN = true;
return true;
Expand Down
4 changes: 2 additions & 2 deletions libraries/USBDevice/USBAudio/USBAudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,12 @@ class USBAudio: public USBDevice {
/*
* Callback called when a packet is received
*/
virtual bool EP3_OUT_callback();
virtual bool EPISO_OUT_callback();

/*
* Callback called when a packet has been sent
*/
virtual bool EP3_IN_callback();
virtual bool EPISO_IN_callback();

private:

Expand Down
6 changes: 6 additions & 0 deletions libraries/USBDevice/USBDevice/USBEndpoints_KL25Z.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,18 @@
/* Bulk endpoints */
#define EPBULK_OUT (EP2OUT)
#define EPBULK_IN (EP2IN)
#define EPBULK_OUT_callback EP2_OUT_callback
#define EPBULK_IN_callback EP2_IN_callback
/* Interrupt endpoints */
#define EPINT_OUT (EP1OUT)
#define EPINT_IN (EP1IN)
#define EPINT_OUT_callback EP1_OUT_callback
#define EPINT_IN_callback EP1_IN_callback
/* Isochronous endpoints */
#define EPISO_OUT (EP3OUT)
#define EPISO_IN (EP3IN)
#define EPISO_OUT_callback EP3_OUT_callback
#define EPISO_IN_callback EP3_IN_callback

#define MAX_PACKET_SIZE_EPBULK (MAX_PACKET_SIZE_EP2)
#define MAX_PACKET_SIZE_EPINT (MAX_PACKET_SIZE_EP1)
Expand Down
6 changes: 6 additions & 0 deletions libraries/USBDevice/USBDevice/USBEndpoints_LPC11U.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,18 @@
/* Bulk endpoint */
#define EPBULK_OUT (EP2OUT)
#define EPBULK_IN (EP2IN)
#define EPBULK_OUT_callback EP2_OUT_callback
#define EPBULK_IN_callback EP2_IN_callback
/* Interrupt endpoint */
#define EPINT_OUT (EP1OUT)
#define EPINT_IN (EP1IN)
#define EPINT_OUT_callback EP1_OUT_callback
#define EPINT_IN_callback EP1_IN_callback
/* Isochronous endpoint */
#define EPISO_OUT (EP3OUT)
#define EPISO_IN (EP3IN)
#define EPISO_OUT_callback EP3_OUT_callback
#define EPISO_IN_callback EP3_IN_callback

#define MAX_PACKET_SIZE_EPBULK (MAX_PACKET_SIZE_EP2)
#define MAX_PACKET_SIZE_EPINT (MAX_PACKET_SIZE_EP1)
Expand Down
6 changes: 6 additions & 0 deletions libraries/USBDevice/USBDevice/USBEndpoints_LPC17_LPC23.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,18 @@
/* Bulk endpoints */
#define EPBULK_OUT (EP2OUT)
#define EPBULK_IN (EP2IN)
#define EPBULK_OUT_callback EP2_OUT_callback
#define EPBULK_IN_callback EP2_IN_callback
/* Interrupt endpoints */
#define EPINT_OUT (EP1OUT)
#define EPINT_IN (EP1IN)
#define EPINT_OUT_callback EP1_OUT_callback
#define EPINT_IN_callback EP1_IN_callback
/* Isochronous endpoints */
#define EPISO_OUT (EP3OUT)
#define EPISO_IN (EP3IN)
#define EPISO_OUT_callback EP3_OUT_callback
#define EPISO_IN_callback EP3_IN_callback

#define MAX_PACKET_SIZE_EPBULK (MAX_PACKET_SIZE_EP2)
#define MAX_PACKET_SIZE_EPINT (MAX_PACKET_SIZE_EP1)
Expand Down
6 changes: 6 additions & 0 deletions libraries/USBDevice/USBDevice/USBEndpoints_RZ_A1H.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,18 @@
/* Bulk endpoints */
#define EPBULK_OUT (EP2OUT)
#define EPBULK_IN (EP2IN)
#define EPBULK_OUT_callback EP2_OUT_callback
#define EPBULK_IN_callback EP2_IN_callback
/* Interrupt endpoints */
#define EPINT_OUT (EP1OUT)
#define EPINT_IN (EP1IN)
#define EPINT_OUT_callback EP1_OUT_callback
#define EPINT_IN_callback EP1_IN_callback
/* Isochronous endpoints */
#define EPISO_OUT (EP3OUT)
#define EPISO_IN (EP3IN)
#define EPISO_OUT_callback EP3_OUT_callback
#define EPISO_IN_callback EP3_IN_callback

#define MAX_PACKET_SIZE_EPBULK (MAX_PACKET_SIZE_EP2)
#define MAX_PACKET_SIZE_EPINT (MAX_PACKET_SIZE_EP1)
Expand Down
6 changes: 6 additions & 0 deletions libraries/USBDevice/USBDevice/USBEndpoints_STM32F4.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,18 @@
/* Bulk endpoint */
#define EPBULK_OUT (EP2OUT)
#define EPBULK_IN (EP2IN)
#define EPBULK_OUT_callback EP2_OUT_callback
#define EPBULK_IN_callback EP2_IN_callback
/* Interrupt endpoint */
#define EPINT_OUT (EP1OUT)
#define EPINT_IN (EP1IN)
#define EPINT_OUT_callback EP1_OUT_callback
#define EPINT_IN_callback EP1_IN_callback
/* Isochronous endpoint */
#define EPISO_OUT (EP3OUT)
#define EPISO_IN (EP3IN)
#define EPISO_OUT_callback EP3_OUT_callback
#define EPISO_IN_callback EP3_IN_callback

#define MAX_PACKET_SIZE_EPBULK (MAX_PACKET_SIZE_EP2)
#define MAX_PACKET_SIZE_EPINT (MAX_PACKET_SIZE_EP1)
Expand Down
2 changes: 1 addition & 1 deletion libraries/USBDevice/USBHID/USBKeyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ uint8_t * USBKeyboard::reportDesc() {
}


bool USBKeyboard::EP1_OUT_callback() {
bool USBKeyboard::EPINT_OUT_callback() {
uint32_t bytesRead = 0;
uint8_t led[65];
USBDevice::readEP(EPINT_OUT, led, &bytesRead, MAX_HID_REPORT_SIZE);
Expand Down
2 changes: 1 addition & 1 deletion libraries/USBDevice/USBHID/USBKeyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class USBKeyboard: public USBHID, public Stream {
*
* @returns if handle by subclass, return true
*/
virtual bool EP1_OUT_callback();
virtual bool EPINT_OUT_callback();

/**
* Read status of lock keys. Useful to switch-on/off leds according to key pressed. Only the first three bits of the result is important:
Expand Down
2 changes: 1 addition & 1 deletion libraries/USBDevice/USBHID/USBMouseKeyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ uint8_t * USBMouseKeyboard::reportDesc() {
return NULL;
}

bool USBMouseKeyboard::EP1_OUT_callback() {
bool USBMouseKeyboard::EPINT_OUT_callback() {
uint32_t bytesRead = 0;
uint8_t led[65];
USBDevice::readEP(EPINT_OUT, led, &bytesRead, MAX_HID_REPORT_SIZE);
Expand Down
2 changes: 1 addition & 1 deletion libraries/USBDevice/USBHID/USBMouseKeyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class USBMouseKeyboard: public USBHID, public Stream
*
* @returns if handle by subclass, return true
*/
virtual bool EP1_OUT_callback();
virtual bool EPINT_OUT_callback();


private:
Expand Down
2 changes: 1 addition & 1 deletion libraries/USBDevice/USBMIDI/USBMIDI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void USBMIDI::attach(void (*fptr)(MIDIMessage)) {
}


bool USBMIDI::EP2_OUT_callback() {
bool USBMIDI::EPBULK_OUT_callback() {
uint8_t buf[64];
uint32_t len;
readEP(EPBULK_OUT, buf, &len, 64);
Expand Down
2 changes: 1 addition & 1 deletion libraries/USBDevice/USBMIDI/USBMIDI.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class USBMIDI: public USBDevice {


protected:
virtual bool EP2_OUT_callback();
virtual bool EPBULK_OUT_callback();
virtual bool USBCallback_setConfiguration(uint8_t configuration);
/*
* Get string product descriptor
Expand Down
4 changes: 2 additions & 2 deletions libraries/USBDevice/USBMSD/USBMSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void USBMSD::reset() {


// Called in ISR context called when a data is received
bool USBMSD::EP2_OUT_callback() {
bool USBMSD::EPBULK_OUT_callback() {
uint32_t size = 0;
uint8_t buf[MAX_PACKET_SIZE_EPBULK];
readEP(EPBULK_OUT, buf, &size, MAX_PACKET_SIZE_EPBULK);
Expand Down Expand Up @@ -184,7 +184,7 @@ bool USBMSD::EP2_OUT_callback() {
}

// Called in ISR context when a data has been transferred
bool USBMSD::EP2_IN_callback() {
bool USBMSD::EPBULK_IN_callback() {
switch (stage) {

// the device has to send data to the host
Expand Down
4 changes: 2 additions & 2 deletions libraries/USBDevice/USBMSD/USBMSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ class USBMSD: public USBDevice {
/*
* Callback called when a packet is received
*/
virtual bool EP2_OUT_callback();
virtual bool EPBULK_OUT_callback();

/*
* Callback called when a packet has been sent
*/
virtual bool EP2_IN_callback();
virtual bool EPBULK_IN_callback();

/*
* Set configuration of device. Add endpoints
Expand Down
2 changes: 1 addition & 1 deletion libraries/USBDevice/USBSerial/USBSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ bool USBSerial::writeBlock(uint8_t * buf, uint16_t size) {



bool USBSerial::EP2_OUT_callback() {
bool USBSerial::EPBULK_OUT_callback() {
uint8_t c[65];
uint32_t size = 0;

Expand Down
2 changes: 1 addition & 1 deletion libraries/USBDevice/USBSerial/USBSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class USBSerial: public USBCDC, public Stream {
}

protected:
virtual bool EP2_OUT_callback();
virtual bool EPBULK_OUT_callback();
virtual void lineCodingChanged(int baud, int bits, int parity, int stop){
if (settingsChangedCallback) {
settingsChangedCallback(baud, bits, parity, stop);
Expand Down