Report
3 weeks, 2 days ago.

When using Ticker, must attached function's return type be void?

/media/uploads/TakujiMatsumoto/---------_2018-11-21_1.03.50.png

When I changed MotorDriver::communication's return type to void , build succeeds. But when I using int, build would fail. Is this a specification or my mistake? The compiler says "no matching function for call to 'mbed::Ticker::attach(mbed::Callback<int()>, float&)'" on Ticker.h 95

/media/uploads/TakujiMatsumoto/main.cpp /media/uploads/TakujiMatsumoto/motordriver.cpp /media/uploads/TakujiMatsumoto/motordriver.h

Comment on this question

1 Answer

2 weeks, 3 days ago.

Yes, return type must be void as the function signature shows:

attach(Callback<void()> func, IrqType type=RxIrq)


To post an answer, please log in.