-
Notifications
You must be signed in to change notification settings - Fork 2
/
globals.h
63 lines (41 loc) · 1.56 KB
/
globals.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
58
59
60
61
#pragma once
// global variables, to be defined in main.c that can be accessed by all modules.
// DO NOT ADD FUNCTIONS HERE.
// think thrice before adding anything here.
// TODO(gabu-chan): eliminate these variables, make each module provide hooks
// for events that can be acted upon rather than let modules directly
// modify global state.
extern uint16_t redraw_request;
extern int8_t sweep_enabled;
#define REDRAW_CELLS (1<<0)
#define REDRAW_FREQUENCY (1<<1)
#define REDRAW_CAL_STATUS (1<<2)
#define REDRAW_MARKER (1<<3)
extern int16_t vbat;
extern int16_t lastsaveid;
extern properties_t *active_props;
extern properties_t current_props;
extern int8_t previous_marker;
extern config_t config;
extern float measured[2][101][2];
#define frequency0 current_props._frequency0
#define frequency1 current_props._frequency1
#define sweep_points current_props._sweep_points
#define cal_status current_props._cal_status
#define frequencies current_props._frequencies
#define cal_data active_props->_cal_data
#define electrical_delay current_props._electrical_delay
#define trace current_props._trace
#define markers current_props._markers
#define active_marker current_props._active_marker
#define domain_mode current_props._domain_mode
#define velocity_factor current_props._velocity_factor
static inline float get_trace_refpos(int t) {
return trace[t].refpos;
}
static inline float get_trace_scale(int t) {
return trace[t].scale * trace_info[trace[t].type].scale_unit;
}
static inline const char* get_trace_typename(int t) {
return trace_info[trace[t].type].name;
}