Replace the old deprecated callbacks

pull/5954/head
Abdelhak Bougouffa 2017-12-02 17:08:43 +01:00 committed by Cruz Monrreal II‰
parent 379daa653d
commit 597633d445
3 changed files with 5 additions and 5 deletions

View File

@ -106,7 +106,7 @@ public:
template<typename T>
inline void onDisconnect(uint8_t intf_nb, T* tptr, void (T::*mptr)(void)) {
if ((mptr != NULL) && (tptr != NULL)) {
intf[intf_nb].detach.attach(tptr, mptr);
intf[intf_nb].detach = callback(tptr, mptr);
}
}
@ -118,7 +118,7 @@ public:
*/
inline void onDisconnect(uint8_t intf_nb, void (*fn)(void)) {
if (fn != NULL) {
intf[intf_nb].detach.attach(fn);
intf[intf_nb].detach = fn;
}
}

View File

@ -89,7 +89,7 @@ public:
template<typename T>
inline void attach(T* tptr, void (T::*mptr)(void)) {
if((mptr != NULL) && (tptr != NULL)) {
rx.attach(tptr, mptr);
rx = callback(tptr, mptr);
}
}
@ -100,7 +100,7 @@ public:
*/
inline void attach(void (*fptr)(void)) {
if(fptr != NULL) {
rx.attach(fptr);
rx = fptr;
}
}

View File

@ -312,7 +312,7 @@ USBHost::USBHost() : usbThread(osPriorityNormal, USB_THREAD_STACK)
}
#endif
usbThread.start(this, &USBHost::usb_process);
usbThread.start(callback(this, &USBHost::usb_process));
}
USBHost::Lock::Lock(USBHost* pHost) : m_pHost(pHost)