1 year, 10 months ago.

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


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

1 Answer

1 year, 10 months ago.

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

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

Accepted Answer