SEDO subject project

Dependencies:   ds3231 mbed-rtos mbed DHT

Committer:
ValenSalLop
Date:
Mon May 15 18:30:20 2017 +0000
Revision:
12:1d544cdab2cf
Parent:
9:5e9c4277151d
final;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ValenSalLop 9:5e9c4277151d 1 /*
ValenSalLop 9:5e9c4277151d 2 * MAIN.H
ValenSalLop 9:5e9c4277151d 3 */
ValenSalLop 9:5e9c4277151d 4 #ifndef MAIN_H
ValenSalLop 9:5e9c4277151d 5 #define MAIN_H
ValenSalLop 9:5e9c4277151d 6 #define MAX_TIME_TO_WAIT_NODE_COMM 13
ValenSalLop 9:5e9c4277151d 7
ValenSalLop 9:5e9c4277151d 8 struct SensorData{
ValenSalLop 9:5e9c4277151d 9 float temperature;
ValenSalLop 9:5e9c4277151d 10 float humidity;
ValenSalLop 9:5e9c4277151d 11 float dewPoint;
ValenSalLop 9:5e9c4277151d 12 int8_t DHTError;
ValenSalLop 12:1d544cdab2cf 13 float light;
ValenSalLop 12:1d544cdab2cf 14 int8_t lightError;
ValenSalLop 9:5e9c4277151d 15 };
ValenSalLop 9:5e9c4277151d 16
ValenSalLop 9:5e9c4277151d 17 struct task_definition_struct {
ValenSalLop 9:5e9c4277151d 18 void(*task)(void const *args);
ValenSalLop 9:5e9c4277151d 19 uint32_t(*init)(void const *args); // Result: 1 = OK, 0 = FAIL
ValenSalLop 9:5e9c4277151d 20 void *task_args; // NULL For DEFAULT (NULL)
ValenSalLop 9:5e9c4277151d 21 void *init_args; // NULL For DEFAULT (NULL)
ValenSalLop 9:5e9c4277151d 22 osPriority priority;
ValenSalLop 9:5e9c4277151d 23 // uint32_t stack_size; // 0 for DEFAULT (DEFAULT_STACK_SIZE)
ValenSalLop 9:5e9c4277151d 24 // unsigned char *stack_pointer; // NULL for DEFAULT (NULL)
ValenSalLop 9:5e9c4277151d 25 uint32_t delay; // Delay on start from previous task
ValenSalLop 9:5e9c4277151d 26 Thread *thread; // To be filled in during runtime
ValenSalLop 9:5e9c4277151d 27 uint32_t retVal; // Return Value - to be filled in during runtime
ValenSalLop 9:5e9c4277151d 28 };
ValenSalLop 9:5e9c4277151d 29
ValenSalLop 9:5e9c4277151d 30 extern Mutex mutexPCComm;
ValenSalLop 9:5e9c4277151d 31 extern Serial pc;
ValenSalLop 9:5e9c4277151d 32 extern Mutex mutexData;
ValenSalLop 9:5e9c4277151d 33 extern SensorData data;
ValenSalLop 9:5e9c4277151d 34 extern task_definition_struct taskList[];
ValenSalLop 9:5e9c4277151d 35 extern volatile bool sensors_running;
ValenSalLop 9:5e9c4277151d 36 extern uint32_t initTasks(void);
ValenSalLop 9:5e9c4277151d 37
ValenSalLop 9:5e9c4277151d 38 int publishSensorData(void);
ValenSalLop 9:5e9c4277151d 39
ValenSalLop 9:5e9c4277151d 40 #endif