ivanseidel / ArduinoThread

⏳ A simple way to run Threads on Arduino
MIT License
955 stars 196 forks source link

in ThreadController.cpp #1

Closed patrickelectric closed 10 years ago

patrickelectric commented 10 years ago

Thread::Thread() have a problem to Arduino can be solved with only "Thread();" line 8

ivanseidel commented 10 years ago

Can you post the code and the error generated? Thread::Thread(); should call Thread's constructor inside ThreadController, inherited from Thread in order to keep things working.

patrickelectric commented 10 years ago
ThreadController.cpp: In constructor 'ThreadController::ThreadController(long int)':
ThreadController.cpp:8:17: error: cannot call constructor 'ThreadController::Thread' directly [-fpermissive]
ThreadController.cpp:8:17: error:   for a function-style cast, remove the redundant '::Thread' [-fpermissive]

I just compile SimplreThread

ivanseidel commented 10 years ago

That's really weird. What version of Arduino and what targeting Platform?

patrickelectric commented 10 years ago

Arduino 1:1.05+dfsg2-1 avr-g++ (GCC) 4.7.2 nano328

ivanseidel commented 10 years ago

Please @patrickelectric , Change to this and test if everything works. I cannot simulate your error here.

ThreadController::ThreadController(long _interval): Thread(){
    cached_size = 0;

    clear();
    setInterval(_interval);

    #ifdef USE_THREAD_NAMES
        // Overrides name
        ThreadName = "ThreadController ";
        ThreadName = ThreadName + ThreadID;
    #endif
}
patrickelectric commented 10 years ago

ty @ivanseidel this solved my problem.

ivanseidel commented 10 years ago

Please @patrickelectric , clone the repository egain, I have pushed to master the hot-fix