4 years, 9 months ago.

Interrupts functions have been declared deprecated

When compiling my code that does contain functions attached to rise and fall of interruption pins I got a warning saying that those functions (fall and rise) have been deprecated

What does this implies? and what is the correct way of doing things now?

2 Answers

4 years, 9 months ago.

The warning should have prompted the correct usage. If you got that message it most likely means you were attaching an objects member function. This method of handling functions was prohibiting the use of const or volatile arguments which needed updating.

"The rise function does not support cv-qualifiers. Replaced by rise(callback(obj, method))."
pin.rise(obj, method);
// but should be
pin.rise(callback(obj, method));
pin.fall(callback(obj, method));

The docs are currently messy but you can get an early look at what they will look like with a few more patches landed. There will be a clear deprecated list https://docs.mbed.com/docs/sam-doxy-test/en/fix-the-docs/api/deprecated.html and the inline documentation in the API will show this as well https://docs.mbed.com/docs/sam-doxy-test/en/fix-the-docs/api/classmbed_1_1InterruptIn.html.

These will be rendered and integrated in the official API page https://docs.mbed.com/docs/mbed-os-api-reference/en/latest/APIs/io/InterruptIn/

Accepted Answer

Thanks. It works now. (btw, the warning did not prompt the correct usage- it gave a broken link)

posted by Cristian Fuentes 26 Apr 2017
4 years, 9 months ago.

Edit: fixed now should use ticker, not timer this fixed this error

is this the reason that I have this error ?


main.cpp(120): error: #135: class "mbed::Timer" has no member "attach_uS"

how can I get the systick interrupt callback or an mS callback running ?

The function is attach_us not attach_uS

posted by Andy A 07 Sep 2017