File tree Expand file tree Collapse file tree 3 files changed +17
-7
lines changed Expand file tree Collapse file tree 3 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ extern Serial* serial;
13
13
// This allows for all files to access the can bus output
14
14
extern CAN * canBus ;
15
15
16
+ //Global pointer to DigitalOut objects for BMS_FAULT and CHARGER_CONTROL pins
17
+ //
18
+ //This allows for all files to access BMS_FAULT and CHARGER_CONTROL pins
19
+ extern DigitalOut * bms_flt ;
20
+ extern DigitalOut * charger_ctrl ;
16
21
17
22
//
18
23
// BMS Master Configuration
Original file line number Diff line number Diff line change @@ -43,8 +43,9 @@ class BMSThread {
43
43
44
44
void throwBmsFault () {
45
45
m_discharging = false ;
46
- // palClearLine(LINE_BMS_FLT);
47
- // palSetLine(LINE_CHARGER_CONTROL);
46
+ bms_flt->write (0 );
47
+ charger_ctrl->write (1 );
48
+
48
49
}
49
50
void threadWorker () {
50
51
uint16_t * allVoltages = new uint16_t [BMS_BANK_COUNT * BMS_BANK_CELL_COUNT];
Original file line number Diff line number Diff line change 32
32
33
33
Serial* serial;
34
34
CAN* canBus;
35
+ DigitalOut* bms_flt;
36
+ DigitalOut* charger_ctrl;
35
37
36
38
void initIO ();
37
39
@@ -75,22 +77,24 @@ void initIO() {
75
77
76
78
canBus = new CAN (BMS_PIN_CAN_RX, BMS_PIN_CAN_TX, BMS_CAN_FREQUENCY);
77
79
80
+ bms_flt = new DigitalOut (BMS_PIN_BMS_FLT);
81
+
82
+ charger_ctrl = new DigitalOut (BMS_PIN_CHARGER_CONTROL);
83
+
78
84
// Set modes for IO
79
85
/*
80
- palSetLineMode(LINE_BMS_FLT, PAL_MODE_OUTPUT_PUSHPULL);
81
86
palSetLineMode(LINE_BMS_FLT_LAT, PAL_MODE_INPUT);
82
87
palSetLineMode(LINE_IMD_STATUS, PAL_MODE_INPUT);
83
88
palSetLineMode(LINE_IMD_FLT_LAT, PAL_MODE_INPUT);
84
- palSetLineMode(LINE_CHARGER_CONTROL, PAL_MODE_OUTPUT_PUSHPULL);
85
89
palSetLineMode(LINE_SIG_CURRENT, PAL_MODE_INPUT_ANALOG);
86
90
*/
87
91
88
92
// Reset BMS fault line
89
- // palSetLine(LINE_BMS_FLT );
90
- // palClearLine(LINE_BMS_FLT );
93
+ bms_flt-> write ( 1 );
94
+ bms_flt-> write ( 0 );
91
95
92
96
// Enable charging
93
- // palClearLine(LINE_CHARGER_CONTROL );
97
+ charger_ctrl-> write ( 0 );
94
98
95
99
// Set modes for SPI
96
100
/*
You can’t perform that action at this time.
0 commit comments