From fed81a25a14f245e36f692074dcec9fd1187c599 Mon Sep 17 00:00:00 2001 From: cfif Date: Tue, 28 Apr 2026 15:09:22 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- APP/blf.c | 2 +- APP/main.c | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/APP/blf.c b/APP/blf.c index 1301dd9..9fde65e 100644 --- a/APP/blf.c +++ b/APP/blf.c @@ -651,7 +651,7 @@ int blf_close(BLFContext *ctx) { /* Обновляем поля заголовка файла */ ctx->header.fileSize = (uint64_t)endPos; ctx->header.uncompressedFileSize = (uint64_t)endPos; - ctx->header.objectCount = ctx->objectCount; + ctx->header.objectCount = ctx->objectCount; // 9 /* Перезаписываем заголовок */ if (blf_file_seek(ctx, ctx->headerPos) != 0) { diff --git a/APP/main.c b/APP/main.c index 945542b..9fb8d18 100644 --- a/APP/main.c +++ b/APP/main.c @@ -53,7 +53,7 @@ int main() { .flags = CAN_MSG_FLAGS(CAN_DIR_RX, 0), .dlc = 8, .data = {0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8}, - .timestamp = 68000, + .timestamp = 0, // frameLength и bitCount не используются в старом формате //.frameLength = 216000, // 216 мкс = 108 бит * 2000 нс //.bitCount = 108 // классическое значение для 8 байт данных @@ -62,10 +62,10 @@ int main() { int j = 0; int k = 0; - for (uint32_t i = 0; i < 10000; ++i) { + for (uint32_t i = 1; i < 10; ++i) { // Заполняем данные - +/* canMsg.data[0] = j; canMsg.data[1] = j / 2; canMsg.data[2] = j / 3; @@ -74,13 +74,22 @@ int main() { canMsg.data[5] = j / 6; canMsg.data[6] = j / 7; canMsg.data[7] = j / 8; - - canMsg.timestamp += 1; +*/ + canMsg.data[0] = i; + canMsg.data[1] = i; + canMsg.data[2] = i; + canMsg.data[3] = i; + canMsg.data[4] = i; + canMsg.data[5] = i; + canMsg.data[6] = i; + canMsg.data[7] = i; if (blf_add_can_message_struct(&ctx, &canMsg) != 0) { return 1; } + canMsg.timestamp += 1100; + ++k; if (k > 100) { @@ -93,6 +102,7 @@ int main() { } + // Завершаем контейнер if (blf_end_container(&ctx) != 0) { BLF_ERROR_PRINTF("Failed to end container\n");