Skip to content

Commit

Permalink
V. 2.3.2 : eliminated usage of NULL to fix gcc compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
leomil72 committed Nov 1, 2016
1 parent 6a93e1b commit 95127d3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ More infos can be found in the attached user's guide (PDF).
***********************
Version history

v. 2.3.2: eliminated usage of NULL to fix gcc compiler warnings
v. 2.3.1: added compatibility with Arduino IDE >= 1.6.7
v. 2.3.0: fixed a critical bug that lead to infinite execution of task 0 (also if ONETIME)
v. 2.2.3: set the WDT timer to 2s when the watchdog is used to reset the MCU to avoid infinite resets.
Expand Down Expand Up @@ -240,4 +241,4 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
***********************
Document revision

14th revision: 2016/02/20
15th revision: 2016/11/01
6 changes: 3 additions & 3 deletions leOS2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ uint8_t leOS2::restartTask(void (*userTask)(void)) {
//modify an existing task
uint8_t leOS2::modifyTask(void (*userTask)(void), unsigned long taskInterval, uint8_t oneTimeTask) {
if ((oneTimeTask < SCHEDULED) && (oneTimeTask > ONETIME)) {
oneTimeTask = NULL;
oneTimeTask = NONE;
}

if ((taskInterval < 1) || (taskInterval > MAX_TASK_INTERVAL)) {
Expand All @@ -111,7 +111,7 @@ uint8_t leOS2::modifyTask(void (*userTask)(void), unsigned long taskInterval, ui
do {
if (tasks[tempI].taskPointer == *userTask) { //found the task
tasks[tempI].userTasksInterval = taskInterval;
if (oneTimeTask != NULL) {
if (oneTimeTask != NONE) {
tasks[tempI].taskIsActive = oneTimeTask;
}
tasks[tempI].plannedTask = _ticksCounter + taskInterval;
Expand All @@ -138,7 +138,7 @@ uint8_t leOS2::setTask(void (*userTask)(void), uint8_t tempStatus, unsigned long
if (tasks[tempI].taskPointer == *userTask) {
tasks[tempI].taskIsActive = tempStatus;
if (tempStatus == SCHEDULED) {
if (taskInterval == NULL) {
if (taskInterval == NONE) {
tasks[tempI].plannedTask = _ticksCounter + tasks[tempI].userTasksInterval;
} else {
tasks[tempI].plannedTask = _ticksCounter + taskInterval;
Expand Down
7 changes: 4 additions & 3 deletions leOS2.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@


//library version
#define leOS2_VERSION 231
#define leOS2_VERSION 232


//this library is compatible both with Arduino <=0023 and Arduino >=100
Expand Down Expand Up @@ -66,6 +66,7 @@ const uint8_t SCHEDULED = 1; //0b00000001
const uint8_t SCHEDULED_IMMEDIATESTART = 5; //0b00000101
const uint8_t IMMEDIATESTART = SCHEDULED_IMMEDIATESTART; //alias for previous
const uint8_t ONETIME = 2;
const uint8_t NONE = 255;



Expand All @@ -79,7 +80,7 @@ class leOS2 {
uint8_t removeTask(void (*)(void));
uint8_t pauseTask(void (*)(void));
uint8_t restartTask(void (*)(void));
uint8_t modifyTask(void (*)(void), unsigned long, uint8_t oneTimeTask = NULL);
uint8_t modifyTask(void (*)(void), unsigned long, uint8_t oneTimeTask = NONE);
uint8_t getTaskStatus(void (*)(void));
uint32_t convertMs(uint32_t);
void haltScheduler(void);
Expand All @@ -88,7 +89,7 @@ class leOS2 {
private:
//private methods
void setWDT();
uint8_t setTask(void (*)(void), uint8_t, unsigned long taskInterval = NULL);
uint8_t setTask(void (*)(void), uint8_t, unsigned long taskInterval = NONE);
};


Expand Down
2 changes: 1 addition & 1 deletion library.properties
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=leOS2
version=2.3.1
version=2.3.2
author=Leonardo Miliani
maintainer=Leonardo Miliani
sentence=Simple scheduler based on watchdog that runs little tasks within IRS
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.1
2.3.2

0 comments on commit 95127d3

Please sign in to comment.