8 years, 1 month ago.

USBHost library not building

Hello,

I am using MBED OS 5 and i am adding USBHost library to my project. I cant get it to compile straight away, i had to remove the rtos and the fatfilesystem directories because mbed alread has them. I get these warnings: .././USBHost/USBHost/USBEndpoint.h:92:13: warning: 'void mbed::Callback<R()>::attach(U*, R (T::*)()) [with T = USBHostKeyboard; U = USBHostKeyboard; R = void]' is deprecated (declared at .././mbed-os/platform/Callback.h:297): Replaced by simple assignment 'Callback cb = func [since mbed-os-5.4] [-Wdeprecated-declarations] rx.attach(tptr, mptr);

Any body has a solution for this ?

Thanks

1 Answer

8 years ago.

You don't even need to add the USBHost library to your project, it's actually in Mbed OS: https://github.com/ARMmbed/mbed-os/tree/master/features/unsupported/USBHost

The warning can be fixed by changing line 92 to:

            rx.attach(callback(tptr, mptr);

But it's a warning, so shouldn't affect your program.

Accepted Answer

Jan, Thanks for you reply, Any reasons why this is under unsupported? will this go away in the future?

posted by Nart Schinackow 27 Sep 2017

I think mostly because it does not fit in core Mbed OS, or because there is no active maintainer to the library. Not sure if they'll be removed at some point (aka spun out into a separate library).

posted by Jan Jongboom 27 Sep 2017