Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
6 years, 3 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
6 years, 3 months ago.
Yes, return type must be void as the function signature shows:
attach(Callback<void()> func, IrqType type=RxIrq)