@@ -98,13 +98,13 @@ void started_interrupt_init(void) {
98
98
99
99
int get_health_pkt (void * dat ) {
100
100
struct __attribute__((packed )) {
101
- uint32_t voltage ;
102
- uint32_t current ;
103
- uint8_t started ;
104
- uint8_t controls_allowed ;
105
- uint8_t gas_interceptor_detected ;
106
- uint8_t started_signal_detected ;
107
- uint8_t started_alt ;
101
+ uint32_t voltage_pkt ;
102
+ uint32_t current_pkt ;
103
+ uint8_t started_pkt ;
104
+ uint8_t controls_allowed_pkt ;
105
+ uint8_t gas_interceptor_detected_pkt ;
106
+ uint8_t started_signal_detected_pkt ;
107
+ uint8_t started_alt_pkt ;
108
108
} * health = dat ;
109
109
110
110
//Voltage will be measured in mv. 5000 = 5V
@@ -117,24 +117,24 @@ int get_health_pkt(void *dat) {
117
117
// s = 1000/((4095/3.3)*(1/11)) = 8.8623046875
118
118
119
119
// Avoid needing floating point math
120
- health -> voltage = (voltage * 8862 ) / 1000 ;
120
+ health -> voltage_pkt = (voltage * 8862 ) / 1000 ;
121
121
122
- health -> current = adc_get (ADCCHAN_CURRENT );
122
+ health -> current_pkt = adc_get (ADCCHAN_CURRENT );
123
123
int safety_ignition = safety_ignition_hook ();
124
124
if (safety_ignition < 0 ) {
125
125
//Use the GPIO pin to determine ignition
126
- health -> started = is_gpio_started ();
126
+ health -> started_pkt = is_gpio_started ();
127
127
} else {
128
128
//Current safety hooks want to determine ignition (ex: GM)
129
- health -> started = safety_ignition ;
129
+ health -> started_pkt = safety_ignition ;
130
130
}
131
131
132
- health -> controls_allowed = controls_allowed ;
133
- health -> gas_interceptor_detected = gas_interceptor_detected ;
132
+ health -> controls_allowed_pkt = controls_allowed ;
133
+ health -> gas_interceptor_detected_pkt = gas_interceptor_detected ;
134
134
135
135
// DEPRECATED
136
- health -> started_alt = 0 ;
137
- health -> started_signal_detected = 0 ;
136
+ health -> started_alt_pkt = 0 ;
137
+ health -> started_signal_detected_pkt = 0 ;
138
138
139
139
return sizeof (* health );
140
140
}
0 commit comments