Converted variable 'chunkSize' to #define.

This commit is contained in:
ElVit
2025-02-20 10:49:34 +01:00
parent c29a39cba2
commit 762ff83d45
2 changed files with 4 additions and 3 deletions
+2 -3
View File
@@ -82,7 +82,6 @@ namespace esphome
std::string logStr;
char buffer[5];
size_t chunkSize = 90;
for (size_t i = 0; i < bytes.size(); i++)
{
@@ -90,9 +89,9 @@ namespace esphome
sprintf(buffer, "%02X", bytes[i]);
logStr += buffer;
}
for (size_t i = 0; i < logStr.length(); i += chunkSize)
for (size_t i = 0; i < logStr.length(); i += UART_LOG_CHUNK_SIZE)
{
ESP_LOGI(TAG, "%s %s", prefix.c_str(), logStr.substr(i, chunkSize).c_str());
ESP_LOGI(TAG, "%s %s", prefix.c_str(), logStr.substr(i, UART_LOG_CHUNK_SIZE).c_str());
delay(10);
}
}
+2
View File
@@ -15,6 +15,8 @@
#include <vector>
#include <string>
#define UART_LOG_CHUNK_SIZE 153
namespace esphome
{