Skip to content

Commit b6aba2f

Browse files
authored
Fix bug in templated attach function
The arguments passed to `Callback<void()>`'s constructor were the wrong way round, thus preventing the `attach` function from being instantiated. This patch corrects that by switching the order of the arguments.
1 parent d20b591 commit b6aba2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

features/unsupported/USBDevice/USBSerial/USBSerial.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ class USBSerial: public USBCDC, public Stream {
126126
*/
127127
template<typename T>
128128
void attach(T* tptr, void (T::*mptr)(void)) {
129-
if((mptr != NULL) && (tptr != NULL)) {
130-
rx = Callback<void()>(mptr, tptr);
129+
if((tptr != NULL) && (mptr != NULL)) {
130+
rx = Callback<void()>(tptr, mptr);
131131
}
132132
}
133133

0 commit comments

Comments
 (0)