Skip to content

Commit 41e4c8a

Browse files
fixed where data is saved to and fixed problem with temp not shifting. Awaiting testing.
1 parent 811a6cd commit 41e4c8a

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

src/VCR_Tasks.cpp

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -125,40 +125,41 @@ bool init_I2C(const unsigned long& sysMicros, const HT_TASK::TaskInfo& taskInfo)
125125
// GPIO_B reflects the same logic as the input pins state
126126
mcp.writeRegister(MCP23017Register::IPOL_A, 0x00);
127127
mcp.writeRegister(MCP23017Register::IPOL_B, 0x00);
128+
129+
return true;
128130
}
129131

130132
bool run_I2C(const unsigned long& sysMicros, const HT_TASK::TaskInfo& taskInfo){
131-
int temp;
132-
temp = mcp.readPort(MCP23017Port::A);
133+
int temp = mcp.readPort(MCP23017Port::A);
133134
vcr_data.shutdown_sensing_data.bspd_is_ok = temp&1;
134-
temp>>1;
135+
temp = temp>>1;
135136
vcr_data.shutdown_sensing_data.k_watchdog_relay = temp&1;
136-
temp>>1;
137+
temp = temp>>1;
137138
vcr_data.shutdown_sensing_data.watchdog_is_ok = temp&1;
138-
temp >>1;
139+
temp = temp>>1;
139140
vcr_data.shutdown_sensing_data.l_bms_relay = temp&1;
140-
temp>>1;
141+
temp = temp>>1;
141142
vcr_data.shutdown_sensing_data.bms_is_ok = temp&1;
142-
temp>>1;
143-
vcr_data.shutdown_sensing_data.m_imd_relay = temp&1; //Coresponds to SHDN_OUT_SNS???
144-
temp>>1;
143+
temp = temp>>1;
144+
vcr_data.shutdown_sensing_data.m_imd_relay = temp&1;
145+
temp = temp>>1;
145146
vcr_data.shutdown_sensing_data.imd_is_ok = temp&1;
146-
temp>>1;
147+
temp = temp>>1;
147148
vcr_data.shutdown_sensing_data.i_shutdown_in = temp&1;
148149
temp = mcp.readPort(MCP23017Port::B);
149150
vcr_data.ethernet_is_linked.acu_link = temp&1;
150-
temp>>1;
151+
temp = temp>>1;
151152
vcr_data.ethernet_is_linked.drivebrain_link = temp&1;
152-
temp>>1;
153+
temp = temp>>1;
153154
vcr_data.ethernet_is_linked.vcf_link = temp&1;
154-
temp>>1;
155+
temp = temp>>1;
155156
vcr_data.ethernet_is_linked.teensy_link = temp&1;
156-
temp>>1;
157+
temp = temp>>1;
157158
vcr_data.ethernet_is_linked.debug_link = temp&1;
158-
temp>>1;
159+
temp = temp>>1;
159160
vcr_data.ethernet_is_linked.ubiquiti_link = temp&1;
160-
temp>>1;
161-
temp>>1;
161+
temp = temp>>1;
162+
temp = temp>>1;
162163
vcr_data.shutdown_sensing_data.j_bspd_relay = temp&1;
163164
return true;
164165
}

0 commit comments

Comments
 (0)