You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all, I think there is a typo in display_bafang.cpp.
Sure it shouldn't be a comparison instead of an assignment. Line 115 in the else branch.
// Search for Start Code
if(BF_ctx->RxState == RXSTATE_STARTCODE) //waiting for start code
{
if(BF_ctx->SerialPort->available())
{
BF_ctx->LastRx = millis();
BF_ctx->RxBuff[0]=BF_ctx->SerialPort->read();
if(BF_ctx->RxBuff[0]==BF_CMD_STARTREQUEST) //valid request startcode detected
{
BF_ctx->RxCnt = 1;
BF_ctx->RxState = RXSTATE_REQUEST;
}
else if(BF_ctx->RxBuff[0]==BF_CMD_STARTINFO) //valid info startcode detected
{
BF_ctx->RxCnt = 1;
BF_ctx->RxState = RXSTATE_INFO;
}
else
{ BF_ctx->RxState == RXSTATE_WAITGAP;
}
}
}
The text was updated successfully, but these errors were encountered:
Yes you are right, does not make sense - have you checked if the bug has any effect in the current code (because the displays are working) and have you checked if it is still working with the assignment? We should correct it then.
I believe the path is only called in one exception. So there has been hardly any feedback so far. I only noticed it through a compiler warning. The code is currently being executed with the changed assignment and a SW102 reacts as desired. No matter how, a comparison makes no sense at this point, so it should be changed.
Hi all, I think there is a typo in display_bafang.cpp.
Sure it shouldn't be a comparison instead of an assignment. Line 115 in the else branch.
// Search for Start Code
if(BF_ctx->RxState == RXSTATE_STARTCODE) //waiting for start code
{
if(BF_ctx->SerialPort->available())
{
BF_ctx->LastRx = millis();
BF_ctx->RxBuff[0]=BF_ctx->SerialPort->read();
if(BF_ctx->RxBuff[0]==BF_CMD_STARTREQUEST) //valid request startcode detected
{
BF_ctx->RxCnt = 1;
BF_ctx->RxState = RXSTATE_REQUEST;
}
else if(BF_ctx->RxBuff[0]==BF_CMD_STARTINFO) //valid info startcode detected
{
BF_ctx->RxCnt = 1;
BF_ctx->RxState = RXSTATE_INFO;
}
else
{
BF_ctx->RxState == RXSTATE_WAITGAP;
}
}
}
The text was updated successfully, but these errors were encountered: