-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcommon.h
54 lines (38 loc) · 1.24 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*#pragma once is accepted for compatibility with other compilers,
+and enables you to use other forms of header guard coding.
However, ARM recommends to use #ifndef and #define coding
because this is more portable.*/
#ifndef COMMON_H
#define COMMON_H
#include "rtos.h"
//https://os.mbed.com/docs/mbed-os/v5.14/apis/eventflags.html
#define TEST_MODE (1UL << 0)
#define NORMAL_MODE (1UL << 1)
#define ADVANCED_MODE (1UL << 2)
#define ERROR_MODE (1UL << 3)
#define TEST_MODE_TIME 2
#define NORMAL_MODE_TIME 30
#define ADVANCED_MODE_TIME 0.5
extern int current_mode;
extern Thread soilmoisture_thread;
extern void soilmoisture_callback();
extern float valueSM;
extern Thread lightsensor_thread;
extern void lightsensor_callback();
extern float valueLight;
extern struct Gps_info gps_info;
extern Thread gps_thread;
//extern void gps_callback();
extern Thread i2c_thread;
extern void i2c_callback();
extern float hum, temp;
extern int clear_value, red_value, green_value, blue_value;
extern char dominant_colour;
extern float x, y, z;
extern Serial pc;
extern EventFlags event_flags;
//TODO: arreglar
extern DigitalOut ledR; //RGB led - red light
extern DigitalOut ledG; //RGB led - green light
extern DigitalOut ledB; //RGB led - blue light
#endif