浏览代码

1、在加载头像图片前分配临时内存,也要先清理下内存并判断是否已分配,避免分配的内存数据错乱导致加载的图片有条纹等异常
2、本次传输头像过程失败后,不清除flash内存,以保留上次传输成功的图片显示

robbin 2 周之前
父节点
当前提交
7bdfa0ded1

+ 6 - 2
application/aem_watch/src/application/profile_photo/aem_profile_photo_screen.c

@@ -24,7 +24,7 @@ extern void ui_mem_res_free(void * ptr);
 extern void * ui_mem_res_alloc(size_t size);
 #endif
 
-static uint8_t *photo_data_buff;
+static uint8_t *photo_data_buff = NULL;
 static lv_img_dsc_t *img_dsc;
 
 typedef struct
@@ -105,8 +105,12 @@ static lv_obj_t *aem_profile_photo_arc_show_create(lv_obj_t *par)
                 
                 if ((photo_data_size > 0) && (photo_data_size <= PHOTO_DATA_MAX_SIZE))  //>0且≤360*360*3
                 {
-                    photo_data_buff = (uint8_t *)ui_mem_res_alloc(photo_data_size);  
+                    lvgl_res_clear_decoder_cache();
 
+                    if (photo_data_buff == NULL)
+                    {    
+                        photo_data_buff = (uint8_t *)ui_mem_res_alloc(photo_data_size);  
+                    }
                     flash_read("profile_photo_name", 3, photo_data_buff, photo_data_size);
                     //struct fs_file_t file = {0};
 

+ 2 - 2
application/aem_watch/src/user_cfg/device_info_cfg.h

@@ -8,11 +8,11 @@
 #ifdef DMG_LCM
 #define MAJOR_VERSION 1
 #define MINOR_VERSION 1
-#define MICRO_VERSION 1
+#define MICRO_VERSION 2
 #else
 #define MAJOR_VERSION 2
 #define MINOR_VERSION 0
-#define MICRO_VERSION 2
+#define MICRO_VERSION 3
 #endif
 
 #define DEVICE_ID "CJ01"//3085

+ 1 - 1
thirdparty/lib/aem/config/aem_project.h

@@ -4,7 +4,7 @@
 #pragma warning(error : 4013)
 #endif
 #define AEM_VERSION "BL_Develop_NOR"
-#define BUILD_TIME "202505262045"
+#define BUILD_TIME "202505301650"
 #define AEM_GUI_FWK_LIB_VER "2.0.0.0"
 #define APP_DOWNLOAD_URL "https://customer.com"
 #define AEM_APP_TRANS_ANIMATION 1

+ 1 - 1
zephyr/drivers/serial/uart2_rec.c

@@ -746,7 +746,7 @@ static void flash_write_proc_timer_acts_handler(struct k_work *work)
 			{
 				tx_buff[0] = 0x55;
                 send_frame(SET_PROFILE_PHOTO_OVER, tx_buff, 1);
-				flash_erase(photo_name);  // 清空flash
+				//flash_erase(photo_name);  // 清空flash
 			}
 
 			memset(str_uart2_rec_data.rec_data, 0, REC_DATA_BUFFER_SIZE);