diff --git a/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto_Exe.c b/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto_Exe.c index 4b35b1865..e183ce17f 100755 --- a/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto_Exe.c +++ b/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto_Exe.c @@ -6971,16 +6971,7 @@ INT32 PhotoExe_Preview_SliceEncode_CB3(void* user_data) } else { - DBG_WRN("filesys not ready, store data into mem\n"); - SYS_USRMEM usrmem = {0}; - - if(sys_usrmem_init(&usrmem) == E_OK){ - sys_usrmem_write_photo( - &usrmem, - (UINT32) queue_ele_in->jpg_thumb_addr, - queue_ele_in->jpg_thumb_size - ); - } + sf_mem_write_photo((UINT32)queue_ele_in->jpg_thumb_addr, queue_ele_in->jpg_thumb_size); } if(PhotoCapMsgCb){ diff --git a/code/application/source/sf_app/code/source/app/sf_service.c b/code/application/source/sf_app/code/source/app/sf_service.c index 9256e2f22..5b5b39a4c 100755 --- a/code/application/source/sf_app/code/source/app/sf_service.c +++ b/code/application/source/sf_app/code/source/app/sf_service.c @@ -1276,20 +1276,21 @@ SINT32 sf_cardv_file_to_app_send_thread(void) { SINT32 s32ret = 0; SF_FN_PARAM_S stpfncallback = {0}; UIMenuStoreInfo *puiPara = sf_app_ui_para_get(); + sf_share_mem_file_init(); if(SF_FAILURE == sf_check_sd()) { MLOGE("ERROR sf_check_sd\n"); #if SF_NO_SD_SEND == ENABLE - if((0 == puiPara->SendType) && (0 == sf_usr_mem_photo_ch())) + if((0 == puiPara->SendType)) { + sf_4G_status_set(SF_4G_SENDING); s32ret = sf_mem_send_file_to_ftp(); - return s32ret; + sf_4G_status_set(SF_4G_FREE); } #endif - - return SF_FAILURE; + goto SEND_FILE_END; } stpfncallback.pstParam = sf_customer_param_get(); stpfncallback.pstaticParam = sf_app_ui_para_get(); @@ -1298,7 +1299,6 @@ SINT32 sf_cardv_file_to_app_send_thread(void) { pthread_detach(pthread_self()); - sf_share_mem_file_init(); // s32ret = app_file_send_check(stpfncallback.pstaticParam); s32ret = sf_check_ftp_send(1); if (s32ret != SF_SUCCESS) { @@ -1317,6 +1317,7 @@ SINT32 sf_cardv_file_to_app_send_thread(void) { sf_set_gprs_errno(s32ret); } // app_file_transfer_Error_return_server(&stpfncallback); +SEND_FILE_END: ThumbSend.IsRun = 0; sf_file_thumb_cfg_clear(); sf_share_mem_file_down(1, s32ret); diff --git a/code/lib/source/sifar/code/include/sf_common.h b/code/lib/source/sifar/code/include/sf_common.h index 1355ae335..8de407da7 100755 --- a/code/lib/source/sifar/code/include/sf_common.h +++ b/code/lib/source/sifar/code/include/sf_common.h @@ -209,4 +209,5 @@ void sf_mem_free(void); void sf_cardv_battery_level_set(UINT32 val); void sf_cardv_statistics_param_reset(void); void sf_cardv_set_wifi_en(UINT32 cnt); +INT32 sf_mem_write_photo(UINT32 buf, UINT32 size); #endif diff --git a/code/lib/source/sifar/code/source/common/sf_common.c b/code/lib/source/sifar/code/source/common/sf_common.c index daa0cc2ec..ee93ea5e5 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -3568,4 +3568,28 @@ void sf_cardv_set_wifi_en(UINT32 cnt) } gpio_set_value(SF_WIFI_EN, cnt); printf("[%s:%d] e cnt:%d\n", __FUNCTION__, __LINE__,cnt); +} + +INT32 sf_mem_write_photo(UINT32 buf, UINT32 size) +{ + UINT32 fd = 0; + + MLOGD("filesys not ready, store data into mem\n"); + system("rm -rf /tmp/MEMPHOTO.JPG"); + system("sync"); + fd = open("/tmp/MEMPHOTO.JPG", O_WRONLY | O_CREAT); + if(fd) + { + lseek(fd, 0, SEEK_END); + write(fd, (void*)buf, size); + close(fd); + system("sync"); + if(SUCCESS == sf_share_mem_file_down(0, 0)){ + sf_set_send_statu(TRUE); + } + MLOGD("MEMPHOTO.JPG size:%ld\n", size); + return 0; + } + MLOGE("MEMPHOTO.JPG size:%ld\n", size); + return 1; } \ No newline at end of file