提交 b6e3449c 编写于 作者: C chengjinsong2

lite-m 上param_service实时保存

Signed-off-by: Nchengjinsong2 <chengjinsong2@huawei.com>
上级 6f5ed9ed
......@@ -141,12 +141,17 @@ static int LoadPersistParam(void)
PARAM_CHECK(ret >= 0, break, "Failed to read file %s", path);
uint32_t currLen = 0;
char *tmp = buffer;
while (currLen < fileSize) {
if (buffer[currLen] == '\n') { // split line
buffer[currLen] = '\0';
ret = SplitParamString(buffer, NULL, 0, LoadOnePersistParam_, NULL);
ret = SplitParamString(tmp, NULL, 0, LoadOnePersistParam_, NULL);
PARAM_CHECK(ret == 0, continue, "Failed to set param %d %s", ret, buffer);
paramNum++;
if (currLen + 1 >= fileSize) {
break;
}
tmp = buffer + currLen + 1;
}
currLen++;
}
......
......@@ -138,18 +138,6 @@ void LiteParamService(void)
InitParamService();
// get persist param
LoadPersistParams();
osThreadAttr_t attr;
attr.name = "ParamServiceTask";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = 0;
attr.priority = osPriorityBelowNormal;
if (osThreadNew((osThreadFunc_t)ParamServiceTask, NULL, &attr) == NULL) {
PARAM_LOGE("Failed to create ParamServiceTask! %d", errno);
}
}
CORE_INIT(LiteParamService);
#endif
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册