-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.h
57 lines (45 loc) · 1.37 KB
/
main.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
55
56
57
#ifndef __main_h
#define __main_h
#include "um34c.h"
#include "fileHandler.h"
#include "movingAverage.h"
#define RUNNING_TIME_STRING "%H:%M:%S"
#define RUNNING_TIME_STRING_SIZE 10
#define INTREVAL_CHECK_FOR_CHAR (50*1000) // [us]
#define INTREVAL_UPDATE_DISPLAY (20*1000) // [us]
#define MOV_AVG_DFLT_FILTER_STRENGTH (10)
#define ms_TO_us(ms) ((ms)*1000)
// ncurses color pair index
#define GREEN_PAIR 1
#define RED_PAIR 2
#define DEFAULT_CLR (-1) // default terminal color
#define LOGGER_FILE_NAME "log.log"
typedef struct {
um34c_config_S *pSUM34C_config;
fileHandler_config_S *pSFileHandler_config;
uint8_t bSaveToCSVfile;
uint8_t bReadData;
time_t startTime;
int nCmdChar;
int nCmdChar_prev;
uint8_t byDeviceBrightness;
uint8_t byRecCurrThreshold_cA;
uint8_t byCurrentScreenRotation;
uint8_t bUpdateDisp;
char szLastCmdBuff[100];
movingAvg_handle_f_S SMvgAvg_handle_fVoltage;
movingAvg_handle_f_S SMvgAvg_handle_fCurrent;
uint16_t wMovAvgStrength;
uint8_t bShowHelp;
uint8_t bUseGUI;
} mainConfig_S;
typedef enum {
exitProgram_param_OK = 0,
exitProgram_param_SendingUM34C,
exitProgram_param_SettingRCT, // Record Current Threshold
exitProgram_param_CTRL_C,
exitProgram_param_C,
exitProgram_param_terminalColor,
} exitProgram_param_E;
void exitProgram(exitProgram_param_E EParam);
#endif // __main_h