fix display of adcparam param4 for ct (#18397)

This commit is contained in:
Barbudor 2023-04-13 09:04:17 +02:00 committed by GitHub
parent b8483dfb6f
commit 870874d181
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -837,7 +837,13 @@ void CmndAdcParam(void) {
}
char param3[FLOATSZ];
dtostrfd(((double)Adc[idx].param3)/10000, precision, param3);
ResponseAppend_P(PSTR(",%s,%d"), param3, Adc[idx].param4);
if (ADC_CT_POWER == Adc[idx].type) {
char param4[FLOATSZ];
dtostrfd(((double)Adc[idx].param4)/10000, 3, param4);
ResponseAppend_P(PSTR(",%s,%s"), param3, param4);
} else {
ResponseAppend_P(PSTR(",%s,%d"), param3, Adc[idx].param4);
}
}
ResponseAppend_P(PSTR("]}"));
}