Skip to content

Commit fd06eb2

Browse files
committed
Replace the old deprecated callbacks
1 parent 70e7b40 commit fd06eb2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

features/unsupported/USBHost/USBHost/USBDeviceConnected.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class USBDeviceConnected
106106
template<typename T>
107107
inline void onDisconnect(uint8_t intf_nb, T* tptr, void (T::*mptr)(void)) {
108108
if ((mptr != NULL) && (tptr != NULL)) {
109-
intf[intf_nb].detach.attach(tptr, mptr);
109+
intf[intf_nb].detach = callback(tptr, mptr);
110110
}
111111
}
112112

@@ -118,7 +118,7 @@ class USBDeviceConnected
118118
*/
119119
inline void onDisconnect(uint8_t intf_nb, void (*fn)(void)) {
120120
if (fn != NULL) {
121-
intf[intf_nb].detach.attach(fn);
121+
intf[intf_nb].detach = fn;
122122
}
123123
}
124124

features/unsupported/USBHost/USBHost/USBEndpoint.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class USBEndpoint
8989
template<typename T>
9090
inline void attach(T* tptr, void (T::*mptr)(void)) {
9191
if((mptr != NULL) && (tptr != NULL)) {
92-
rx.attach(tptr, mptr);
92+
rx = callback(tptr, mptr);
9393
}
9494
}
9595

@@ -100,7 +100,7 @@ class USBEndpoint
100100
*/
101101
inline void attach(void (*fptr)(void)) {
102102
if(fptr != NULL) {
103-
rx.attach(fptr);
103+
rx = fptr;
104104
}
105105
}
106106

features/unsupported/USBHost/USBHost/USBHost.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ USBHost::USBHost() : usbThread(osPriorityNormal, USB_THREAD_STACK)
312312
}
313313
#endif
314314

315-
usbThread.start(this, &USBHost::usb_process);
315+
usbThread.start(callback(this, &USBHost::usb_process));
316316
}
317317

318318
USBHost::Lock::Lock(USBHost* pHost) : m_pHost(pHost)

0 commit comments

Comments
 (0)