fix sml dumpmode (#17690)

This commit is contained in:
gemu 2023-01-13 13:23:25 +01:00 committed by GitHub
parent 094f45fe7e
commit 3bddbdc5c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 103 additions and 92 deletions

View File

@ -681,7 +681,8 @@ void dump2log(void) {
}
}
} else {
if (type == 'o') {
switch (type) {
case 'o':
// obis
while (SML_SAVAILABLE) {
char c = SML_SREAD&0x7f;
@ -700,9 +701,10 @@ void dump2log(void) {
sml_globs.sml_logindex++;
}
}
} else if (type == 'v') {
break;
case 'v':
// vbus
uint8_t c;
{ uint8_t c;
while (SML_SAVAILABLE) {
c = SML_SREAD;
if (c == VBUS_SYNC) {
@ -717,9 +719,11 @@ void dump2log(void) {
sml_globs.sml_logindex += 3;
}
}
} else if (type == 'e') {
}
break;
case 'e':
// ebus
uint8_t c, p;
{ uint8_t c, p;
while (SML_SAVAILABLE) {
c = SML_SREAD;
if (c == EBUS_SYNC) {
@ -738,12 +742,16 @@ void dump2log(void) {
sml_globs.sml_logindex += 3;
}
}
} else if (type == 's') {
}
break;
case 's':
// sml
uint8_t c;
{ uint8_t c;
while (SML_SAVAILABLE) {
c = SML_SREAD;
if (c == SML_SYNC) {
sml_globs.log_data[sml_globs.sml_logindex] = 0;
AddLogData(LOG_LEVEL_INFO, sml_globs.log_data);
sml_globs.log_data[0] = ':';
sml_globs.log_data[1] = ' ';
sml_globs.sml_logindex = 2;
@ -753,7 +761,9 @@ void dump2log(void) {
sml_globs.sml_logindex += 3;
}
}
} else {
}
break;
default:
// raw dump
d_lastms = millis();
sml_globs.log_data[0] = ':';
@ -773,6 +783,7 @@ void dump2log(void) {
sml_globs.log_data[sml_globs.sml_logindex] = 0;
AddLogData(LOG_LEVEL_INFO, sml_globs.log_data);
}
break;
}
}
}