修复一个格式化字符串输出的问题
This commit is contained in:
parent
ed91c60d2d
commit
85fb66fac1
|
@ -9,7 +9,7 @@
|
|||
; https://docs.platformio.org/page/projectconf.html
|
||||
|
||||
[env:esp32-s2-sensor-recorder]
|
||||
platform = espressif32@5.2.0
|
||||
platform = espressif32@6.4.0
|
||||
board = adafruit_metro_esp32s2
|
||||
board_build.flash_mode = qio
|
||||
board_upload.flash_size = 16MB
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
void InterSerial::Init(DataRecorder* r, ConfigManager* c)
|
||||
{
|
||||
Serial1.begin(115200);
|
||||
Serial1.begin(115200, SERIAL_8N1, 18, 17);
|
||||
cmdLine = "";
|
||||
rec = r;
|
||||
cfg = c;
|
||||
|
@ -122,7 +122,7 @@ void InterSerial::ParseCmd(String cmd)
|
|||
result += ",";
|
||||
char tmpHex[2] = {0};
|
||||
for (int i = 0; i < dataLen; i++) {
|
||||
sprintf(tmpHex, "%X", dataBuf[i]);
|
||||
sprintf(tmpHex, "%02X", dataBuf[i]);
|
||||
result += tmpHex[0];
|
||||
result += tmpHex[1];
|
||||
}
|
||||
|
|
|
@ -122,7 +122,7 @@ void UpperSerial::ParseCmd(String cmd)
|
|||
result += ",";
|
||||
char tmpHex[2] = {0};
|
||||
for (int i = 0; i < dataLen; i++) {
|
||||
sprintf(tmpHex, "%X", dataBuf[i]);
|
||||
sprintf(tmpHex, "%02X", dataBuf[i]);
|
||||
result += tmpHex[0];
|
||||
result += tmpHex[1];
|
||||
}
|
||||
|
|
Reference in New Issue