diff --git a/ThreadController.cpp b/ThreadController.cpp index 68ea202..f1ad0e2 100644 --- a/ThreadController.cpp +++ b/ThreadController.cpp @@ -105,7 +105,7 @@ bool ThreadController::add(Thread* _thread){ void ThreadController::remove(size_t id){ // Find Threads with the id, and removes for(int i = 0; i < MAX_THREADS; i++){ - if(thread[i]->ThreadID == id){ + if(thread[i] && thread[i]->ThreadID == id){ thread[i] = NULL; cached_size--; return; diff --git a/ThreadController.h b/ThreadController.h index 2ed46a3..08d03d9 100644 --- a/ThreadController.h +++ b/ThreadController.h @@ -19,7 +19,9 @@ #include "Thread.h" #include "inttypes.h" +#ifndef MAX_THREADS #define MAX_THREADS 32 +#endif class ThreadController: public Thread{ protected: diff --git a/library.json b/library.json index 975f790..38c1466 100644 --- a/library.json +++ b/library.json @@ -1,12 +1,13 @@ { - "name": "Thread", + "name": "ArduinoThread", "keywords": "thread, task", - "description": "A library for managing the periodic execution of multiple tasks", + "description": "A library for managing the periodic execution of multiple tasks. Forked from ivanseidel/ArduinoThread", "repository": { "type": "git", - "url": "https://github.com/ivanseidel/ArduinoThread.git" + "url": "https://github.com/meshtastic/ArduinoThread.git" }, "frameworks": "arduino", + "headers": ["Thread.h", "ThreadController.h","StaticThreadController.h"], "platforms": "atmelavr" }