pump.h
962 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef __PUMP_H_
#define __PUMP_H_
#include <string.h>
#include "pcf.h"
#include "mqtt.h"
// Number = pcfPIN - one action per pin / no diode crap anymore
#define dive 1
#define diaphragm 2
#define peristaltic 3
#define peristaltic_reverse 4
#define src_valve_pump 5
#define dst_valve_rotate 6
#define dst_valve_flower 7u
#define off 0
struct sequence {
struct action *action;
int pump;
int src_valve;
int dst_valve;
double start;
double end;
struct sequence *next;
};
struct sequence *sequence_head = NULL;
struct sequence *sequence_tail = NULL;
const int startpumpheight = 50;
const int stoppumpheight = 5;
int waterlevel = 0;
unsigned int pumpstate = 0;
unsigned long timeStored = 0;
int pump_start(struct action *ptr);
int pump_start(struct button *ptr);
void pump_running(int remaining);
void pump_end(struct action *ptr);
void pump_end(struct button *ptr);
void pump_end(int source);
void set_relay(struct sequence *step);
#endif