Fix crc again, for real this time (#1948)
* re enable * changelog * fix * fix test * put some tests back
This commit is contained in:
parent
26ee7c4ec0
commit
5b0a178605
|
@ -37,6 +37,9 @@ All notable user-facing or behavior-altering changes will be documented in this
|
||||||
- Improved TLE8888 driver on microRusEfi
|
- Improved TLE8888 driver on microRusEfi
|
||||||
- Improved setting ECU presets/defaults from TunerStudio
|
- Improved setting ECU presets/defaults from TunerStudio
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Improved TunerStudio protocol reliability - should see fewer CRC errors now
|
||||||
|
|
||||||
## October 2020 Release - "Sausage Pizza Day"
|
## October 2020 Release - "Sausage Pizza Day"
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -678,13 +678,14 @@ static void handleGetText(ts_channel_s *tsChannel) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handleExecuteCommand(ts_channel_s *tsChannel, char *data, int incomingPacketSize) {
|
static void handleExecuteCommand(ts_channel_s *tsChannel, char *data, int incomingPacketSize) {
|
||||||
sr5WriteCrcPacket(tsChannel, TS_RESPONSE_COMMAND_OK, nullptr, 0);
|
|
||||||
data[incomingPacketSize] = 0;
|
data[incomingPacketSize] = 0;
|
||||||
char *trimmed = efiTrim(data);
|
char *trimmed = efiTrim(data);
|
||||||
#if EFI_SIMULATOR
|
#if EFI_SIMULATOR
|
||||||
logMsg("execute [%s]\r\n", trimmed);
|
logMsg("execute [%s]\r\n", trimmed);
|
||||||
#endif
|
#endif
|
||||||
(console_line_callback)(trimmed);
|
(console_line_callback)(trimmed);
|
||||||
|
|
||||||
|
sr5WriteCrcPacket(tsChannel, TS_RESPONSE_COMMAND_OK, nullptr, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -311,17 +311,13 @@ void sr5WriteCrcPacket(ts_channel_s *tsChannel, uint8_t responseCode, const uint
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif /* TS_CAN_DEVICE */
|
#endif /* TS_CAN_DEVICE */
|
||||||
|
|
||||||
/*
|
|
||||||
if (size <= BLOCKING_FACTOR + 7) {
|
if (size <= BLOCKING_FACTOR + 7) {
|
||||||
// small packets use small packet optimization
|
// small packets use small packet optimization
|
||||||
sr5WriteCrcPacketSmall(tsChannel, responseCode, buf, size);
|
sr5WriteCrcPacketSmall(tsChannel, responseCode, buf, size);
|
||||||
} else {
|
} else {
|
||||||
*/
|
|
||||||
sr5WriteCrcPacketLarge(tsChannel, responseCode, buf, size);
|
sr5WriteCrcPacketLarge(tsChannel, responseCode, buf, size);
|
||||||
/*
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
sr5FlushData(tsChannel);
|
sr5FlushData(tsChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,14 +30,17 @@ static void assertCrcPacket() {
|
||||||
TEST(binary, testWriteCrc) {
|
TEST(binary, testWriteCrc) {
|
||||||
static ts_channel_s test;
|
static ts_channel_s test;
|
||||||
|
|
||||||
|
// Let it pick which impl (small vs large) to use
|
||||||
sr5TestWriteDataIndex = 0;
|
sr5TestWriteDataIndex = 0;
|
||||||
sr5WriteCrcPacket(nullptr, CODE, (const uint8_t * )PAYLOAD, SIZE);
|
sr5WriteCrcPacket(&test, CODE, (const uint8_t * )PAYLOAD, SIZE);
|
||||||
assertCrcPacket();
|
assertCrcPacket();
|
||||||
|
|
||||||
|
// Force the large impl
|
||||||
sr5TestWriteDataIndex = 0;
|
sr5TestWriteDataIndex = 0;
|
||||||
sr5WriteCrcPacketLarge(nullptr, CODE, (const uint8_t * )PAYLOAD, SIZE);
|
sr5WriteCrcPacketLarge(&test, CODE, (const uint8_t * )PAYLOAD, SIZE);
|
||||||
assertCrcPacket();
|
assertCrcPacket();
|
||||||
|
|
||||||
|
// Force the small impl
|
||||||
sr5TestWriteDataIndex = 0;
|
sr5TestWriteDataIndex = 0;
|
||||||
sr5WriteCrcPacketSmall(&test, CODE, (const uint8_t * )PAYLOAD, SIZE);
|
sr5WriteCrcPacketSmall(&test, CODE, (const uint8_t * )PAYLOAD, SIZE);
|
||||||
assertCrcPacket();
|
assertCrcPacket();
|
||||||
|
|
Loading…
Reference in New Issue