8 years, 1 month ago.

Deprecated method mbed::InterruptIn::fall

Hi. I obtain a deprecated method error on InterruptIn *Wiegand0D0; Wiegand0D0->fall(this, &Wiegand::Wiegand0D0Read);

"this" is the pointer to my class "&Wiegand::Wiegand0D0Read" is the pointer to my method.

This is the error Warning: Function "mbed::InterruptIn::fall(T *, M) [with T=Wiegand, M=void (Wiegand::*)()]" (declared at <a href="#" onmousedown="mbed_doc_goto('/CCAInterfaceextras/mbed_0ab6a29f35bf/drivers/InterruptIn.h', '126'); return false;">/extras/mbed_0ab6a29f35bf/drivers/InterruptIn.h:126</a>) was declared deprecated ("The fall function does not support cv-qualifiers. Replaced by fall(callback(obj, method)). [since mbed-os-5.1]") in "wiegand.cpp", Line: 17, Col: 38

How have I to upgrade my code to the new attroach?

Regards.

1 Answer

8 years, 1 month ago.

Hi Denis,

Just use the callback function builder named "callback":

InterruptIn *Wiegand0D0; 
Wiegand0D0->fall(callback(this, &Wiegand::Wiegand0D0Read));

Accepted Answer