This commit is contained in:
Wolfgang Hottgenroth 2020-11-19 23:07:49 +01:00
parent 1d69022e1d
commit ada748edbb
No known key found for this signature in database
GPG Key ID: 656C88C7C1734267
2 changed files with 5 additions and 4 deletions

View File

@ -450,9 +450,6 @@ static void handleRequestEngine(void *handle) {
case MBCS_ERROR:
coloredMsg(LOG_RED, false, "mbc hre [%d] state ERROR", localMbusCommHandle->requestId);
show(LED_RED, ON);
mbusCommStats.errorCnt += 1;
localMbusCommHandle->device->failures += 1;
printError(localMbusCommHandle);
localMbusCommHandle->state = MBCS_ERROR_CONTINUED;
// no break
@ -462,6 +459,9 @@ static void handleRequestEngine(void *handle) {
case MBCS_TIMEOUT:
coloredMsg(LOG_RED, false, "mbc hre [%d] state TIMEOUT", localMbusCommHandle->requestId);
mbusCommStats.errorCnt += 1;
localMbusCommHandle->device->failures += 1;
printError(localMbusCommHandle);
localMbusCommHandle->receiving = false;
if (localMbusCommHandle->frame.userdata != NULL) {
free(localMbusCommHandle->frame.userdata);

View File

@ -390,7 +390,8 @@ void oledPrint(char msg[]) {
if (currentLine < MAX_LINES) {
memset(lines[currentLine], 0, MAX_CHARS);
strncpy(lines[currentLine], msg, MAX_CHARS);
memset(lines[currentLine] + strlen(msg), ' ', MAX_CHARS - strlen(msg) - 1);
lines[currentLine][MAX_CHARS - 1] = 0;
oled_P6x8Str(1, currentLine, lines[currentLine]);
currentLine++;
} else {