diff --git a/inc/MicroBitMessageBus.h b/inc/MicroBitMessageBus.h index fdace6a..a31e7fb 100644 --- a/inc/MicroBitMessageBus.h +++ b/inc/MicroBitMessageBus.h @@ -177,7 +177,7 @@ class MicroBitMessageBus : public MicroBitComponent * uBit.MessageBus.ignore(MICROBIT_ID_BUTTON_B, MICROBIT_BUTTON_EVT_CLICK, onButtonBClick); * @endcode */ - void ignore(int id, int value, void (*handler)(MicroBitEvent, void*), void* arg); + void ignore(int id, int value, void (*handler)(MicroBitEvent, void*)); /** * Unregister a listener function. diff --git a/source/MicroBitMessageBus.cpp b/source/MicroBitMessageBus.cpp index 3d7b999..be5c1ff 100644 --- a/source/MicroBitMessageBus.cpp +++ b/source/MicroBitMessageBus.cpp @@ -341,12 +341,13 @@ void MicroBitMessageBus::ignore(int id, int value, void (*handler)(MicroBitEvent * uBit.MessageBus.ignore(MICROBIT_ID_BUTTON_B, MICROBIT_BUTTON_EVT_CLICK, onButtonBClick); * @endcode */ -void MicroBitMessageBus::ignore(int id, int value, void (*handler)(MicroBitEvent, void*), void* arg) +void MicroBitMessageBus::ignore(int id, int value, void (*handler)(MicroBitEvent, void*)) { if (handler == NULL) return; - MicroBitListener listener(id, value, handler, arg); + // The remove function is not comparing the [arg] anyhow. + MicroBitListener listener(id, value, handler, NULL); remove(&listener); }