Skip to content

Commit

Permalink
Add in timer support for TS
Browse files Browse the repository at this point in the history
  • Loading branch information
lbussy committed Nov 28, 2020
1 parent 9f827dd commit c3be219
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ void loop()
Ticker brewfTimer;
brewfTimer.attach(config.brewfather.freq * 60, setDoBrewfTarget);

// ThingSpeak timer
Ticker tsTimer;
tsTimer.attach(config.brewfather.freq * 60, setDoBFTarget);

while (true)
{
// Handle semaphores - No radio work in a Ticker!
Expand Down
5 changes: 5 additions & 0 deletions src/tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ void setDoBrewfTarget()
doBrewfTarget = true; // Semaphore required for Ticker + radio event
}

void setDoTSTarget()
{
doTSTarget = true; // Semaphore required for Ticker + radio event
}

void setDoOTA()
{
doOTA = true; // Semaphore required for OTA in callback
Expand Down
1 change: 1 addition & 0 deletions src/tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ void setDoOTA();
static bool __attribute__((unused)) doURLTarget = false; // Semaphore for Target timer
static bool __attribute__((unused)) doBFTarget = false; // Semaphore for BF timer
static bool __attribute__((unused)) doBrewfTarget = false; // Semaphore for BRF timer
static bool __attribute__((unused)) doTSTarget = false; // Semaphore for TS timer
static bool __attribute__((unused)) doReset = false; // Semaphore for reset
static bool __attribute__((unused)) doOTA = false; // Semaphore for reset
static bool __attribute__((unused)) doNonBlock = false; // Semaphore for non-blocking portal
Expand Down

0 comments on commit c3be219

Please sign in to comment.