-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmodules.h
37 lines (30 loc) · 1.73 KB
/
modules.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
#ifndef __MODULES_H__
#define __MODULES_H__
#include "position.h"
#include "image.h"
#include "tracking.h"
#include "log.h"
#include "sgp4.h"
#include "config.h"
#include "types.h"
#define MODULE_POSITION(CONF) {chThdCreateFromHeap(NULL, THD_WORKING_AREA_SIZE(2*1024), (CONF)->name, NORMALPRIO, modulePOS, (CONF)); (CONF)->active=true; }
#define MODULE_IMAGE(CONF) {chThdCreateFromHeap(NULL, THD_WORKING_AREA_SIZE(6*1024), (CONF)->name, NORMALPRIO, moduleIMG, (CONF)); (CONF)->active=true; }
#define MODULE_ERROR(CONF) {chThdCreateFromHeap(NULL, THD_WORKING_AREA_SIZE(2*1024), (CONF)->name, NORMALPRIO, moduleERROR, (CONF)); (CONF)->active=true; }
#define MODULE_LOG(CONF) {chThdCreateFromHeap(NULL, THD_WORKING_AREA_SIZE(2*1024), (CONF)->name, NORMALPRIO, moduleLOG, (CONF)); (CONF)->active=true; }
#define MODULE_TRACKING(CYCLE) chThdCreateFromHeap(NULL, THD_WORKING_AREA_SIZE(2*1024), "Tracking", NORMALPRIO, moduleTRACKING, NULL );
#define initEssentialModules() { \
chMtxObjectInit(&interference_mtx); \
chMtxObjectInit(&camera_mtx); \
chMtxObjectInit(&radio_mtx); \
MODULE_TRACKING(CYCLE_TIME); /* Tracker data input */ \
chThdSleepMilliseconds(1000); /* Give Tracking manager some time to fill first track point */ \
}
extern char *SMODE_STRING[];
extern char *MOULATION_STRING[];
extern char *PROTOCOL_STRING[];
#define VAL2SMODE(v) SMODE_STRING[v] /* Returns sleep as string */
#define VAL2MOULATION(v) MOULATION_STRING[v] /* Returns modulation as string */
#define VAL2PROTOCOL(v) PROTOCOL_STRING[v] /* Returns protocol as string */
extern mutex_t interference_mtx; // HF interference mutex (needed to exclude radio from HF sensitiv components [Camera])
extern systime_t watchdog_tracking; // Last update time for module TRACKING
#endif