From b6aba2f985103c7848550cd35e673d65c50fa682 Mon Sep 17 00:00:00 2001 From: Pharap <2933055+Pharap@users.noreply.github.com> Date: Thu, 10 Jan 2019 21:16:13 +0000 Subject: [PATCH] Fix bug in templated attach function The arguments passed to `Callback`'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. --- features/unsupported/USBDevice/USBSerial/USBSerial.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/unsupported/USBDevice/USBSerial/USBSerial.h b/features/unsupported/USBDevice/USBSerial/USBSerial.h index 69ed61abf5..b2ad0d51df 100644 --- a/features/unsupported/USBDevice/USBSerial/USBSerial.h +++ b/features/unsupported/USBDevice/USBSerial/USBSerial.h @@ -126,8 +126,8 @@ public: */ template void attach(T* tptr, void (T::*mptr)(void)) { - if((mptr != NULL) && (tptr != NULL)) { - rx = Callback(mptr, tptr); + if((tptr != NULL) && (mptr != NULL)) { + rx = Callback(tptr, mptr); } }