From: SnickerSun Date: Tue, 20 Aug 2024 10:01:33 +0000 (+0800) Subject: 修复异常造成mount user 分区失败问题 X-Git-Tag: release_V1.2.70_20241020_135402~618^2~1 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F741%2Fhead;p=mirrors%2FFD230.git 修复异常造成mount user 分区失败问题 --- diff --git a/code/sdk/application/brandy/brandy_standard/thread_init.c b/code/sdk/application/brandy/brandy_standard/thread_init.c index 51eb75b29..46f69521a 100755 --- a/code/sdk/application/brandy/brandy_standard/thread_init.c +++ b/code/sdk/application/brandy/brandy_standard/thread_init.c @@ -181,8 +181,9 @@ app_task_definition_t g_app_tasks[] = { (osThreadFunc_t)power_display_msg_thread, NULL, (CreateQueueFunction_t)power_display_task_init, USE_DTCM_MEM }, #endif - { { "save_file", 0, NULL, 0, NULL, SAVE_FILE_STACK_SIZE, TASK_PRIORITY_SAVE_FILE, 0, 0 }, - (osThreadFunc_t)save_file_main, NULL, NULL, USE_EXTEND_MEM }, + // user分区mount位置修改,save_file必须放到user分区mount之后 + // { { "save_file", 0, NULL, 0, NULL, SAVE_FILE_STACK_SIZE, TASK_PRIORITY_SAVE_FILE, 0, 0 }, + // (osThreadFunc_t)save_file_main, NULL, NULL, USE_EXTEND_MEM }, #ifdef SUPPORT_AUTO_OTA { { "auto_ota", 0, NULL, 0, NULL, AUTO_OTA_STACK_SIZE, TASK_PRIORITY_AUTO_OTA, 0, 0 }, (osThreadFunc_t)auto_ota_task_main, NULL, NULL, USE_EXTEND_MEM }, @@ -223,6 +224,7 @@ void save_file_main(void) } } + void set_app_delay_time(uint32_t time) { g_app_delay_ms = time; diff --git a/code/sdk/application/wearable/ohos_startup/ohosfwk_startup.c b/code/sdk/application/wearable/ohos_startup/ohosfwk_startup.c index 0d2b8bdcc..e69b7e5a1 100755 --- a/code/sdk/application/wearable/ohos_startup/ohosfwk_startup.c +++ b/code/sdk/application/wearable/ohos_startup/ohosfwk_startup.c @@ -86,6 +86,8 @@ void ohos_startup() #ifdef CFG_DRIVERS_NANDFLASH //为了加速启动,把最耗时的mount分区放到显示log之后 mount_user_res_partition(); + // user分区mount位置修改,save_file必须放到user分区mount之后 + start_save_file_thread(); #endif wait_animation_stop(); diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index d07253f7c..2ace3f24a 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -2759,3 +2759,27 @@ void uapi_get_a5133_rxdata_timestamp(uint32_t *timestamp) a5133_get_rxdata_timestamp(timestamp); #endif } + + +extern void save_file_main(void); + +#define SAVE_FILE_STACK_SIZE 0xC00 +#define TASK_PRIORITY_SAVE_FILE (osPriority_t)(36) +void start_save_file_thread(void) +{ + + app_task_definition_t taskcfg={0}; + PRINT("uapi_battery_init !\r\n"); + taskcfg.create_queue_handle = NULL; + taskcfg.attr.name="save_file"; + taskcfg.attr.priority = TASK_PRIORITY_SAVE_FILE; + taskcfg.attr.stack_size = SAVE_FILE_STACK_SIZE; + taskcfg.func = save_file_main; + taskcfg.use_mem = USE_EXTEND_MEM; + + errcode_t ret=uapi_create_osThread_custom(&taskcfg); + if(ret != ERRCODE_SUCC) + { + PRINT("create save file thread failed %d!\r\n",ret); + } +} diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.h b/code/sdk/drivers/peripheral/utils/custom_utils.h index d62487dc2..b32bf4fa4 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.h +++ b/code/sdk/drivers/peripheral/utils/custom_utils.h @@ -265,6 +265,14 @@ void uapi_get_a5133_rxdata_timestamp(uint32_t *timestamp); uint32_t uapi_get_a5133_update_state(void); uint32_t uapi_get_a5133_update_state1(void); + + + + +void start_save_file_thread(void); + + + #include "custom_utilscpp.h"