Disable trampHandleResponse() instead of trampReceive()

This commit is contained in:
jflyper 2017-01-13 02:58:58 +09:00 committed by Raphael Coeffic
parent 5bbf4e13c1
commit 3d9a82e4ae
1 changed files with 6 additions and 3 deletions

View File

@ -226,6 +226,8 @@ void trampReceive(uint32_t currentTimeUs)
if (c == 0x0F) { if (c == 0x0F) {
trampReceiveState = S_WAIT_CODE; trampReceiveState = S_WAIT_CODE;
trampFrameStartUs = currentTimeUs; trampFrameStartUs = currentTimeUs;
} else {
trampReceivePos = 0;
} }
break; break;
@ -241,8 +243,9 @@ void trampReceive(uint32_t currentTimeUs)
case S_DATA: case S_DATA:
if (trampReceivePos == 16) { if (trampReceivePos == 16) {
uint8_t cksum = trampChecksum(trampRespBuffer); uint8_t cksum = trampChecksum(trampRespBuffer);
if ((trampRespBuffer[14] == cksum) && (trampRespBuffer[15] == 0)) if ((trampRespBuffer[14] == cksum) && (trampRespBuffer[15] == 0)) {
trampHandleResponse(); // trampHandleResponse();
}
trampReceiveState = S_WAIT_LEN; trampReceiveState = S_WAIT_LEN;
trampReceivePos = 0; trampReceivePos = 0;
@ -259,7 +262,7 @@ void trampProcess(uint32_t currentTimeUs)
if (trampStatus == TRAMP_STATUS_BAD_DEVICE) if (trampStatus == TRAMP_STATUS_BAD_DEVICE)
return; return;
trampReceive(currentTimeUs); // trampReceive(currentTimeUs);
if (trampStatus == TRAMP_STATUS_OFFLINE) { if (trampStatus == TRAMP_STATUS_OFFLINE) {
if (cmp32(currentTimeUs, lastQueryRTimeUs) > 1000 * 1000) { if (cmp32(currentTimeUs, lastQueryRTimeUs) > 1000 * 1000) {