From 597633d4455627055d92e3b56a469ac32463c3bf Mon Sep 17 00:00:00 2001 From: Abdelhak Bougouffa Date: Sat, 2 Dec 2017 17:08:43 +0100 Subject: [PATCH] Replace the old deprecated callbacks --- features/unsupported/USBHost/USBHost/USBDeviceConnected.h | 4 ++-- features/unsupported/USBHost/USBHost/USBEndpoint.h | 4 ++-- features/unsupported/USBHost/USBHost/USBHost.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/features/unsupported/USBHost/USBHost/USBDeviceConnected.h b/features/unsupported/USBHost/USBHost/USBDeviceConnected.h index f74c4b6e4b..88dd6dbbbf 100644 --- a/features/unsupported/USBHost/USBHost/USBDeviceConnected.h +++ b/features/unsupported/USBHost/USBHost/USBDeviceConnected.h @@ -106,7 +106,7 @@ public: template 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; } } diff --git a/features/unsupported/USBHost/USBHost/USBEndpoint.h b/features/unsupported/USBHost/USBHost/USBEndpoint.h index 5b1287f421..d0d9fd4231 100644 --- a/features/unsupported/USBHost/USBHost/USBEndpoint.h +++ b/features/unsupported/USBHost/USBHost/USBEndpoint.h @@ -89,7 +89,7 @@ public: template 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; } } diff --git a/features/unsupported/USBHost/USBHost/USBHost.cpp b/features/unsupported/USBHost/USBHost/USBHost.cpp index b9424f73f1..518d00d94f 100644 --- a/features/unsupported/USBHost/USBHost/USBHost.cpp +++ b/features/unsupported/USBHost/USBHost/USBHost.cpp @@ -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)