From 185dd63cf8eecdc488766743141ca05728d12fc2 Mon Sep 17 00:00:00 2001 From: "CSSC-WORK\\murmur" Date: Wed, 13 Sep 2023 14:56:34 +0800 Subject: [PATCH] =?UTF-8?q?packFile=20bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- applications/core.c | 3 +-- applications/ttmsg/ttmsg.c | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/applications/core.c b/applications/core.c index 5d98d9e..1f4615f 100644 --- a/applications/core.c +++ b/applications/core.c @@ -442,8 +442,7 @@ static void upSendFile_thread_entry(void *parameter) } LOG_D("ready to send '%s---%d'",f->fname,f->index); - static rt_uint8_t len =0; - len = pack_File(f->fname, 0, d, s); + uint8_t len = pack_File(f->fname, 0, d, s); for (size_t i = 0; i < len; i++) { LOG_HEX("msg",27,d[i],s[i]); } diff --git a/applications/ttmsg/ttmsg.c b/applications/ttmsg/ttmsg.c index 23ba05d..4cb634d 100644 --- a/applications/ttmsg/ttmsg.c +++ b/applications/ttmsg/ttmsg.c @@ -294,6 +294,7 @@ rt_uint8_t pack_File(const char *fin, rt_uint8_t flag, const rt_uint8_t (*dout)[ } //更新算法,改用特定大小依次读取文件,弃用一次性全部读入文件 +// static uint8_t row =0; uint8_t row = (file_size / flen) + (file_size % flen > 0 ? 1 : 0); cfg.fallpiece[0] = row; @@ -346,7 +347,8 @@ rt_uint8_t pack_File(const char *fin, rt_uint8_t flag, const rt_uint8_t (*dout)[ close(fd_in); } - return row; +// return row; + return cfg.fallpiece[0]; }