-
Notifications
You must be signed in to change notification settings - Fork 1
/
obi-common.h
40 lines (32 loc) · 950 Bytes
/
obi-common.h
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
#ifndef OBI_COMMON_H
#define OBI_COMMON_H
#include "Syslog.h"
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
extern void relay_set (bool on_p);
extern bool relay_get_state (void);
/* Hard wired on PCB. */
extern const int pin_relay_on;
extern const int pin_relay_off;
extern const int pin_led_wifi;
extern const int pin_btn;
enum state {
st_config,
st_connecting,
st_running,
st_flashing,
};
extern enum state state;
extern Syslog syslog;
extern bool have_syslog_p;
extern const char obi_git_commit[];
extern const char obi_build_timestamp[];
#if 1
# define obi_print(...) do { Serial.print (__VA_ARGS__); Serial.flush (); } while (0)
# define obi_printf(...) do { Serial.printf (__VA_ARGS__); Serial.flush (); } while (0)
# define obi_println(...) do { Serial.println (__VA_ARGS__); Serial.flush (); } while (0)
#else
# define obi_print(...)
# define obi_printf(...)
# define obi_println(...)
#endif
#endif /* OBI_COMMON_H */