Skip to content

Commit

Permalink
Update formatting to mach astyle rules
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamSlowik committed Jun 26, 2022
1 parent 77ee9e5 commit f2ef460
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions hal/transport/CAN/MyTransportCAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,10 @@ uint8_t _findCanPacketSlot(long unsigned int from, long unsigned int currentPart
uint8_t slot = CAN_BUF_SIZE;
uint8_t i;
for (i = 0; i < CAN_BUF_SIZE; i++) {
CAN_DEBUG(PSTR("CAN:RCV:LCK=%" PRIu8 ",ADDR=%" PRIu8
",PACK_ID=%" PRIu8 ",LAST_PART=%" PRIu8 "\n"), packets[i].locked, packets[i].address, packets[i].packetId,
packets[i].lastReceivedPart);
CAN_DEBUG(PSTR("CAN:RCV:LCK=%" PRIu8 ",ADDR=%" PRIu8
",PACK_ID=%" PRIu8 ",LAST_PART=%" PRIu8 "\n"), packets[i].locked, packets[i].address,
packets[i].packetId,
packets[i].lastReceivedPart);
if (packets[i].locked && packets[i].address == from && packets[i].packetId == messageId &&
packets[i].lastReceivedPart == currentPart) {
slot = i;
Expand Down Expand Up @@ -162,8 +163,9 @@ long unsigned int _buildHeader(uint8_t messageId, uint8_t totalPartCount, uint8_
header += toAddress;//set destination address
header = header << 8;
header += fromAddress;//set source address
CAN_DEBUG(PSTR("CAN:SND:CANH=%" PRIu32 ",ID=%" PRIu8
",TOTAL=%" PRIu8 ",CURR=%" PRIu8 ",TO=%" PRIu8 ",FROM=%" PRIu8 "\n"), header, messageId, totalPartCount,
CAN_DEBUG(PSTR("CAN:SND:CANH=%" PRIu32 ",ID=%" PRIu8
",TOTAL=%" PRIu8 ",CURR=%" PRIu8 ",TO=%" PRIu8 ",FROM=%" PRIu8 "\n"), header, messageId,
totalPartCount,
currentPartNumber, toAddress, fromAddress);
return header;
}
Expand Down Expand Up @@ -210,11 +212,11 @@ bool transportSend(const uint8_t to, const void *data, const uint8_t len, const
if (sndStat == CAN_OK) {
CAN_DEBUG(PSTR("CAN:SND:OK\n"));
} else {
CAN_DEBUG(PSTR("!CAN:SND:FAIL\n"));
return false;
}
}
return true;
CAN_DEBUG(PSTR("!CAN:SND:FAIL\n"));
return false;
}
}
return true;
}

bool transportDataAvailable(void)
Expand All @@ -231,10 +233,10 @@ bool transportDataAvailable(void)
",TOTAL=%" PRIu32 ",CURR=%" PRIu32 ",TO=%" PRIu32 ",FROM=%" PRIu32 "\n"), rxId, messageId,
totalPartCount,
currentPart, to, from);
CAN_DEBUG(PSTR("CAN:RCV:LN=%" PRIu8 ",DTA0=%" PRIu8 ",DTA1=%" PRIu8 ",DTA2=%" PRIu8 ",DTA3=%" PRIu8
",DTA4=%" PRIu8 ",DTA5=%" PRIu8 ",DTA6=%" PRIu8 ",DTA7=%" PRIu8 "\n"), len, rxBuf[0],
rxBuf[1],
rxBuf[2], rxBuf[3], rxBuf[4], rxBuf[5], rxBuf[6], rxBuf[7]);
CAN_DEBUG(PSTR("CAN:RCV:LN=%" PRIu8 ",DTA0=%" PRIu8 ",DTA1=%" PRIu8 ",DTA2=%" PRIu8 ",DTA3=%" PRIu8
",DTA4=%" PRIu8 ",DTA5=%" PRIu8 ",DTA6=%" PRIu8 ",DTA7=%" PRIu8 "\n"), len, rxBuf[0],
rxBuf[1],
rxBuf[2], rxBuf[3], rxBuf[4], rxBuf[5], rxBuf[6], rxBuf[7]);
uint8_t slot;
if (currentPart == 0) {
slot = _findCanPacketSlot();
Expand Down

0 comments on commit f2ef460

Please sign in to comment.