Skip to content

Commit 67ecc47

Browse files
committed
Haltech IO12 protocol support
1 parent d30fb42 commit 67ecc47

22 files changed

Lines changed: 540 additions & 16 deletions

dbc/haltech.dbc

Lines changed: 123 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ NS_ :
3232
SG_MUL_VAL_
3333

3434
BS_:
35-
BU_: Haltech_WB2 Haltech_TCA ECU
35+
BU_: Haltech_WB2 Haltech_TCA HALTECH_IO12 ECU
3636

3737
BO_ 688 Haltech_WB2A: 8 Haltech_WB2
3838
SG_ Lambda1 : 7|16@0+ (0.000976563,0) [0|64] "lambda" ECU
@@ -70,6 +70,7 @@ BO_ 696 Haltech_WB2D: 8 Haltech_WB2
7070
SG_ Sensor2Flags : 55|4@0+ (1,0) [0|5] "" ECU
7171
SG_ VBatt : 63|8@0+ (0.0784314,0) [0|20] "V" ECU
7272

73+
7374
BO_ 716 Haltech_TCA_Box1: 8 Haltech_TCA
7475
SG_ Egt1 : 7|16@0- (0.407003,-250) [-250|16133.5] "degC" ECU
7576
SG_ Egt2 : 23|16@0- (0.407003,-250) [-250|16133.5] "degC" ECU
@@ -82,6 +83,93 @@ BO_ 717 Haltech_TCA_Box2: 8 Haltech_TCA
8283
SG_ Egt3 : 39|16@0- (0.407003,-250) [-250|16133.5] "degC" ECU
8384
SG_ Egt4 : 55|16@0- (0.407003,-250) [-250|16133.5] "degC" ECU
8485

86+
87+
BO_ 704 HALTECH_IO12_A_AVI: 8 HALTECH_IO12
88+
SG_ AVI1 : 3|12@0+ (0.001221,0) [0|5] "v" ECU
89+
SG_ AVI2 : 19|12@0+ (0.001221,0) [0|5] "v" ECU
90+
SG_ AVI3 : 35|12@0+ (0.001221,0) [0|80] "" ECU
91+
SG_ AVI4 : 51|12@0+ (0.001221,0) [0|5] "" ECU
92+
93+
BO_ 706 HALTECH_IO12_A_DPI: 8 HALTECH_IO12
94+
SG_ DPI1_duty : 7|8@0+ (0.1,0) [0|1] "%" ECU
95+
SG_ DPI1_period : 24|8@1+ (0.01,0) [0|1] "ms" ECU
96+
SG_ DPI2_duty : 39|8@0+ (0.1,0) [0|1] "%" ECU
97+
SG_ DPI2_period : 56|8@1+ (0.01,0) [0|1] "ms" ECU
98+
SG_ DPI1_State : 13|1@0+ (1,0) [0|1] "" ECU
99+
SG_ DPI2_State : 45|1@0+ (1,0) [0|1] "" ECU
100+
101+
BO_ 708 HALTECH_IO12_A_DPI2: 8 HALTECH_IO12
102+
SG_ DPI4_duty : 39|8@0+ (0.1,0) [0|1] "%" ECU
103+
SG_ DPI3_period : 24|8@1+ (0.01,0) [0|1] "%" ECU
104+
SG_ DPI3_duty : 7|8@0+ (0.1,0) [0|1] "%" ECU
105+
SG_ DPI4_period : 56|8@1+ (0.01,0) [0|1] "%" ECU
106+
SG_ DPI3_state : 13|1@1+ (1,0) [0|1] "" ECU
107+
SG_ DPI4_state : 45|1@1+ (1,0) [0|1] "" ECU
108+
109+
BO_ 720 HALTECH_IO12_A_DPO12: 8 ECU
110+
SG_ DPO1_duty : 7|8@0+ (0.4,0) [0|1] "%" HALTECH_IO12
111+
SG_ DPO2_duty : 39|8@0+ (0.4,0) [0|1] "%" HALTECH_IO12
112+
SG_ DPO1_period : 24|8@1+ (0.01,0) [0|1] "ms" HALTECH_IO12
113+
SG_ DPO2_period : 56|8@1+ (0.01,0) [0|1] "ms" HALTECH_IO12
114+
SG_ DPO1_activestate : 11|1@0+ (1,0) [0|1] "" HALTECH_IO12
115+
SG_ DPO2_safestate : 44|1@0+ (1,0) [0|1] "" HALTECH_IO12
116+
SG_ DPO1_safestate : 12|1@0+ (1,0) [0|1] "" HALTECH_IO12
117+
SG_ DPO2_activestate : 43|1@0+ (1,0) [0|1] "" HALTECH_IO12
118+
119+
BO_ 722 HALTECH_IO12_A_DPO34: 8 ECU
120+
SG_ DPO3_duty : 7|8@0+ (0.4,0) [0|1] "%" HALTECH_IO12
121+
SG_ DPO4_duty : 39|8@0+ (0.4,0) [0|1] "%" HALTECH_IO12
122+
SG_ DPO3_period : 24|8@1+ (0.01,0) [0|1] "ms" HALTECH_IO12
123+
SG_ DPO4_period : 56|8@1+ (0.01,0) [0|1] "ms" HALTECH_IO12
124+
SG_ DPO3_safestate : 12|1@1+ (1,0) [0|1] "" HALTECH_IO12
125+
SG_ DPO3_activestate : 11|1@1+ (1,0) [0|1] "" HALTECH_IO12
126+
SG_ DPO4_safestate : 44|1@1+ (1,0) [0|1] "" HALTECH_IO12
127+
SG_ DPO4_activestate : 43|1@1+ (1,0) [0|1] "" HALTECH_IO12
128+
129+
130+
BO_ 705 HALTECH_IO12_B_AVI: 8 HALTECH_IO12
131+
SG_ AVI1 : 3|12@0+ (0.001221,0) [0|5] "v" ECU
132+
SG_ AVI2 : 19|12@0+ (0.001221,0) [0|5] "v" ECU
133+
SG_ AVI3 : 35|12@0+ (0.001221,0) [0|80] "" ECU
134+
SG_ AVI4 : 51|12@0+ (0.001221,0) [0|5] "" ECU
135+
136+
BO_ 707 HALTECH_IO12_B_DPI: 8 HALTECH_IO12
137+
SG_ DPI1_duty : 7|8@0+ (0.1,0) [0|1] "%" ECU
138+
SG_ DPI1_period : 24|8@1+ (0.01,0) [0|1] "ms" ECU
139+
SG_ DPI2_duty : 39|8@0+ (0.1,0) [0|1] "%" ECU
140+
SG_ DPI2_period : 56|8@1+ (0.01,0) [0|1] "ms" ECU
141+
SG_ DPI1_State : 13|1@0+ (1,0) [0|1] "" ECU
142+
SG_ DPI2_State : 45|1@0+ (1,0) [0|1] "" ECU
143+
144+
BO_ 709 HALTECH_IO12_B_DPI2: 8 HALTECH_IO12
145+
SG_ DPI4_duty : 39|8@0+ (0.1,0) [0|1] "%" ECU
146+
SG_ DPI3_period : 24|8@1+ (0.01,0) [0|1] "%" ECU
147+
SG_ DPI3_duty : 7|8@0+ (0.1,0) [0|1] "%" ECU
148+
SG_ DPI4_period : 56|8@1+ (0.01,0) [0|1] "%" ECU
149+
SG_ DPI3_state : 13|1@1+ (1,0) [0|1] "" ECU
150+
SG_ DPI4_state : 45|1@1+ (1,0) [0|1] "" ECU
151+
152+
BO_ 721 HALTECH_IO12_B_DPO12: 8 ECU
153+
SG_ DPO1_duty : 7|8@0+ (0.4,0) [0|1] "%" HALTECH_IO12
154+
SG_ DPO2_duty : 39|8@0+ (0.4,0) [0|1] "%" HALTECH_IO12
155+
SG_ DPO1_period : 24|8@1+ (0.01,0) [0|1] "ms" HALTECH_IO12
156+
SG_ DPO2_period : 56|8@1+ (0.01,0) [0|1] "ms" HALTECH_IO12
157+
SG_ DPO1_activestate : 11|1@0+ (1,0) [0|1] "" HALTECH_IO12
158+
SG_ DPO2_safestate : 44|1@0+ (1,0) [0|1] "" HALTECH_IO12
159+
SG_ DPO1_safestate : 12|1@0+ (1,0) [0|1] "" HALTECH_IO12
160+
SG_ DPO2_activestate : 43|1@0+ (1,0) [0|1] "" HALTECH_IO12
161+
162+
BO_ 723 HALTECH_IO12_B_DPO34: 8 ECU
163+
SG_ DPO3_duty : 7|8@0+ (0.4,0) [0|1] "%" HALTECH_IO12
164+
SG_ DPO4_duty : 39|8@0+ (0.4,0) [0|1] "%" HALTECH_IO12
165+
SG_ DPO3_period : 24|8@1+ (0.01,0) [0|1] "ms" HALTECH_IO12
166+
SG_ DPO4_period : 56|8@1+ (0.01,0) [0|1] "ms" HALTECH_IO12
167+
SG_ DPO3_safestate : 12|1@1+ (1,0) [0|1] "" HALTECH_IO12
168+
SG_ DPO3_activestate : 11|1@1+ (1,0) [0|1] "" HALTECH_IO12
169+
SG_ DPO4_safestate : 44|1@1+ (1,0) [0|1] "" HALTECH_IO12
170+
SG_ DPO4_activestate : 43|1@1+ (1,0) [0|1] "" HALTECH_IO12
171+
172+
85173
CM_ BO_ 688 "Haltech WB2A";
86174
CM_ SG_ 688 Lambda1 "Lambda sensor 1. Value = 32767 indicates free air cal, otherwise Lambda = Value / 1024";
87175
CM_ SG_ 688 Lambda2 "Lambda sensor 2. Value = 32767 indicates free air cal, otherwise Lambda = Value / 1024";
@@ -93,6 +181,16 @@ CM_ BO_ 694 "Haltech WB2C";
93181
CM_ BO_ 696 "Haltech WB2D";
94182
CM_ BO_ 716 "Haltech TCA Box A (TC 1-4)";
95183
CM_ BO_ 717 "Haltech TCA Box B (TC 5-8)";
184+
CM_ BO_ 704 "Haltech IO12 Box A AVI";
185+
CM_ BO_ 705 "Haltech IO12 Box B AVI";
186+
CM_ BO_ 706 "Haltech IO12 Box A DPI";
187+
CM_ BO_ 707 "Haltech IO12 Box B DPI";
188+
CM_ BO_ 708 "Haltech IO12 Box A DPI2";
189+
CM_ BO_ 709 "Haltech IO12 Box B DPI2";
190+
CM_ BO_ 720 "Haltech IO12 Box A DPO12";
191+
CM_ BO_ 721 "Haltech IO12 Box B DPO12";
192+
CM_ BO_ 722 "Haltech IO12 Box A DPO34";
193+
CM_ BO_ 723 "Haltech IO12 Box B DPO34";
96194
BA_DEF_ "BusType" STRING ;
97195
BA_DEF_ BO_ "GenMsgBackgroundColor" STRING ;
98196
BA_DEF_ BO_ "GenMsgForegroundColor" STRING ;
@@ -107,3 +205,27 @@ VAL_ 694 Sensor1Flags 0 "None" 1 "LowBattery" 2 "HighBattery" 3 "SensorShortCirc
107205
VAL_ 694 Sensor2Flags 0 "None" 1 "LowBattery" 2 "HighBattery" 3 "SensorShortCircuit" 4 "SensorOpenCircuit" 5 "SensorCold";
108206
VAL_ 696 Sensor1Flags 0 "None" 1 "LowBattery" 2 "HighBattery" 3 "SensorShortCircuit" 4 "SensorOpenCircuit" 5 "SensorCold";
109207
VAL_ 696 Sensor2Flags 0 "None" 1 "LowBattery" 2 "HighBattery" 3 "SensorShortCircuit" 4 "SensorOpenCircuit" 5 "SensorCold";
208+
VAL_ 706 DPI1_State 0 "Off" 1 "On";
209+
VAL_ 706 DPI2_State 0 "Off" 1 "On";
210+
VAL_ 708 DPI3_state 0 "Off" 1 "On";
211+
VAL_ 708 DPI4_state 0 "Off" 1 "On";
212+
VAL_ 720 DPO1_activestate 0 "Off" 1 "On";
213+
VAL_ 720 DPO2_safestate 0 "Off" 1 "On";
214+
VAL_ 720 DPO1_safestate 0 "Off" 1 "On";
215+
VAL_ 720 DPO2_activestate 0 "Off" 1 "On";
216+
VAL_ 722 DPO3_safestate 0 "Off" 1 "On";
217+
VAL_ 722 DPO3_activestate 0 "Off" 1 "On";
218+
VAL_ 722 DPO4_safestate 0 "Off" 1 "On";
219+
VAL_ 722 DPO5_activestate 0 "Off" 1 "On";
220+
VAL_ 707 DPI1_State 0 "Off" 1 "On";
221+
VAL_ 707 DPI2_State 0 "Off" 1 "On";
222+
VAL_ 709 DPI3_state 0 "Off" 1 "On";
223+
VAL_ 709 DPI4_state 0 "Off" 1 "On";
224+
VAL_ 721 DPO1_activestate 0 "Off" 1 "On";
225+
VAL_ 721 DPO2_safestate 0 "Off" 1 "On";
226+
VAL_ 721 DPO1_safestate 0 "Off" 1 "On";
227+
VAL_ 721 DPO2_activestate 0 "Off" 1 "On";
228+
VAL_ 723 DPO3_safestate 0 "Off" 1 "On";
229+
VAL_ 723 DPO3_activestate 0 "Off" 1 "On";
230+
VAL_ 723 DPO4_safestate 0 "Off" 1 "On";
231+
VAL_ 723 DPO5_activestate 0 "Off" 1 "On";

firmware/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ CPPSRC = $(ALLCPPSRC) \
166166
max3185x.cpp \
167167
uart.cpp \
168168
auxout.cpp \
169+
pwmout.cpp \
169170
indication.cpp \
170171
sampling_thread.cpp \
171172
heater_thread.cpp \

firmware/auxout.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#ifndef AUXOUT_DAC_PWM_OUTPUT_MODE
1919
#define AUXOUT_DAC_PWM_OUTPUT_MODE PWM_OUTPUT_ACTIVE_HIGH
2020
#endif
21+
2122
#ifndef AUXOUT_DAC_PWM_NC_OUTPUT_MODE
2223
#define AUXOUT_DAC_PWM_NC_OUTPUT_MODE PWM_OUTPUT_ACTIVE_LOW
2324
#endif
@@ -86,7 +87,7 @@ void SetAuxDac(int channel, float voltage)
8687

8788
auxDac.SetDuty(auxOutPwmCh[channel], duty);
8889
// Ripple cancelation channel
89-
if (auxOutPwmChN[channel >= 0]) {
90+
if (auxOutPwmChN[channel] >= 0) {
9091
auxDac.SetDuty(auxOutPwmChN[channel], duty);
9192
}
9293
}

firmware/boards/f1_dual_rev1/board.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@
100100
* PB0 - R_Heater_sense (analog in).
101101
* PB1 - R_OUT_sense (analog in).
102102
* PB2 - Nernsr_4.9_bias (digital output, 2 Mhz)
103-
* PB3 - SPI1_SCK (output puspull, alternate, 50 MHz)
103+
* PB3 - SPI1_SCK (output pushpull, alternate, 50 MHz)
104104
* PB4 - SPI1_MISO (digital input, alternate)
105-
* PB5 - SPI1_MOSI (output puspull, alternate, 50 MHz)
105+
* PB5 - SPI1_MOSI (output pushpull, alternate, 50 MHz)
106106
* PB6 - R_heater_pwm (output pushpull, alternate, 2 MHz)
107107
* PB7 - L_heater_pwm (output pushpull, alternate, 2 MHz)
108108
* PB8 - I2C1_SCL (output pushpull, alternate, 50 MHz)
@@ -111,11 +111,11 @@
111111
* PB11 - Nernsr_4.9_esr_drive (output pushpull, 50 Mhz)
112112
* PB12 - Nernsr_4.2_esr_drive (digital input, no pull) - keep high-Z after power on
113113
* PB13 - L_LED_GREEN (output pushpull, 2 MHz)
114-
* PB14 - L_OUT_en (output pushpull, 2 MHz)
115-
* PB15 - R_OUT_en (output pushpull, 2 MHz)
114+
* PB14 - L_OUT_PWM (output pushpull, alternate, 50 MHz)
115+
* PB15 - R_OUT_PWM (output pushpull, alternate, 50 MHz)
116116
*/
117117
#define VAL_GPIOBCRL 0xAAB8B200 /* PB7...PB0 */
118-
#define VAL_GPIOBCRH 0x2224348B /* PB15...PB8 */
118+
#define VAL_GPIOBCRH 0xBB24348B /* PB15...PB8 */
119119
#define VAL_GPIOBODR 0x00003FFF
120120

121121
/*

firmware/boards/f1_dual_rev1/io/io_pins.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,19 @@
6969
// Riple cancelation output (should be inverted)
7070
#define AUXOUT_DAC_PWM_CHANNEL_1_NC 3
7171

72+
// Hardware PWM using TIM1 for both AUX open drain outputs
73+
// NOTE: Both channels share the same timer, so they have the same frequency
74+
// but can have independent duty cycles
75+
// PB14 - TIM1_CH2N - AUX_OD_L
76+
#define AUXOUT_OD_PWM_DEVICE PWMD1
77+
#define AUXOUT_OD_PWM_CHANNEL_L 1 // TIM1_CH2N
78+
#define AUX_OD_L_PORT GPIOB
79+
#define AUX_OD_L_PIN 14
80+
// PB15 - TIM1_CH3N - AUX_OD_R
81+
#define AUXOUT_OD_PWM_CHANNEL_R 2 // TIM1_CH3N
82+
#define AUX_OD_R_PORT GPIOB
83+
#define AUX_OD_R_PIN 15
84+
7285
#define ID_SEL1_PORT GPIOC
7386
#define ID_SEL1_PIN 13
7487
#define ID_SEL2_PORT GPIOC

firmware/boards/f1_dual_rev1/mcuconf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
* PWM driver system settings.
145145
*/
146146
#define STM32_PWM_USE_ADVANCED TRUE
147-
#define STM32_PWM_USE_TIM1 FALSE
147+
#define STM32_PWM_USE_TIM1 TRUE
148148
#define STM32_PWM_USE_TIM2 FALSE
149149
#define STM32_PWM_USE_TIM3 FALSE
150150
#define STM32_PWM_USE_TIM4 TRUE

firmware/boards/f1_dual_rev1/port.cpp

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,19 @@ const ADCConversionGroup convGroup =
7070
ADC_SQR3_SQ6_N(7), /* PA7 - ADC12_IN7 - L_AUX_ADC */
7171
};
7272

73+
/* Given _SQX, index is X - 1 */
74+
#define L_HEATER_SENSE_IDX 6
75+
#define R_HEATER_SENSE_IDX 7
76+
#define R_UN_SENSE_IDX 8
77+
#define L_UN_SENSE_IDX 9
78+
#define R_IP_SENSE_IDX 0
79+
#define R_UN_3X_SENSE_IDX 1
80+
#define L_IP_SENSE_IDX 2
81+
#define L_UN_3X_SENSE_IDX 3
82+
#define R_AUX_ADC_IDX 4
83+
#define L_AUX_ADC_IDX 5
84+
85+
7386
static float AverageSamples(adcsample_t* buffer, size_t idx)
7487
{
7588
uint32_t sum = 0;
@@ -136,13 +149,13 @@ AnalogResult AnalogSampleFinish()
136149

137150
if (l_heater && l_heater_new)
138151
{
139-
float vbatt_raw = GetMaxSample(adcBuffer, 6) / HEATER_INPUT_DIVIDER;
152+
float vbatt_raw = GetMaxSample(adcBuffer, L_HEATER_SENSE_IDX) / HEATER_INPUT_DIVIDER;
140153
l_heater_voltage = HEATER_FILTER_ALPHA * vbatt_raw + (1.0 - HEATER_FILTER_ALPHA) * l_heater_voltage;
141154
}
142155

143156
if (r_heater && r_heater_new)
144157
{
145-
float vbatt_raw = GetMaxSample(adcBuffer, 7) / HEATER_INPUT_DIVIDER;
158+
float vbatt_raw = GetMaxSample(adcBuffer, R_HEATER_SENSE_IDX) / HEATER_INPUT_DIVIDER;
146159
r_heater_voltage = HEATER_FILTER_ALPHA * vbatt_raw + (1.0 - HEATER_FILTER_ALPHA) * r_heater_voltage;
147160
}
148161

@@ -155,27 +168,31 @@ AnalogResult AnalogSampleFinish()
155168

156169
for (int i = 0; i < AFR_CHANNELS; i++) {
157170
res.ch[i].NernstClamped = false;
158-
float NernstRaw = AverageSamples(adcBuffer, (i == 0) ? 3 : 1);
171+
float NernstRaw = AverageSamples(adcBuffer, (i == 0) ? L_UN_3X_SENSE_IDX : R_UN_3X_SENSE_IDX);
159172
if (!isClamped(NernstRaw)) {
160173
/* not clamped */
161174
res.ch[i].NernstVoltage = (NernstRaw - NERNST_INPUT_OFFSET) * (1.0 / NERNST_INPUT_GAIN);
162175
} else {
163176
/* Clamped, use ungained input */
164-
NernstRaw = AverageSamples(adcBuffer, (i == 0) ? 9 : 8);
177+
NernstRaw = AverageSamples(adcBuffer, (i == 0) ? L_UN_SENSE_IDX : R_UN_SENSE_IDX);
165178
if (isClamped(NernstRaw)) {
166179
res.ch[i].NernstClamped = true;
167180
}
168181
/* even it is clamped */
169182
res.ch[i].NernstVoltage = NernstRaw - HALF_VCC;
170183
}
171184
}
185+
172186
/* left */
173-
res.ch[0].PumpCurrentVoltage = AverageSamples(adcBuffer, 2);
187+
res.ch[0].PumpCurrentVoltage = AverageSamples(adcBuffer, L_IP_SENSE_IDX);
174188
res.ch[0].HeaterSupplyVoltage = l_heater_voltage;
175189
/* right */
176-
res.ch[1].PumpCurrentVoltage = AverageSamples(adcBuffer, 0);
190+
res.ch[1].PumpCurrentVoltage = AverageSamples(adcBuffer, R_IP_SENSE_IDX);
177191
res.ch[1].HeaterSupplyVoltage = r_heater_voltage;
178192

193+
res.AuxInputVoltage[0] = AverageSamples(adcBuffer, L_AUX_ADC_IDX);
194+
res.AuxInputVoltage[1] = AverageSamples(adcBuffer, R_AUX_ADC_IDX);
195+
179196
return res;
180197
}
181198

firmware/boards/f1_dual_rev1/wideband_board_config.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
#define AFR_CHANNELS 2
88
#define EGT_CHANNELS 2
99

10+
// As well as two aux adcs and two low side outputs
11+
#define AUX_INPUT_CHANNELS 2
12+
#define AUX_INPUT_GAIN ((82.0 + 160.0) / 160.0)
13+
#define PWM_OUTPUT_CHANNELS 2
14+
1015
// Fundamental board constants
1116
#define VCC_VOLTS (3.3f)
1217
#define HALF_VCC (VCC_VOLTS / 2)

firmware/boards/port.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ struct AnalogChannelResult
2121
struct AnalogResult
2222
{
2323
AnalogChannelResult ch[AFR_CHANNELS];
24+
25+
#if AUX_INPUT_CHANNELS > 0
26+
float AuxInputVoltage[AUX_INPUT_CHANNELS];
27+
#endif
28+
2429
float VirtualGroundVoltageInt;
2530

2631
#ifdef BOARD_HAS_VOLTAGE_SENSE

firmware/can.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ void CanTxThread(void*)
4242
SendCanEgt();
4343
}
4444

45+
if ((cycle % 10) == 0) {
46+
SendHaltechIO12Message(configuration);
47+
}
48+
4549
cycle++;
4650
prev = chThdSleepUntilWindowed(prev, chTimeAddX(prev, TIME_MS2I(WBO_TX_PERIOD_MS)));
4751
}
@@ -70,6 +74,7 @@ void CanRxThread(void*)
7074

7175
ProcessRusefiCanMessage(&frame, configuration, &CanStatusData);
7276
ProcessLinkCanMessage(&frame, configuration, &CanStatusData);
77+
ProcessHaltechIO12Message(&frame, configuration);
7378
}
7479
}
7580

0 commit comments

Comments
 (0)