We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 94eec85 + 58dcffc commit bebf66bCopy full SHA for bebf66b
PDB/main.cpp
@@ -106,11 +106,22 @@ int main(){
106
printf("entering main\n");
107
108
can = new CAN(PA_11, PA_12, 500000);
109
+ can->filter(0x188, 0xFF, CANAny); //ACC_TPDO_STATUS TODO: does this even work?
110
111
queue.call_every(200ms, send_PDB_TPDO_POWER_A);
112
queue.call_every(200ms, send_PDB_TPDO_POWER_B);
113
114
while (true) {
115
+
116
+ CANMessage msg;
117
+ while (can->read(msg)) {
118
+ if (msg.id == 0x188) // ACC_TPDO_STATUS
119
+ {
120
+ bool precharge_done = msg.data[0] & 0x08;
121
+ dcdc_ctrl.write(precharge_done);
122
+ }
123
124
125
for (int i = 0; i < 16; i++)
126
{
127
S0.write(i & 0x1);
0 commit comments