diff --git a/rtos/code/application/source/cardv/Makefile b/rtos/code/application/source/cardv/Makefile old mode 100644 new mode 100755 index 2bc2b4a3d..6365f8837 --- a/rtos/code/application/source/cardv/Makefile +++ b/rtos/code/application/source/cardv/Makefile @@ -254,9 +254,9 @@ SRC += \ ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Languages/Language_SC.c \ ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Languages/Language_TC.c \ ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Fonts/notosans_black_8_1bpp.c \ - ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Fonts/notosans_black_16_1bpp.c \ - ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Fonts/notosans_black_32_1bpp.c \ - ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Fonts/notosans_black_48_1bpp.c \ + ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Fonts/arialuni_16_1bpp.c \ + ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Fonts/arialuni_32_1bpp.c \ + ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Fonts/arialuni_48_1bpp.c \ ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Fonts/notosans_black_64_1bpp.c \ ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Fonts/notosans_black_128_1bpp.c \ ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Fonts/notosanscjkjp_black_16_1bpp.c \ diff --git a/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S530.h b/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S530.h old mode 100644 new mode 100755 index 7a2c9e064..29688a733 --- a/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S530.h +++ b/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S530.h @@ -1037,9 +1037,9 @@ ******************************************************************************************/ #define LV_USER_CFG_STAMP_FONT_ID_XXL LV_PLUGIN_FONT_ID_NOTOSANS_BLACK_128_1BPP #define LV_USER_CFG_STAMP_FONT_ID_XL LV_PLUGIN_FONT_ID_NOTOSANS_BLACK_64_1BPP -#define LV_USER_CFG_STAMP_FONT_ID_LARGE LV_PLUGIN_FONT_ID_NOTOSANS_BLACK_48_1BPP -#define LV_USER_CFG_STAMP_FONT_ID_MEDIUM LV_PLUGIN_FONT_ID_NOTOSANS_BLACK_32_1BPP -#define LV_USER_CFG_STAMP_FONT_ID_SMALL LV_PLUGIN_FONT_ID_NOTOSANS_BLACK_16_1BPP +#define LV_USER_CFG_STAMP_FONT_ID_LARGE LV_PLUGIN_FONT_ID_ARIALUNI_48_1BPP +#define LV_USER_CFG_STAMP_FONT_ID_MEDIUM LV_PLUGIN_FONT_ID_ARIALUNI_32_1BPP +#define LV_USER_CFG_STAMP_FONT_ID_SMALL LV_PLUGIN_FONT_ID_ARIALUNI_16_1BPP #define LV_USER_CFG_STAMP_FONT_ID_XS LV_PLUGIN_FONT_ID_NOTOSANS_BLACK_8_1BPP #define LV_USER_CFG_STAMP_LETTER_SPACE 0 @@ -1050,9 +1050,10 @@ #define LV_USER_CFG_STAMP_EXT_HEIGHT 0 /* please always fill ARGB8888, alpha channel will be discarded if output format is yuv (Photo UIDateImprint) */ -#define LV_USER_CFG_STAMP_COLOR_TEXT 0xFFFFFFFF /* text color */ -#define LV_USER_CFG_STAMP_COLOR_BACKGROUND 0XFF000000 /* background color */ -#define LV_USER_CFG_STAMP_COLOR_FRAME 0x00000000 /* frame color */ +#define LV_USER_CFG_STAMP_COLOR_TEXT 0xFFFFFFFF /* text color */ +#define LV_USER_CFG_STAMP_COLOR_BACKGROUND 0XFF000000 /* background color: black */ +#define LV_USER_CFG_MOVIE_DATESTAMP_COLOR_BACKGROUND 0X00000000 /* background color: none */ +#define LV_USER_CFG_STAMP_COLOR_FRAME 0x00000000 /* frame color */ /******************************************************************************************* * Enable LVGL rotate depend on VDO_USE_ROTATE_BUFFER (LV_USE_GPU_NVT_DMA2D in the lv_conf.h should be enabled) diff --git a/rtos/code/application/source/cardv/SrcCode/UIApp/MovieStamp/MovieStamp.c b/rtos/code/application/source/cardv/SrcCode/UIApp/MovieStamp/MovieStamp.c old mode 100644 new mode 100755 index 79f1f5019..75ac4a4c7 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/MovieStamp/MovieStamp.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/MovieStamp/MovieStamp.c @@ -1208,7 +1208,7 @@ void MovieStamp_UpdateData(void) //DBG_DUMP("i=%d, w=%d, %d, %d\r\n", i,g_VsOsdWidth[i], g_VsOsdHight[i],g_VsFontOut[i].GenImg.loff[0]); //MovieStamp_VsUpdateOsd(i, TRUE, 1, g_MovieStampPos[i].uiX, g_MovieStampPos[i].uiY, g_VsOsdWidth[i], g_VsOsdHight[i], (void*)g_pVsFontDataAddr[i]); - MovieStamp_CombineStamp(i, 0xF000); + MovieStamp_CombineStamp(i, 0x0); // update 1st stamp // if(MovieStamp_VsUpdateOsd(g_VEncHDPathId[i], TRUE, MOVIE_STAMP_LAYER1, VS_DATESTAMP_REGION, g_MovieStampPos[i].uiX, g_MovieStampPos[i].uiY, g_VsOsdWidth[i], g_VsOsdHight[i], (void*)g_pVsFontDataAddr[i])){ @@ -1490,7 +1490,7 @@ void MovieStamp_VsFontConfig(UINT32 uiVEncOutPortId) YUV_GET_RGB(y, u, v, r, g, b); #if defined(_UI_STYLE_LVGL_) - g_VsFontIn[uiVEncOutPortId].ciTransparet = ((LV_COLOR_GET_A32((lv_color32_t){.full = LV_USER_CFG_STAMP_COLOR_BACKGROUND}) >> 4) << 12) | ((g>>4)<<4) | (b>>4); //0x0000; + g_VsFontIn[uiVEncOutPortId].ciTransparet = ((LV_COLOR_GET_A32((lv_color32_t){.full = LV_USER_CFG_MOVIE_DATESTAMP_COLOR_BACKGROUND}) >> 4) << 12) | ((g>>4)<<4) | (b>>4); //0x0000; #else g_VsFontIn[uiVEncOutPortId].ciTransparet = ((r>>4)<<8) | ((g>>4)<<4) | (b>>4); //0x0000; #endif diff --git a/rtos/code/application/source/cardv/SrcCode/UIApp/Photo/UIDateImprint.c b/rtos/code/application/source/cardv/SrcCode/UIApp/Photo/UIDateImprint.c old mode 100644 new mode 100755 index bbdf1141f..827c91a08 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/Photo/UIDateImprint.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/Photo/UIDateImprint.c @@ -209,7 +209,7 @@ typedef struct { GXIMG_CP_ENG copyEngine; UINT32 lockptn; BOOL isStrDirty; - CHAR StrBuf[128]; + CHAR StrBuf[64]; UINT32 pic_cnt; } DATE_IMPRINT_INFO; @@ -508,6 +508,8 @@ void UiDateImprint_SelStampFont(UINT32 uiImageWidth, char **font, UINT32 *ScaleF red_id = LV_USER_CFG_STAMP_FONT_ID_XXL; } + printf("[%s:%d]uiImageWidth=%d,stamp font id=%d\n", __FUNCTION__, __LINE__, uiImageWidth, red_id); + *font = (char *) lv_plugin_get_font(red_id)->font; #else @@ -585,6 +587,8 @@ void UiDateImprint_GetStampFont(UINT32 uiImageWidth, char **font) red_id = LV_USER_CFG_STAMP_FONT_ID_XXL; } + printf("[%s:%d]uiImageWidth=%d,stamp font id=%d\n", __FUNCTION__, __LINE__, uiImageWidth, red_id); + *font = (char *) lv_plugin_get_font(red_id)->font; #else diff --git a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFastCapDateImprint.c b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFastCapDateImprint.c old mode 100644 new mode 100755 index 9dddd3ab1..e01d02498 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFastCapDateImprint.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFastCapDateImprint.c @@ -23,27 +23,45 @@ #define __DBGFLT__ "*" //*=All, [mark]=CustomClass #include +#include "UIInfo/UIInfo.h" + +#include "sf_battery.h" + #if PHOTO_STAMP_ISP_STATUS == DISABLE + +char StampStr[256] = {0}; + static char* PhotoFast_InitStrBuf(void) { - char *str = NULL; + char *dateStr = NULL; + INT16 cTemper = 0; + INT16 fTemper = 0; + UINT8 temperStr[16] = {0}; + + //UIMenuStoreInfo *puiPara = sf_ui_para_get(); + DateTime_Load(); switch (UI_GetData(FL_DATE_STAMP)) { case DATEIMPRINT_DATE: - str = DateTime_MakeYMD(); + dateStr = DateTime_MakeYMD(); break; case DATEIMPRINT_DATE_TIME: default: - str = DateTime_MakeYMDHMS(); - break; - + dateStr = DateTime_MakeYMDHMS(); break; } - return str; + sf_stamp_temperature_get(&fTemper, &cTemper); + snprintf((char *)temperStr, sizeof(temperStr), "%d%c%cF %d%c%cC", fTemper, 0xC2, 0xB0, cTemper, 0xC2, 0xB0); + printf("[%s:%d]temperStr=%s\n", __FUNCTION__, __LINE__, temperStr); + + snprintf((char *)StampStr, sizeof(StampStr), "%s %s", temperStr, dateStr); + printf("[%s:%d]StampStr=%s\n", __FUNCTION__, __LINE__, StampStr); + + return StampStr; } /************************************************************************* @@ -73,6 +91,8 @@ void PhotoFast_SelStampFont(UINT32 uiImageWidth, char **font, UINT32 *ScaleFacto red_id = LV_USER_CFG_STAMP_FONT_ID_XS; } + printf("[%s:%d]uiImageWidth=%d,stamp font id=%d\n", __FUNCTION__, __LINE__, uiImageWidth, red_id); + // DBG_DUMP("**** red_id = %lu\n", red_id); *font = (char *) lv_plugin_get_font(red_id)->font; @@ -125,8 +145,8 @@ void PhotoFast_SelStampFont(UINT32 uiImageWidth, char **font, UINT32 *ScaleFacto /* YUV color key */ #define CKEY_Y 0x0 -#define CKEY_U 0x88 -#define CKEY_V 0x88 +#define CKEY_U 0x80 +#define CKEY_V 0x80 #define CKEY ((CKEY_Y & 0xFF) | ((CKEY_U & 0xFF) << 8) | ((CKEY_V & 0xFF) << 16)) #define LV_USER_FONT_CONV_ALIGN_W 8 @@ -456,9 +476,11 @@ void UiDateImprint_DrawBG(UINT32 stamp_height, HD_VIDEO_FRAME* Img) param.color = LV_USER_CFG_STAMP_COLOR_BACKGROUND; /* ARGB format */ param.thickness = 10; param.rect.w = Img->dim.w; - param.rect.h = stamp_height; + //param.rect.h = stamp_height; + //printf("[%s:%d]stamp_height=%d\n", __FUNCTION__, __LINE__, stamp_height); + param.rect.h = stamp_height/10*12; //50/10*12 = 60 param.rect.x = 0; - param.rect.y = Img->dim.h - stamp_height; + param.rect.y = Img->dim.h - 58; param.type = HD_GFX_RECT_SOLID; hd_gfx_draw_rect(¶m); @@ -583,10 +605,20 @@ void UiDateImprint_AttachICON(UINT32 stamp_height, HD_VIDEO_FRAME* Img, lv_plugi param_img.src_region.h = src_img.dim.h; param_img.engine = 0; param_img.dst_img = *Img; - param_img.dst_region.w = (src_img.dim.w / src_img.dim.h) * stamp_height; + printf("[%s:%d]src_img.dim.w=%d,src_img.dim.h=%d\n", __FUNCTION__, __LINE__, src_img.dim.w, src_img.dim.h); + param_img.dst_region.w = ((src_img.dim.w / src_img.dim.h) * stamp_height); param_img.dst_region.h = stamp_height; - param_img.dst_region.x = (*x_curr_ofs - padding - param_img.dst_region.w); - param_img.dst_region.y = param_img.dst_img.dim.h - param_img.dst_region.h; + printf("[%s:%d]param_img.dst_region.w=%d,param_img.dst_region.h=%d\n", __FUNCTION__, __LINE__, param_img.dst_region.w, param_img.dst_region.h); + if(res_id == LV_PLUGIN_IMG_ID_ICON_10234_GPS) + { + param_img.dst_region.x = (*x_curr_ofs - param_img.dst_region.w); + } + else + { + param_img.dst_region.x = (*x_curr_ofs - padding - param_img.dst_region.w); + } + printf("[%s:%d]param_img.dst_region.x=%d\n", __FUNCTION__, __LINE__, param_img.dst_region.x); + param_img.dst_region.y = param_img.dst_img.dim.h - param_img.dst_region.h - 2; vf_gfx_scale(¶m_img, 1); @@ -595,13 +627,156 @@ void UiDateImprint_AttachICON(UINT32 stamp_height, HD_VIDEO_FRAME* Img, lv_plugi *x_curr_ofs = param_img.dst_region.x; } +void UiDateImprint_AttachString(UINT32 stamp_height, HD_VIDEO_FRAME* Img, UINT8* name, bool enable_ckey, UINT32 padding, UINT32* x_curr_ofs) +{ + VF_GFX_SCALE param_img = {0}; + HD_VIDEO_FRAME src_img; + + stamp_text.draw_cfg.string.text = (char *)name; + + lv_user_font_conv_calc_buffer_size(&stamp_text.draw_cfg, &stamp_text.buff_size); + lv_user_font_conv(&stamp_text.draw_cfg, &stamp_text.mem_cfg); + lv_user_font_conv_cfg_to_hd_frame( + &stamp_text.draw_cfg, + &stamp_text.mem_cfg, + stamp_text.buff_size.width, + stamp_text.buff_size.height, + &src_img + ); + + memset(¶m_img, 0, sizeof(param_img)); + param_img.quality = HD_GFX_SCALE_QUALITY_NULL; + param_img.src_img = src_img; + param_img.src_region.x = 0; + param_img.src_region.y = 0; + param_img.src_region.w = src_img.dim.w; + param_img.src_region.h = src_img.dim.h; + param_img.engine = 0; + param_img.dst_img = *Img; + param_img.dst_region.w = (src_img.dim.w / src_img.dim.h) * stamp_height; + param_img.dst_region.h = stamp_height; + param_img.dst_region.x = (*x_curr_ofs - padding - param_img.dst_region.w); + param_img.dst_region.y = param_img.dst_img.dim.h - param_img.dst_region.h; + + vf_gfx_scale(¶m_img, 1); + + *x_curr_ofs = param_img.dst_region.x; +} + +void sf_get_gps_info_str(UINT8 *str, UINT8 type) +{ + UINT32 i = 0; + UIMenuStoreInfo *puiPara = sf_ui_para_get(); + + printf("[%s:%d]puiPara->GpsSwitch=%d,puiPara->Latitude:%s,puiPara->Longitude:%s\n", + __FUNCTION__, __LINE__, puiPara->GpsSwitch, puiPara->Latitude, puiPara->Longitude); + if(puiPara->GpsSwitch == SF_ON) + { + if((puiPara->Latitude[0] == '\0') || (puiPara->Longitude[0] == '\0')) + { + str[0] = '\0'; + } + else if(type == 1) + { + str[i++] = puiPara->Latitude[9]; + str[i++] = puiPara->Latitude[0]; + str[i++] = puiPara->Latitude[1]; + str[i++] = 0xC2; + str[i++] = 0xB0; + str[i++] = puiPara->Latitude[2]; + str[i++] = puiPara->Latitude[3]; + str[i++] = 0x27; // ' + str[i++] = puiPara->Latitude[5]; + str[i++] = puiPara->Latitude[6]; + str[i++] = 0x22; // " + str[i++] = ' '; + str[i++] = puiPara->Longitude[10]; + str[i++] = puiPara->Longitude[0]; + str[i++] = puiPara->Longitude[1]; + str[i++] = puiPara->Longitude[2]; + str[i++] = 0xC2; + str[i++] = 0xB0; + str[i++] = puiPara->Longitude[3]; + str[i++] = puiPara->Longitude[4]; + str[i++] = 0x27; // ' + str[i++] = puiPara->Longitude[6]; + str[i++] = puiPara->Longitude[7]; + str[i++] = 0x22; // " + str[i++] = '\0'; + } + else if(type == 2) + { + str[i++] = puiPara->Latitude[9]; + str[i++] = puiPara->Latitude[0]; + str[i++] = puiPara->Latitude[1]; + str[i++] = 0x2A; + str[i++] = puiPara->Latitude[2]; + str[i++] = puiPara->Latitude[3]; + str[i++] = 0x27; // ' + str[i++] = puiPara->Latitude[5]; + str[i++] = puiPara->Latitude[6]; + str[i++] = 0x22; // " + str[i++] = ' '; + str[i++] = puiPara->Longitude[10]; + str[i++] = puiPara->Longitude[0]; + str[i++] = puiPara->Longitude[1]; + str[i++] = puiPara->Longitude[2]; + str[i++] = 0x2A; + str[i++] = puiPara->Longitude[3]; + str[i++] = puiPara->Longitude[4]; + str[i++] = 0x27; // ' + str[i++] = puiPara->Longitude[6]; + str[i++] = puiPara->Longitude[7]; + str[i++] = 0x22; // " + str[i++] = '\0'; + } + else if(type == 3) + { + str[i++] = puiPara->Latitude[9]; + str[i++] = puiPara->Latitude[0]; + str[i++] = puiPara->Latitude[1]; + str[i++] = '.'; + str[i++] = puiPara->Latitude[2]; + str[i++] = puiPara->Latitude[3]; + str[i++] = '.'; + str[i++] = puiPara->Latitude[5]; + str[i++] = puiPara->Latitude[6]; + str[i++] = '-'; + + str[i++] = puiPara->Longitude[10]; + str[i++] = puiPara->Longitude[0]; + str[i++] = puiPara->Longitude[1]; + str[i++] = puiPara->Longitude[2]; + str[i++] = '.'; + str[i++] = puiPara->Longitude[3]; + str[i++] = puiPara->Longitude[4]; + str[i++] = '.'; + str[i++] = puiPara->Longitude[6]; + str[i++] = puiPara->Longitude[7]; + str[i++] = '\0'; + } + } + else + { + str[0] = '\0'; + } + + printf("[%s:%d]str:%s\n", __FUNCTION__, __LINE__, str); + return; +} + INT32 PhotoFastCapDateImprint_GenYuvData(HD_VIDEO_FRAME *pDstImg) { HD_VIDEO_FRAME src_img; VF_GFX_COPY param_text = {0}; UINT32 padding = 0; UINT32 x_curr_ofs = 0; /* start from date stamp */ + UINT8 customString[32] = {0}; + INT32 year = 0, month = 0, day = 0; + UINT8 moonday = 0; + UINT8 batValue = 0; + UIMenuStoreInfo *puiPara = sf_ui_para_get(); /* select font by image width */ @@ -611,12 +786,8 @@ INT32 PhotoFastCapDateImprint_GenYuvData(HD_VIDEO_FRAME *pDstImg) #else stamp_text.draw_cfg.string.font = (lv_font_t *) lv_plugin_get_font(FONT)->font; #endif - #if PHOTO_STAMP_ISP_STATUS == ENABLE - stamp_text.draw_cfg.string.text = &photo_aesteam[0];// STRING; - #else - stamp_text.draw_cfg.string.text = PhotoFast_InitStrBuf(); - #endif + stamp_text.draw_cfg.string.text = PhotoFast_InitStrBuf(); lv_user_font_conv_calc_buffer_size(&stamp_text.draw_cfg, &stamp_text.buff_size); lv_user_font_conv(&stamp_text.draw_cfg, &stamp_text.mem_cfg); @@ -629,14 +800,8 @@ INT32 PhotoFastCapDateImprint_GenYuvData(HD_VIDEO_FRAME *pDstImg) &src_img ); - - padding = src_img.dim.h; - x_curr_ofs = pDstImg->dim.w - src_img.dim.w; - + //draw background UiDateImprint_DrawBG(src_img.dim.h, pDstImg); - UiDateImprint_AttachLogo(src_img.dim.h, pDstImg); - UiDateImprint_AttachICON(src_img.dim.h, pDstImg, LV_PLUGIN_IMG_ID_ICON_1020A, true, padding, &x_curr_ofs); - UiDateImprint_AttachICON(src_img.dim.h, pDstImg, LV_PLUGIN_IMG_ID_ICON_1021E, true, padding, &x_curr_ofs); memset(¶m_text, 0, sizeof(param_text)); param_text.src_img = src_img; @@ -645,13 +810,62 @@ INT32 PhotoFastCapDateImprint_GenYuvData(HD_VIDEO_FRAME *pDstImg) param_text.src_region.w = src_img.dim.w; param_text.src_region.h = src_img.dim.h; param_text.dst_img = *pDstImg; - param_text.dst_pos.x = pDstImg->dim.w - src_img.dim.w; + param_text.dst_pos.x = pDstImg->dim.w - src_img.dim.w - src_img.dim.h/2; param_text.dst_pos.y = pDstImg->dim.h - src_img.dim.h; param_text.alpha = 255; param_text.colorkey = CKEY; param_text.engine = 0; vf_gfx_copy(¶m_text); + padding = src_img.dim.h; + x_curr_ofs = param_text.dst_pos.x; + + //logo stamp + UiDateImprint_AttachLogo(src_img.dim.h * 3, pDstImg); + + //moon stamp + year = DateTime_Get(DATETIME_YEAR); + month = DateTime_Get(DATETIME_MONTH); + day = DateTime_Get(DATETIME_DAY); + printf("[%s:%d]get date time:%04d %02d %02d\n", __FUNCTION__, __LINE__, year, month, day); + moonday = (sf_solar_to_Lunar(year, month, day)) - 1; + UiDateImprint_AttachICON(src_img.dim.h, pDstImg, LV_PLUGIN_IMG_ID_ICON_10200_MOON + moonday, true, padding, &x_curr_ofs); + + //battery stamp + batValue = sf_battery_level_get(); + if(batValue < SF_BATT_LEVEL_1) + { + batValue = 1; + } + batValue -= 1; + UiDateImprint_AttachICON(src_img.dim.h, pDstImg, LV_PLUGIN_IMG_ID_ICON_10230_BATTERT + batValue, true, padding, &x_curr_ofs); + printf("[%s:%d]moonday=%d,batValue=%d\n", __FUNCTION__, __LINE__, moonday, batValue); + + //camid stamp + if((puiPara->CamNameSwitch == SF_CAMID_ON) && (puiPara->CamNameStr[0] != '\0')) + { + snprintf((char *)customString, sizeof(customString), "%s", puiPara->CamNameStr); + printf("[%s:%d]customString=%s\n", __FUNCTION__, __LINE__, customString); + //sprintf(customString, "Cam1"); + UiDateImprint_AttachString(src_img.dim.h, pDstImg, customString, true, padding, &x_curr_ofs); + } + + //gps stamp + //sprintf((char *)puiPara->Latitude, "3458.3100N"); + //sprintf((char *)puiPara->Longitude, "12294.4200E"); + sf_get_gps_info_str(customString, 1); + if(puiPara->GpsSwitch == SF_ON) + { + if(customString[0] != '\0') + { + //snprintf((char *)customString, sizeof(customString), "N22%c%c34'57\" E113%c%c55'19\"", 0xC2, 0xB0, 0xC2, 0xB0); + printf("[%s:%d]customString=%s\n", __FUNCTION__, __LINE__, customString); + UiDateImprint_AttachString(src_img.dim.h, pDstImg, customString, true, padding, &x_curr_ofs); + } + + UiDateImprint_AttachICON(src_img.dim.h, pDstImg, LV_PLUGIN_IMG_ID_ICON_10234_GPS, true, padding, &x_curr_ofs); + } + return E_OK; } @@ -695,11 +909,8 @@ INT32 PhotoFastCapDateImprint_GenYuvData2(HD_VIDEO_FRAME *pDstImg) stamp_text.draw_cfg.string.font = (lv_font_t *) lv_plugin_get_font(FONT)->font; #endif - #if PHOTO_STAMP_ISP_STATUS == ENABLE - stamp_text.draw_cfg.string.text = &photo_aesteam[0];// STRING; - #else stamp_text.draw_cfg.string.text = PhotoFast_InitStrBuf(); - #endif + lv_user_font_conv_calc_buffer_size(&stamp_text.draw_cfg, &stamp_text.buff_size); lv_user_font_conv(&stamp_text.draw_cfg, &stamp_text.mem_cfg); diff --git a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFastSliceEncode.c b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFastSliceEncode.c old mode 100644 new mode 100755 index 3eb107598..1af6c66e1 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFastSliceEncode.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFastSliceEncode.c @@ -100,25 +100,25 @@ static PhotoFast_SliceEncode_Info* PhotoFast_SliceEncode_Get_Info(const PHOTO_EN } static void PhotoFast_SliceEncode_Get_Src_Slice_Info( - const PhotoFast_SliceSize_Info *dst_info, - PhotoFast_SliceSize_Info *src_info, - const HD_VIDEO_FRAME video_frame) + const PhotoFast_SliceSize_Info *dst_info, + PhotoFast_SliceSize_Info *src_info, + const HD_VIDEO_FRAME video_frame) { - src_info->slice_num = dst_info->slice_num; - src_info->width = video_frame.dim.w; - src_info->height = video_frame.dim.h; + src_info->slice_num = dst_info->slice_num; + src_info->width = video_frame.dim.w; + src_info->height = video_frame.dim.h; - if(src_info->slice_num > 1){ - src_info->slice_height = ALIGN_CEIL(video_frame.dim.h / src_info->slice_num, 2); - src_info->last_slice_height = src_info->height - src_info->slice_height * (src_info->slice_num - 1); - } - else{ - src_info->slice_height = video_frame.dim.h; - src_info->last_slice_height = src_info->slice_height; - } + if(src_info->slice_num > 1){ + src_info->slice_height = ALIGN_CEIL((src_info->width * dst_info->slice_height) / dst_info->width, 2); + src_info->last_slice_height = ALIGN_CEIL(src_info->height - src_info->slice_height * (src_info->slice_num - 1), 2); + } + else{ + src_info->slice_height = video_frame.dim.h; + src_info->last_slice_height = src_info->slice_height; + } - PHOTOFAST_SLICE_ENC_DUMP("Src Slice Info: size = {%lu,%lu} slice num = {%lu} slice height = {%lu} last slice height = {%lu}\r\n", - src_info->width, src_info->height, src_info->slice_num, src_info->slice_height, src_info->last_slice_height); + PHOTOFAST_SLICE_ENC_DUMP("Src Slice Info: size = {%lu,%lu} slice num = {%lu} slice height = {%lu} last slice height = {%lu}\r\n", + src_info->width, src_info->height, src_info->slice_num, src_info->slice_height, src_info->last_slice_height); } INT32 PhotoFast_SliceEncode_Get_Max_Dst_Slice_Buffer_Size(HD_VIDEO_PXLFMT pxl_fmt) @@ -570,81 +570,99 @@ static INT32 PhotoFast_SliceEncode_Get_Enc_Buffer_Info(const HD_PATH_ID enc_path } static INT32 PhotoFast_SliceEncode_Init_VF_GFX_Slice( - VF_GFX_SCALE* vf_gfx_scale_param, - const HD_VIDEO_FRAME* video_frame, - const PhotoFast_MEM_Info dst_buffer_info, - const PhotoFast_SliceSize_Info src_slice_info, - const PhotoFast_SliceSize_Info dst_slice_info, - const UINT8 slice_idx) + VF_GFX_SCALE* vf_gfx_scale_param, + const HD_VIDEO_FRAME* video_frame, + const PhotoFast_MEM_Info dst_buffer_info, + const PhotoFast_SliceSize_Info src_slice_info, + const PhotoFast_SliceSize_Info dst_slice_info, + const UINT8 slice_idx) { - HD_RESULT ret; - UINT32 addr_src[HD_VIDEO_MAX_PLANE] = {0}; - UINT32 addr_dst[HD_VIDEO_MAX_PLANE] = {0}; - UINT32 loff_src[HD_VIDEO_MAX_PLANE] = {0}; - UINT32 loff_dst[HD_VIDEO_MAX_PLANE] = {0}; - UINT32 offset; - UINT32 scr_slice_height = (slice_idx == (src_slice_info.slice_num - 1)) ? src_slice_info.last_slice_height : src_slice_info.slice_height; - UINT32 dst_slice_height = (slice_idx == (dst_slice_info.slice_num - 1)) ? dst_slice_info.last_slice_height : dst_slice_info.slice_height; + HD_RESULT ret; + UINT32 addr_src[HD_VIDEO_MAX_PLANE] = {0}; + UINT32 addr_dst[HD_VIDEO_MAX_PLANE] = {0}; + UINT32 loff_src[HD_VIDEO_MAX_PLANE] = {0}; + UINT32 loff_dst[HD_VIDEO_MAX_PLANE] = {0}; + UINT32 offset; + UINT32 scr_slice_height = (slice_idx == (src_slice_info.slice_num - 1)) ? src_slice_info.last_slice_height : src_slice_info.slice_height; + UINT32 dst_slice_height = (slice_idx == (dst_slice_info.slice_num - 1)) ? dst_slice_info.last_slice_height : dst_slice_info.slice_height; + UINT32 dst_scale_slice_height = (slice_idx == (dst_slice_info.slice_num - 1)) ? (src_slice_info.last_slice_height * dst_slice_info.slice_height / src_slice_info.slice_height) : dst_slice_info.slice_height; - /* dst img */ + /* dst img */ + addr_dst[0] = dst_buffer_info.pa; + loff_dst[0] = dst_slice_info.width; + addr_dst[1] = addr_dst[0] + loff_dst[0] * dst_slice_height; + loff_dst[1] = dst_slice_info.width; + ret = vf_init_ex(&vf_gfx_scale_param->dst_img, dst_slice_info.width, dst_slice_height, video_frame->pxlfmt, loff_dst, addr_dst); + if (ret != HD_OK) { + DBG_ERR("vf_init_ex dst failed(%d)\r\n", ret); + return E_SYS; + } - addr_dst[0] = dst_buffer_info.pa; - loff_dst[0] = dst_slice_info.width; - addr_dst[1] = addr_dst[0] + loff_dst[0] * dst_slice_height; - loff_dst[1] = dst_slice_info.width; - ret = vf_init_ex(&vf_gfx_scale_param->dst_img, dst_slice_info.width, dst_slice_height, video_frame->pxlfmt, loff_dst, addr_dst); - if (ret != HD_OK) { - DBG_ERR("vf_init_ex dst failed(%d)\r\n", ret); - return E_SYS; - } + vf_gfx_scale_param->engine = 0; + vf_gfx_scale_param->src_region.x = 0; + vf_gfx_scale_param->src_region.y = 0; + vf_gfx_scale_param->src_region.w = src_slice_info.width; + vf_gfx_scale_param->src_region.h = scr_slice_height; + vf_gfx_scale_param->dst_region.x = 0; + vf_gfx_scale_param->dst_region.y = 0; + vf_gfx_scale_param->dst_region.w = dst_slice_info.width; + vf_gfx_scale_param->dst_region.h = dst_scale_slice_height; + vf_gfx_scale_param->dst_img.blk = dst_buffer_info.blk; + vf_gfx_scale_param->quality = HD_GFX_SCALE_QUALITY_NULL; - vf_gfx_scale_param->engine = 0; - vf_gfx_scale_param->src_region.x = 0; - vf_gfx_scale_param->src_region.y = 0; - vf_gfx_scale_param->src_region.w = src_slice_info.width; - vf_gfx_scale_param->src_region.h = scr_slice_height; - vf_gfx_scale_param->dst_region.x = 0; - vf_gfx_scale_param->dst_region.y = 0; - vf_gfx_scale_param->dst_region.w = dst_slice_info.width; - vf_gfx_scale_param->dst_region.h = dst_slice_height; - vf_gfx_scale_param->dst_img.blk = dst_buffer_info.blk; - vf_gfx_scale_param->quality = HD_GFX_SCALE_QUALITY_NULL; + offset = video_frame->loff[HD_VIDEO_PINDEX_Y] * slice_idx * src_slice_info.slice_height; - offset = video_frame->loff[HD_VIDEO_PINDEX_Y] * slice_idx * src_slice_info.slice_height; - - addr_src[0] = video_frame->phy_addr[HD_VIDEO_PINDEX_Y] + offset; - addr_src[1] = video_frame->phy_addr[HD_VIDEO_PINDEX_UV] + offset/2; + addr_src[0] = video_frame->phy_addr[HD_VIDEO_PINDEX_Y] + offset; + addr_src[1] = video_frame->phy_addr[HD_VIDEO_PINDEX_UV] + offset/2; loff_src[0] = video_frame->loff[HD_VIDEO_PINDEX_Y]; loff_src[1] = video_frame->loff[HD_VIDEO_PINDEX_UV]; - if ((ret = vf_init_ex(&vf_gfx_scale_param->src_img, src_slice_info.width, scr_slice_height, video_frame->pxlfmt, loff_src, addr_src)) != HD_OK) { - DBG_ERR("vf_init_ex dst failed(%d)\r\n", ret); - return E_SYS; - } + if ((ret = vf_init_ex(&vf_gfx_scale_param->src_img, src_slice_info.width, scr_slice_height, video_frame->pxlfmt, loff_src, addr_src)) != HD_OK) { + DBG_ERR("vf_init_ex dst failed(%d)\r\n", ret); + return E_SYS; + } - PHOTOFAST_SLICE_ENC_DUMP("[Slice %lu] src dim{%lu, %lu} src region{%lu, %lu, %lu, %lu} addr{y:%lx uv:%lx}\r\n", - slice_idx, - vf_gfx_scale_param->src_img.dim.w, - vf_gfx_scale_param->src_img.dim.h, - vf_gfx_scale_param->src_region.x, - vf_gfx_scale_param->src_region.y, - vf_gfx_scale_param->src_region.w, - vf_gfx_scale_param->src_region.h, - addr_src[0], addr_src[1] - ); + PHOTOFAST_SLICE_ENC_DUMP("[Slice %lu] src dim{%lu, %lu} src region{%lu, %lu, %lu, %lu} addr{y:%lx uv:%lx}\r\n", + slice_idx, + vf_gfx_scale_param->src_img.dim.w, + vf_gfx_scale_param->src_img.dim.h, + vf_gfx_scale_param->src_region.x, + vf_gfx_scale_param->src_region.y, + vf_gfx_scale_param->src_region.w, + vf_gfx_scale_param->src_region.h, + addr_src[0], addr_src[1] + ); - PHOTOFAST_SLICE_ENC_DUMP("[Slice %lu] dst dim{%lu, %lu} dst region{%lu, %lu, %lu, %lu} addr{y:%lx uv:%lx}\r\n", - slice_idx, - vf_gfx_scale_param->dst_img.dim.w, - vf_gfx_scale_param->dst_img.dim.h, - vf_gfx_scale_param->dst_region.x, - vf_gfx_scale_param->dst_region.y, - vf_gfx_scale_param->dst_region.w, - vf_gfx_scale_param->dst_region.h, - addr_dst[0], addr_dst[1] - ); + PHOTOFAST_SLICE_ENC_DUMP("[Slice %lu] dst dim{%lu, %lu} dst region{%lu, %lu, %lu, %lu} addr{y:%lx uv:%lx}\r\n", + slice_idx, + vf_gfx_scale_param->dst_img.dim.w, + vf_gfx_scale_param->dst_img.dim.h, + vf_gfx_scale_param->dst_region.x, + vf_gfx_scale_param->dst_region.y, + vf_gfx_scale_param->dst_region.w, + vf_gfx_scale_param->dst_region.h, + addr_dst[0], addr_dst[1] + ); + + if(slice_idx == (dst_slice_info.slice_num - 1)){ + + HD_GFX_DRAW_RECT draw_rect = {0}; + + draw_rect.dst_img.dim = vf_gfx_scale_param->dst_img.dim; + draw_rect.dst_img.ddr_id = vf_gfx_scale_param->dst_img.ddr_id; + draw_rect.dst_img.format = vf_gfx_scale_param->dst_img.pxlfmt; + draw_rect.dst_img.p_phy_addr[0] = vf_gfx_scale_param->dst_img.phy_addr[0]; + draw_rect.dst_img.p_phy_addr[1] = vf_gfx_scale_param->dst_img.phy_addr[1]; + draw_rect.dst_img.lineoffset[0] = vf_gfx_scale_param->dst_img.loff[0]; + draw_rect.dst_img.lineoffset[1] = vf_gfx_scale_param->dst_img.loff[1]; + draw_rect.color = LV_USER_CFG_STAMP_COLOR_BACKGROUND; + draw_rect.thickness = 1; + draw_rect.type = HD_GFX_RECT_SOLID; + draw_rect.rect = (HD_IRECT){0, 0, vf_gfx_scale_param->dst_img.dim.w, vf_gfx_scale_param->dst_img.dim.h}; + hd_gfx_draw_rect(&draw_rect); + } - return E_OK; + return E_OK; } #if 1//PHOTOFAST_SLICE_ENC_DBG_PRIMARY_YUV diff --git a/rtos/code/application/source/cardv/SrcCode/UIApp/lv_user_font_conv/lv_user_font_conv.c b/rtos/code/application/source/cardv/SrcCode/UIApp/lv_user_font_conv/lv_user_font_conv.c index bac0ba26f..1aa473f83 100755 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/lv_user_font_conv/lv_user_font_conv.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/lv_user_font_conv/lv_user_font_conv.c @@ -656,6 +656,7 @@ ER lv_user_font_conv( lv_obj_t* canvas = lv_canvas_create(NULL, NULL); /* if img_dsc.header.cf = LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED , canvas will output alpha channel = 0 for pixel which color is LV_COLOR_TRANSP */ + lv_img_cache_invalidate_src(NULL); lv_canvas_set_buffer(canvas, working_buffer, result.width, result.height, LV_IMG_CF_TRUE_COLOR_ALPHA); draw_img_dsc = _lv_user_font_conv_get_draw_img_dsc(draw_cfg); diff --git a/rtos/code/application/source/cardv/SrcCode/UIApp/lv_user_font_conv/lv_user_font_conv_cmd.c b/rtos/code/application/source/cardv/SrcCode/UIApp/lv_user_font_conv/lv_user_font_conv_cmd.c index d78372f31..63589c511 100755 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/lv_user_font_conv/lv_user_font_conv_cmd.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/lv_user_font_conv/lv_user_font_conv_cmd.c @@ -1,9 +1,3 @@ -/* - * lv_user_font_conv_cmd.c - * - * Created on: 2021¦~11¤ë17¤é - * Author: NVT02970 - */ #include #include @@ -35,7 +29,7 @@ #define MAX_WORKER_NUM 10 -#define LV_USER_FONT_CONV_TEST_FONT_RES_ID LV_PLUGIN_FONT_ID_NOTOSANS_BLACK_32_1BPP +#define LV_USER_FONT_CONV_TEST_FONT_RES_ID LV_PLUGIN_FONT_ID_ARIALUNI_32_1BPP #define LV_USER_FONT_CONV_TEST_STRING_ID LV_PLUGIN_STRING_ID_STRID_IMGSIZE static HD_RESULT lv_user_font_conv_get_hd_common_buf(UINT32 size, lv_user_font_conv_mem_cfg* mem, INT32* blk) diff --git a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c old mode 100644 new mode 100755 index 80f3d03d8..347b75159 --- a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c +++ b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c @@ -1213,6 +1213,14 @@ void SysResetFlag(void) puiPara->TimeSend3Switch = DEFAULT_TIMESEND3_SWITCH; puiPara->TimeSend4Switch = DEFAULT_TIMESEND4_SWITCH; #endif + + puiPara->x1 = 0; + puiPara->x2 = 0; + puiPara->x3 = 0; + puiPara->x4 = 0; + puiPara->x5 = 0; + puiPara->x6 = 0; + #else SysSetFlag(FL_ETHCAM_TX_IP_ADDR, DEFAULT_ETHCAM_TX_IP_ADDR); diff --git a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h old mode 100644 new mode 100755 index bbdff3615..196cdd620 --- a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h +++ b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h @@ -532,6 +532,14 @@ typedef struct _UIMenuUIMenuStoreInfo { UINT8 WifiApPWD[16]; UINT8 Zoom; UINT32 FileKey; + + UINT32 x1; + UINT32 x2; + UINT32 x3; + UINT32 x4; + UINT32 x5; + UINT32 x6; + //============Sifar==============///Payton } UIMenuStoreInfo; diff --git a/rtos/code/application/source/cardv/rtos-main-hunting_lvgl.lds b/rtos/code/application/source/cardv/rtos-main-hunting_lvgl.lds old mode 100644 new mode 100755 index 209b905b3..1a8cdf3e0 --- a/rtos/code/application/source/cardv/rtos-main-hunting_lvgl.lds +++ b/rtos/code/application/source/cardv/rtos-main-hunting_lvgl.lds @@ -312,10 +312,9 @@ SECTIONS ./SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowLVGL.o (.text* .data* .data1* .rodata* .rodata1* .reginfo* .init* .exit*) ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Plugin/lv_plugin_common.o (.text* .data* .data1* .rodata* .rodata1* .reginfo* .init* .exit*) ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Images/images.o (.text* .data* .data1* .rodata* .rodata1* .reginfo* .init* .exit*) - ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Fonts/notosans_black_32_1bpp.o (.text* .data* .data1* .rodata* .rodata1* .reginfo* .init* .exit*) - ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Fonts/notosans_black_48_1bpp.o (.text* .data* .data1* .rodata* .rodata1* .reginfo* .init* .exit*) - ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Fonts/notosans_black_16_1bpp.o (.text* .data* .data1* .rodata* .rodata1* .reginfo* .init* .exit*) - ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Fonts/notosans_black_8_1bpp.o (.text* .data* .data1* .rodata* .rodata1* .reginfo* .init* .exit*) + ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Fonts/arialuni_16_1bpp.o (.text* .data* .data1* .rodata* .rodata1* .reginfo* .init* .exit*) + ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Fonts/arialuni_32_1bpp.o (.text* .data* .data1* .rodata* .rodata1* .reginfo* .init* .exit*) + ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Fonts/arialuni_48_1bpp.o (.text* .data* .data1* .rodata* .rodata1* .reginfo* .init* .exit*) ./SrcCode/UIWnd/LVGL_SPORTCAM/Resource/Palette/palette.o (.text* .data* .data1* .rodata* .rodata1* .reginfo* .init* .exit*) ./SrcCode/System/SysMain.o (.text* .data* .data1* .rodata* .rodata1* .reginfo* .init* .exit*) } diff --git a/rtos/code/driver/na51089/include/sf_battery.h b/rtos/code/driver/na51089/include/sf_battery.h index 41b87a990..0987f04a1 100644 --- a/rtos/code/driver/na51089/include/sf_battery.h +++ b/rtos/code/driver/na51089/include/sf_battery.h @@ -40,4 +40,5 @@ void sf_temper_update(void); INT16 sf_celsius_change_to_fahrenheit(INT16 cTemper); void sf_BatteryInfoSave(char *name); UINT32 sf_get_temper_adc(void); +UINT8 sf_solar_to_Lunar(UINT16 Year,UINT8 Month, UINT8 Day); #endif diff --git a/rtos/code/driver/na51089/source/mcu/sf_battery.c b/rtos/code/driver/na51089/source/mcu/sf_battery.c index ce1cd20fa..21bb2412c 100644 --- a/rtos/code/driver/na51089/source/mcu/sf_battery.c +++ b/rtos/code/driver/na51089/source/mcu/sf_battery.c @@ -1427,6 +1427,135 @@ void sf_temper_update(void) cTemper = sf_adc2Temperature((UINT16)TemperAdc, 1); fTemper = sf_celsius_change_to_fahrenheit(cTemper); } + +unsigned long DayCode[12]= {0,31,59,90,120,151,181,212,243,273,304,334}; +unsigned long DayCode_Leap[12]= {0,31,60,91,121,152,182,213,244,274,305,335}; + +UINT8 sf_solar_to_Lunar(UINT16 Year,UINT8 Month, UINT8 Day) +{ + float temp = 0,Tempnum = 0; + UINT8 tempn = 0,tempQ = 0,tempR = 0,LunarDay = 0; + UINT8 LunarDaytemp = 0; + + if(Year>=2000) + Year=Year-2000; + + if (Year<21) + { + UINT16 wMonthAdd[12] = {0,31,59,90,120,151,181,212,243,273,304,334}; + + UINT32 wNongliData[100] = + { + 2635,333387,1701,1748,267701,694,2391,133423,1175,396438 + ,3402,3749,331177,1453,694,201326,2350,465197,3221,3402 + ,400202,2901,1386,267611,605,2349,137515,2709,464533,1738 + ,2901,330421,1242,2651,199255,1323,529706,3733,1706,398762 + ,2741,1206,267438,2647,1318,204070,3477,461653,1386,2413 + ,330077,1197,2637,268877,3365,531109,2900,2922,398042,2395 + ,1179,267415,2635,661067,1701,1748,398772,2742,2391,330031 + ,1175,1611,200010,3749,527717,1452,2742,332397,2350,3222 + ,268949,3402,3493,133973,1386,464219,605,2349,334123,2709 + ,2890,267946,2773,592565,1210,2651,395863,1323,2707,265877 + }; + + UINT16 wCurYear; + UINT8 wCurMonth,wCurDay; + int nIsEnd,m,k,n,i; + UINT16 nTheDate,nBit; + //static int wCurYear,wCurMonth,wCurDay; + //static int nTheDate,nIsEnd,m,k,n,i,nBit; + + wCurYear = Year+2000; + wCurMonth = Month; + wCurDay = Day; + + nTheDate = (wCurYear - 1921) * 365 + (wCurYear - 1921) / 4 + wCurDay + + wMonthAdd[wCurMonth - 1] - 38; + + if((!(wCurYear % 4)) && (wCurMonth > 2)) + nTheDate = nTheDate + 1; + + nIsEnd = 0; + m = 0; + while(nIsEnd != 1) + { + if(wNongliData[m] < 4095) + k = 11; + else + k = 12; + n = k; + while(n>=0) + { + nBit = wNongliData[m]; + + for(i=1; i=5) + LunarDay=(Tempnum-tempn*29.5)+1; + else if (LunarDaytemp%1000<10) + LunarDay=30; + else if (LunarDaytemp%1000>300) + LunarDay=1; + else + LunarDay=Tempnum-tempn*29.5; + // UI_PrintOSDNumber(LunarDay, 2, 6, 4); + } + + return LunarDay; +} + #if SF_BATTERY_TEST == ENABLE