22
22
#include " USBDevice_Types.h"
23
23
#include " USBPhy.h"
24
24
#include " mbed_critical.h"
25
+ #include " Callback.h"
25
26
26
27
/* *
27
28
* \defgroup drivers_USBDevice USBDevice class
@@ -139,7 +140,7 @@ class USBDevice: public USBPhyEvents {
139
140
* @param callback Method pointer to be called when a packet is transferred
140
141
* @returns true if successful, false otherwise
141
142
*/
142
- bool endpoint_add (usb_ep_t endpoint, uint32_t max_packet, usb_ep_type_t type, ep_cb_t callback = NULL );
143
+ bool endpoint_add (usb_ep_t endpoint, uint32_t max_packet, usb_ep_type_t type, mbed::Callback< void ()> callback = NULL);
143
144
144
145
/* *
145
146
* Add an endpoint
@@ -153,7 +154,7 @@ class USBDevice: public USBPhyEvents {
153
154
template <typename T>
154
155
bool endpoint_add (usb_ep_t endpoint, uint32_t max_packet, usb_ep_type_t type, void (T::*callback)())
155
156
{
156
- return endpoint_add (endpoint, max_packet, type, static_cast <ep_cb_t >(callback));
157
+ return endpoint_add (endpoint, max_packet, type, mbed::callback ( this , static_cast <ep_cb_t >(callback) ));
157
158
}
158
159
159
160
/* *
@@ -540,7 +541,7 @@ class USBDevice: public USBPhyEvents {
540
541
void _complete_set_interface ();
541
542
542
543
struct endpoint_info_t {
543
- ep_cb_t callback;
544
+ mbed::Callback< void ()> callback;
544
545
uint16_t max_packet_size;
545
546
uint16_t transfer_size;
546
547
uint8_t flags;
0 commit comments