Skip to content

Commit

Permalink
Support Library manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Makuna committed Jan 26, 2016
1 parent 9bf1ac3 commit 7567d9d
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/BlinkUsingTaskFunction/BlinkUsingTaskFunction.ino
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ int ledPin = 13; // BUILTIN_LED

TaskManager taskManager;

// foreward delcare functions passed to task constructors now required
void OnUpdateTaskLedOn(uint32_t deltaTime);
void OnUpdateTaskLedOff(uint32_t deltaTime);

FunctionTask taskTurnLedOn(OnUpdateTaskLedOn, MsToTaskTime(400)); // turn on the led in 400ms
FunctionTask taskTurnLedOff(OnUpdateTaskLedOff, MsToTaskTime(600)); // turn off the led in 600ms

Expand Down
7 changes: 7 additions & 0 deletions examples/ButtonInterrupt/ButtonInterrupt.ino
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@

TaskManager taskManager;

// foreward delcare functions passed to task constructors now required
void OnAButtonChanged(ButtonState state);
void OnBButtonChanged(ButtonState state);
void OnUpdateTaskLedOn(uint32_t deltaTime);
void OnUpdateTaskLedOff(uint32_t deltaTime);
void OnAutoSleep(uint32_t deltaTime);

ButtonTask AButtonTask(OnAButtonChanged, AButtonPin);
ButtonTask BButtonTask(OnBButtonChanged, BButtonPin);
FunctionTask taskTurnLedOn(OnUpdateTaskLedOn, MsToTaskTime(400)); // turn on the led in 400ms
Expand Down
3 changes: 3 additions & 0 deletions examples/ButtonTask/ButtonTask.ino
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
#include "ButtonTask.h" // this implements the button task

TaskManager taskManager;
void HandleAButtonChanged(ButtonState state);
void HandleBButtonChanged(ButtonState state);

// foreward delcare functions passed to task constructors now required
ButtonTask AButtonTask(HandleAButtonChanged, AButtonPin);
ButtonTask BButtonTask(HandleBButtonChanged, BButtonPin);

Expand Down
4 changes: 4 additions & 0 deletions examples/MessageTask/MessageTask.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@

TaskManager taskManager;

// foreward delcare functions passed to task constructors now required
void OnHeartBeatOn(uint32_t deltaTime);
void OnHeartBeatOff(uint32_t deltaTime);

MainTask mainTask;
ButtonTask buttonATask(&mainTask, AButtonPin);
ButtonTask buttonBTask(&mainTask, BButtonPin);
Expand Down
9 changes: 9 additions & 0 deletions library.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name=Task by Makuna
version=1.0
author=Michael C. Miller ([email protected])
maintainer=Michael C. Miller ([email protected])
sentence=A library that makes creating complex mulitple task projects easy.
paragraph=This implements a Nonpreemptive multitasking library which is effecient in speed and memory, which is good for small Arduino hardware. While multitasking is an advanced topic, our friends at AdaFruit have a great article on it here (https://learn.adafruit.com/multi-tasking-the-arduino-part-1?view=all), Samples include blinking an LED without using delay(), monitoring and reacting to a button press, and cross task messaging. Tested on esp8266.
category=Timing
url=https://github.com/Makuna/Task
architectures=*
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 7567d9d

Please sign in to comment.