Skip to content

Commit fddb75b

Browse files
committed
change Log level & comment
1 parent 2ad6932 commit fddb75b

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/hasp/hasp_attribute.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,11 @@ static bool my_line_set_points(lv_obj_t* obj, const char* payload)
202202
for (const char* p = payload; *p; p++)
203203
if (*p == '[') count++;
204204
count--;
205-
// Create new points
206-
// Reserve memory for JsonDocument
207-
// StaticJsonDocument<1024> doc;
208-
205+
206+
// Reserve memory for JsonDocument rounded to upper 128 bytes
209207
uint16_t maxsize = 128u * (3*JSON_ARRAY_SIZE(1)*count / 128+1) ;
210208

211-
LOG_TRACE(TAG_ATTR,"payload: %s",payload);
209+
LOG_VERBOSE(TAG_ATTR,"payload: %s",payload);
212210
LOG_TRACE(TAG_ATTR,"count: %u maxsize: %u taille brut %u",count,maxsize,(uint32_t)(3*JSON_ARRAY_SIZE(1)*count));
213211

214212
DynamicJsonDocument doc(maxsize);
@@ -218,7 +216,7 @@ static bool my_line_set_points(lv_obj_t* obj, const char* payload)
218216
dispatch_json_error(TAG_ATTR, jsonError);
219217
return false;
220218
}
221-
LOG_TRACE(TAG_ATTR,"usage: %u",(uint32_t)doc.memoryUsage());
219+
LOG_VERBOSE(TAG_ATTR,"Memory usage: %u",(uint32_t)doc.memoryUsage());
222220

223221
JsonArray arr = doc.as<JsonArray>(); // Parse payload
224222
size_t tot_len = sizeof(lv_point_t*) * (arr.size());

0 commit comments

Comments
 (0)