This commit is contained in:
Matthew Kennedy 2022-04-15 06:01:04 -07:00 committed by GitHub
parent 17f741327f
commit 32d29d1134
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -37,6 +37,8 @@ void TsChannelBase::copyAndWriteSmallCrcPacket(uint8_t responseCode, const uint8
}
void TsChannelBase::crcAndWriteBuffer(uint8_t responseCode, size_t size) {
efiAssertVoid(OBD_PCM_Processor_Fault, size <= BLOCKING_FACTOR + 7, "crcAndWriteBuffer tried to transmit too large a packet")
auto scratchBuffer = this->scratchBuffer;
// Index 0/1 = packet size (big endian)
*(uint16_t*)scratchBuffer = SWAP_UINT16(size + 1);