SapFlow Probe
A low-cost HRM probe for measuring a tree's water consumption
schedule.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <OPEnS_RTC.h>
4 #include <LowPower.h>
5 #include "pinout.h"
6 #include "measure.h"
7 #include "debug.h"
8 
9 static struct pt sched_thd;
10 
11 static RTC_DS3231 rtc_ds;
12 
13 static bool sleep;
14 
21 void alarmISR(void);
22 
37 void feather_sleep( void );
38 
48 void sleep_cycle( int interval = 5 );
49 
61 int schedule(struct pt *pt = &sched_thd);
rtc_ds
static RTC_DS3231 rtc_ds
Instance of our real-time clock.
Definition: schedule.h:11
sched_thd
static struct pt sched_thd
Protothread control structure for measure()
Definition: schedule.h:9
alarmISR
void alarmISR(void)
Interrupt handler for RTC alarm.
Definition: schedule.cpp:5
schedule
int schedule(struct pt *pt=&sched_thd)
Controls general measurement schedule.
Definition: schedule.cpp:81
sleep_cycle
void sleep_cycle(int interval=5)
Sleep function for periodic sleeping.
Definition: schedule.cpp:67
pinout.h
sleep
static bool sleep
Global flag to prep for sleep.
Definition: schedule.h:13
debug.h
measure.h
feather_sleep
void feather_sleep(void)
Maximizes power savings during sleep.
Definition: schedule.cpp:13