I'm trying to make an EventQueue call inside a method attached to a Ticker. The EventQueue, and context thread is declared within the class which holds the method in question. A simplified example:
class EventHandler
{
public:
EventHandler() {
t.set_priority(osPriorityRealtime);
t.start(callback(&queue, &EventQueue::dispatch_forever));
}
void handler() {
//Do whatever
queue.call(&exobj, &ExampleObject::update, 0x0); //call update within user context, with state exobj, and parameter 0x0
}
private:
ExampleObject exobj;
Thread t;
EventQueue queue;
}
Main File:
int main() {
EventHandler eventhandler;
Ticker tick;
tick.attach(&eventhandler, EventHandler::handler, 1); //call handle periodically
}
On compilation, the following error is displayed:
Error: Expression preceding parentheses of apparent call must have (pointer-to-) function type in "extras/mbed-os.lib/events/EventQueue.h", Line: 2883, Col: 14
Can anyone explain this? I have followed the correct syntax for making calls on the EventQueue
No comments:
Post a Comment