Calling xTaskCreate on C++ member function?
Posted: Thu Jun 08, 2017 4:36 am
Hi all, just wondering how to call xTaskCreate on a member function in a c++ class? The intent is as per the code below, which does not compile with the error "reference to a non-static member function must be called".
Also open to suggestions if there is a better way to achieve the same result whilst still keeping everything encapsulated within the class.
Also open to suggestions if there is a better way to achieve the same result whilst still keeping everything encapsulated within the class.
Code: Select all
class HttpServer {
public: void Start(void)
{
xTaskCreate(this->ListenerThread, "HttpListenerThread", 2048, NULL, 5, NULL);
}
void ListenerThread(void *pvParameters)
{
// Handle the request here
}
};