Add format emmc code.
This commit is contained in:
		
							parent
							
								
									126c130133
								
							
						
					
					
						commit
						b3eacd7bff
					
				|  | @ -1,4 +1,5 @@ | |||
| #include "PrjInc.h" | ||||
| #include "UIApp/Background/UIBackgroundObj.h" | ||||
| #include "sf_param_common.h" | ||||
| #include "sys_mempool.h" | ||||
| #include "Dx.h" | ||||
|  | @ -53,6 +54,7 @@ static UINT32 BackgroundCopyCard2ToCard1(void); | |||
| #endif | ||||
| static UINT32 BackgroundFormat(void); | ||||
| static UINT32 BackgroundFormatCard(void); | ||||
| static UINT32 BackgroundFormatEmmc(void); | ||||
| static UINT32 BackgroundFormatNand(void); | ||||
| static UINT32 BackgroundNumReset(void); | ||||
| #if (USE_DPOF==ENABLE) | ||||
|  | @ -143,6 +145,7 @@ BKG_JOB_ENTRY gBackgroundExtFuncTable[] = { | |||
| #endif | ||||
| 	{NVTEVT_BKW_FORMAT,             BackgroundFormat}, | ||||
| 	{NVTEVT_BKW_FORMAT_CARD,        BackgroundFormatCard}, | ||||
| 	{NVTEVT_BKW_FORMAT_EMMC,        BackgroundFormatEmmc}, | ||||
| 	{NVTEVT_BKW_FORMAT_NAND,        BackgroundFormatNand}, | ||||
| 	{NVTEVT_BKW_NUM_RESET,          BackgroundNumReset}, | ||||
| #if (USB_MODE==ENABLE) | ||||
|  | @ -856,6 +859,11 @@ UINT32 BackgroundFormat(void) | |||
| 	return (UINT32)ret; | ||||
| } | ||||
| 
 | ||||
| UINT32 BackgroundFormatEmmc(void) | ||||
| { | ||||
| 	printf(" BackgroundFormatEmmc\n "); | ||||
| 	return TRUE; | ||||
| } | ||||
| UINT32 BackgroundFormatCard(void) | ||||
| { | ||||
| 	int ret; | ||||
|  |  | |||
|  | @ -11,6 +11,7 @@ typedef enum { | |||
| 	NVTEVT_BKW_COPYCARD2ToCARD1, | ||||
| 	NVTEVT_BKW_FORMAT, | ||||
| 	NVTEVT_BKW_FORMAT_CARD, | ||||
| 	NVTEVT_BKW_FORMAT_EMMC, | ||||
| 	NVTEVT_BKW_FORMAT_NAND, | ||||
| 	NVTEVT_BKW_NUM_RESET, | ||||
| 	NVTEVT_BKW_SETDPOF, | ||||
|  |  | |||
|  | @ -1,4 +1,5 @@ | |||
| #include "PrjInc.h" | ||||
| #include "UIApp/Background/UIBackgroundObj.h" | ||||
| #include "UIFlowLVGL/UIFlowLVGL.h" | ||||
| #include "UIApp/Play/UIPlayComm.h" | ||||
| #include "UIFlowLVGL/UIFlowMenuCommonConfirm/UIFlowMenuCommonConfirmAPI.h" | ||||
|  | @ -301,6 +302,11 @@ void  UIFlowMenuCommonConfirmAPI_Open(uint32_t itemID) | |||
| 		gBKGEvt = NVTEVT_BKW_FORMAT_CARD; | ||||
| 		lv_label_set_text(Confirm_label, "Format SD"); | ||||
| 		break; | ||||
| 	case IDM_FORMAT_EMMC: | ||||
| 		strID = LV_PLUGIN_STRING_ID_STRING_FORMAT_SD; | ||||
| 		gBKGEvt = NVTEVT_BKW_FORMAT_EMMC; | ||||
| 		lv_label_set_text(Confirm_label, "Format EMMC"); | ||||
| 		break; | ||||
| 	case IDM_CAMERA_FW_UPGRADE: | ||||
| 		strID = LV_PLUGIN_STRING_ID_STRING_CAMERA_FW_UPGRADE; | ||||
| 		gBKGEvt = NVTEVT_BKW_CAMERA_FW_UPGRADE; | ||||
|  | @ -501,6 +507,10 @@ static void UIFlowMenuCommonConfirm_MessageBox_ValueChanged(lv_obj_t* obj, uint3 | |||
| 				set_msbox_hidden( true); | ||||
| 				UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRING_NO_SD, 3000); | ||||
| 			} | ||||
| 		} else if (gBKGEvt == NVTEVT_BKW_FORMAT_EMMC) { | ||||
| 			set_msbox_hidden( true); | ||||
| 			UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRING_FORMATING, 20000); | ||||
| 			BKG_PostEvent(NVTEVT_BKW_FORMAT_EMMC); | ||||
| 		} else if (gBKGEvt == NVTEVT_BKW_CAMERA_FW_UPGRADE) { | ||||
| 			if(sf_cardv_battery_value_get() < 40) | ||||
| 			{ | ||||
|  |  | |||
|  | @ -55,7 +55,8 @@ TMDEF_OPTION_TEXT_S(OPERATING_TIME_OFF, TM_OPTION_ENABLE) | |||
| TMDEF_OPTION_TEXT_S(OPERATING_TIME_ON, TM_OPTION_ENABLE) | ||||
| TMDEF_END_OPTIONS() | ||||
| TMDEF_BEGIN_OPTIONS(FORMAT_SD) | ||||
| TMDEF_OPTION_TEXT_S(END, TM_OPTION_ENABLE) | ||||
| TMDEF_OPTION_TEXT_S(OPERATING_TIME_OFF, TM_OPTION_ENABLE) | ||||
| TMDEF_OPTION_TEXT_S(OPERATING_TIME_ON, TM_OPTION_ENABLE) | ||||
| TMDEF_END_OPTIONS() | ||||
| TMDEF_BEGIN_OPTIONS(DATE_AND_TIME) | ||||
| TMDEF_OPTION_TEXT_S(DATE_AND_TIME_AUTO_UTC, TM_OPTION_ENABLE) | ||||
|  |  | |||
|  | @ -121,6 +121,7 @@ enum _MENU_ID { | |||
| 	IDM_DELAY, | ||||
| 	IDM_OPERATING_TIME, | ||||
| 	IDM_FORMAT_SD, | ||||
| 	IDM_FORMAT_EMMC, | ||||
| 	IDM_DATE_AND_TIME, | ||||
| 
 | ||||
| 	// Setting Send page
 | ||||
|  |  | |||
|  | @ -826,7 +826,10 @@ static void LV_MenuCommonItem_UpdateContent(TM_MENU *pMenu) | |||
| 						} | ||||
| 					} | ||||
| 					//#NT#2023/11/03#Eric - end
 | ||||
| 					lv_plugin_label_set_text(label_option_4_scr_uiflowmenucommonitem, pOption->TextId); | ||||
| 					if(pItem->ItemId == IDM_FORMAT_SD) | ||||
| 						lv_plugin_label_set_text(label_option_4_scr_uiflowmenucommonitem, IDS_END); | ||||
| 					else | ||||
| 						lv_plugin_label_set_text(label_option_4_scr_uiflowmenucommonitem, pOption->TextId); | ||||
| 					lv_plugin_label_update_font(label_option_4_scr_uiflowmenucommonitem, LV_OBJ_PART_MAIN); | ||||
| 					lv_obj_set_hidden(container_option_4_scr_uiflowmenucommonitem, false); | ||||
| 				}else if(i == 4){ | ||||
|  |  | |||
|  | @ -150,6 +150,7 @@ static int is_message_item(lv_obj_t* obj) | |||
| 	case IDM_OPERATING_TIME: | ||||
| 		break; | ||||
| 	case IDM_FORMAT_SD: | ||||
| 		break; | ||||
| 	{ | ||||
| 		printf("[is_message_item]IDM_FORMAT_SD\n"); | ||||
| 		UIFlowMenuCommonConfirmAPI_Open(itemID); | ||||
|  | @ -361,8 +362,25 @@ static void LV_MenuCommonOption_UpdateContent(TM_MENU *pMenu) | |||
| 			lv_plugin_menu_set_item_string_id(menu_option, i, LV_PLUGIN_MENU_ITEM_VISIBLE_STATE_NUM, pOption->TextId); | ||||
| 			 | ||||
| 			printf("s_SelOption: %d\n", s_SelOption); | ||||
| 			//first init page add select icon
 | ||||
| 			if (s_SelOption == 100){ | ||||
| 			if (IDM_FORMAT_SD == pItem->ItemId) { | ||||
| 				if (0 == SelOption && i == 0) { | ||||
| 					itemIconId = LV_PLUGIN_IMG_ID_SF_LIST_SELECTED;//√
 | ||||
| 					lv_obj_set_pos(image_option1_scr_uiflowmenucommonoption, 272, 0); | ||||
| 					ui_hidden = false; | ||||
| 				} else if (1 == SelOption && i == 1) { | ||||
| 					itemIconId = LV_PLUGIN_IMG_ID_SF_LIST_SELECTED;//√
 | ||||
| 					lv_obj_set_pos(image_option2_scr_uiflowmenucommonoption, 272, 0); | ||||
| 					ui_hidden = false; | ||||
| 				} else if (0 == SelOption && i == 1) { | ||||
| 					itemIconId = LV_PLUGIN_IMG_ID_SF_NEXT1;//>
 | ||||
| 					lv_obj_set_pos(image_option2_scr_uiflowmenucommonoption, 288, 0); | ||||
| 					ui_hidden = false; | ||||
| 				} else if (1 == SelOption && i == 0) { | ||||
| 					itemIconId = LV_PLUGIN_IMG_ID_SF_NEXT1;//>
 | ||||
| 					lv_obj_set_pos(image_option1_scr_uiflowmenucommonoption, 288, 0); | ||||
| 					ui_hidden = false; | ||||
| 				} | ||||
| 			} else if (s_SelOption == 100){//first init page add select icon
 | ||||
| 				if (enableIndex[i+(Selindex * OPTION_PAGE_NUM)] == SelOption) | ||||
| 				{ | ||||
| 					s_SelOption = i + (Selindex * OPTION_PAGE_NUM); | ||||
|  | @ -866,13 +884,15 @@ static void LV_MenuOption_OnSelected(lv_obj_t* obj) | |||
| 			pItem->ItemId == IDM_OPERATING_TIME || | ||||
| 			pItem->ItemId == IDM_DATE_AND_TIME || | ||||
| 			pItem->ItemId == IDM_MAX_NUM_DAY || | ||||
| 			pItem->ItemId == IDM_SEND_TYPE) | ||||
| 			pItem->ItemId == IDM_SEND_TYPE || | ||||
| 			pItem->ItemId == IDM_FORMAT_SD) | ||||
| 			&& (pOption->TextId == IDS_CAMERA_NAME_ON || | ||||
| 			pOption->TextId == IDS_DATE_AND_TIME_MANUAL || | ||||
| 			pOption->TextId == IDS_SEND_TYPE_ONCE_DAY || | ||||
| 			pOption->TextId == IDS_SEND_TYPE_TWICE_DAY || | ||||
| 			pOption->TextId == IDS_SEND_TYPE_4_TIMES_DAY || | ||||
| 			pOption->TextId == IDS_MAX_NUM_DAY_NUMBER)) | ||||
| 			pOption->TextId == IDS_MAX_NUM_DAY_NUMBER || | ||||
| 			pItem->ItemId == IDM_FORMAT_SD)) | ||||
| 		{ | ||||
| 			lv_obj_set_hidden(container_main_menu_scr_uiflowmenucommonoption, true); | ||||
| 			isSetting = 1; | ||||
|  | @ -899,6 +919,20 @@ static void LV_MenuOption_OnSelected(lv_obj_t* obj) | |||
| 			case IDM_SEND_TYPE: | ||||
| 				show_send_time_page(obj, SelOption); | ||||
| 				break; | ||||
| 			case IDM_FORMAT_SD: | ||||
| 				if (0 == SelOption) | ||||
| 				{ | ||||
| 					printf("format emmc.\n"); | ||||
| 					UIFlowMenuCommonConfirmAPI_Open(IDM_FORMAT_SD); | ||||
| 					break; | ||||
| 				} | ||||
| 				if (1 == SelOption) | ||||
| 				{ | ||||
| 					printf("format sd card.\n"); | ||||
| 					UIFlowMenuCommonConfirmAPI_Open(IDM_FORMAT_EMMC); | ||||
| 					break; | ||||
| 				} | ||||
| 				break; | ||||
| 			default: | ||||
| 				break; | ||||
| 			} | ||||
|  | @ -1124,6 +1158,7 @@ static void CommondOptionCloseSencondPage(lv_obj_t* obj, uint32_t* key) | |||
| 			} | ||||
| 			break; | ||||
| 		case IDM_FORMAT_SD: | ||||
| 			break; | ||||
| 		case IDM_DATE_AND_TIME: | ||||
| 			if(isSetting) | ||||
| 			{ | ||||
|  | @ -1279,6 +1314,8 @@ static void CommondOptionKeyCallback(lv_obj_t* obj, uint32_t* key) | |||
| 			} | ||||
| 			break; | ||||
| 		case IDM_FORMAT_SD: | ||||
| 			UIFlowMenuCommonOption_Key(obj, *key); | ||||
| 			break; | ||||
| 		case IDM_DATE_AND_TIME: | ||||
| 			if(isSetting) | ||||
| 			{ | ||||
|  |  | |||
|  | @ -1,4 +1,5 @@ | |||
| #include "PrjInc.h" | ||||
| #include "UIApp/Background/UIBackgroundObj.h" | ||||
| #include "UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgAPI.h" | ||||
| #include "UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.h" | ||||
| #include "UIFlowLVGL/UIFlowLVGL.h" | ||||
|  | @ -214,6 +215,14 @@ static void UIFlowWrnMsg_OnNVTMSG(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA | |||
| 	case NVTEVT_BACKGROUND_DONE: | ||||
| 		switch (message) | ||||
| 		{ | ||||
| 		case NVTEVT_BKW_FORMAT_EMMC: | ||||
| 		{ | ||||
| 			printf("Complete format emmc.\n"); | ||||
| 			lv_plugin_msgbox_set_text(msgbox, LV_PLUGIN_STRING_ID_STRING_COMPLETED); | ||||
| 			lv_plugin_label_set_text(label_msg_scr_uiflowwrnmsg, LV_PLUGIN_STRING_ID_STRING_COMPLETED); | ||||
| 			lv_msgbox_start_auto_close(msgbox, 3000); | ||||
| 			break; | ||||
| 		} | ||||
| 		case NVTEVT_BKW_FORMAT_CARD: | ||||
| 		{ | ||||
| 
 | ||||
|  | @ -221,10 +230,12 @@ static void UIFlowWrnMsg_OnNVTMSG(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA | |||
| 			if(ret == CMD_FORMAT_SD_OK) | ||||
| 			{ | ||||
| 				lv_plugin_msgbox_set_text(msgbox, LV_PLUGIN_STRING_ID_STRING_COMPLETED); | ||||
| 				lv_plugin_label_set_text(label_msg_scr_uiflowwrnmsg, LV_PLUGIN_STRING_ID_STRING_COMPLETED); | ||||
| 			} | ||||
| 			else | ||||
| 			{ | ||||
| 				lv_plugin_msgbox_set_text(msgbox, LV_PLUGIN_STRING_ID_STRING_FORMAT_ERR); | ||||
| 				lv_plugin_label_set_text(label_msg_scr_uiflowwrnmsg, LV_PLUGIN_STRING_ID_STRING_FORMAT_ERR); | ||||
| 			} | ||||
| 			lv_msgbox_start_auto_close(msgbox, 3000); | ||||
| 			printf("[%s]start auto close 3000ms", __FUNCTION__); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 xiaojiazhu
						xiaojiazhu