Merge code

This commit is contained in:
xiehongyan 2024-01-03 10:48:34 +08:00
commit aa2370ca9c
16 changed files with 106 additions and 67 deletions

View File

@ -72,10 +72,16 @@ insmod /etc/lib/modules/$KERVER/extra/fs/exfat/exfat.ko
#mdev -s #mdev -s
# Scan for without insert card if [ -d "/sys/class/block/mmcblk0p1" ]; then
if [ ! -f /tmp/.nvt_mounts ]; then mknod /dev/mmcblk0p1 b `cat /sys/class/block/mmcblk0p1/dev | sed "s/:/\ /g"`
/etc/mdev-script/autosd.sh fi
rm -rf /tmp/.nvt_mounts;
if [ -d "/sys/class/block/mmcblk1p1" ]; then
mknod /dev/mmcblk1p1 b `cat /sys/class/block/mmcblk1p1/dev | sed "s/:/\ /g"`
fi fi
echo "fs" > /proc/nvt_info/bootts # Scan for without insert card
if [ ! -f /tmp/.nvt_mounts ]; then
/etc/mdev-script/autosd.sh
rm -rf /tmp/.nvt_mounts;
fi

View File

@ -201,8 +201,6 @@ ${PREFIX}/lib/modules/$KERVER/hdal/kdrv_videoout/fbdev/nvt_fb.ko
#insmod ${PREFIX}/lib/modules/$KERVER/hdal/comm/usb2dev/nvt_usb2dev.ko #insmod ${PREFIX}/lib/modules/$KERVER/hdal/comm/usb2dev/nvt_usb2dev.ko
#fi #fi
mount /dev/mmcblk1p1 /mnt/sd2
if [ -f /usr/bin/isp_demon ]; then if [ -f /usr/bin/isp_demon ]; then
/usr/bin/isp_demon /usr/bin/isp_demon
else else

View File

@ -81,6 +81,11 @@ void SF_StrgUnInit(void)
pMMCDev = NULL; pMMCDev = NULL;
} }
int SF_GetMMCDevHandle(MMC_DEV_TYPE dev_type)
{
return sf_mmc_dev[dev_type]->dcf_handle;
}
void SF_StrgSetDcfHandle(UINT32 strg_id, UINT32 handle) void SF_StrgSetDcfHandle(UINT32 strg_id, UINT32 handle)
{ {
sf_mmc_dev[strg_id]->dcf_handle = handle; sf_mmc_dev[strg_id]->dcf_handle = handle;

View File

@ -87,7 +87,7 @@ SF_ST_MMC_DEV *SF_StrgCheckWorkableDev(void);
void SF_SetMMCDev(SF_ST_MMC_DEV *pDev); void SF_SetMMCDev(SF_ST_MMC_DEV *pDev);
SF_ST_MMC_DEV *SF_GetMMCDev(void); SF_ST_MMC_DEV *SF_GetMMCDev(void);
int sf_mmc_dev_check_start(void); int sf_mmc_dev_check_start(void);
int SF_GetMMCDevHandle(MMC_DEV_TYPE dev_type);

View File

@ -54,7 +54,7 @@ void Strg_CB(UINT32 event, UINT32 param1, UINT32 param2)
SF_MESSAGE_BUF_S stMessageBuf = {0}; SF_MESSAGE_BUF_S stMessageBuf = {0};
#endif #endif
DBG_IND("Strg_CB: strg_id = %d, status = %d\n", param1, param2); printf("Strg_CB: strg_id = %d, status = %d\n", param1, param2);
switch (event) { switch (event) {
// part-1 // part-1
case SYSTEM_CB_CONFIG: case SYSTEM_CB_CONFIG:

View File

@ -1218,20 +1218,12 @@ INT32 System_OnStrgAttach(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
} }
#if HUNTING_CAMERA_MCU == ENABLE #if HUNTING_CAMERA_MCU == ENABLE
if((FS_DISK_ERROR == System_GetState(SYS_STATE_FS))){ if((FS_DISK_ERROR == System_GetState(SYS_STATE_FS))){
stMessageBuf.arg1 = CMD_SD_STRG_CB_UNMOUNT_FINISH; stMessageBuf.arg1 = CMD_SD_STRG_CB_UNMOUNT_FINISH;
stMessageBuf.arg2 = strg_id; stMessageBuf.arg2 = strg_id;
stMessageBuf.cmdId = CMD_SD; stMessageBuf.cmdId = CMD_SD;
sf_com_message_send_to_app(&stMessageBuf); sf_com_message_send_to_app(&stMessageBuf);
#if USE_MMC_DEV_CHECK #if USE_MMC_DEV_CHECK
if(strg_id == 1)
{
printf("emmc mounted failed, remount\n");
system("mount /dev/mmcblk1p1 /mnt/sd2");
stMessageBuf.arg1 = CMD_SD_STRG_CB_MOUNT_FINISH;
}
SF_StrgRegister(&stMessageBuf); SF_StrgRegister(&stMessageBuf);
#endif #endif
printf("System_OnStrgAttach send UNMOUNT! dev_id = %d\n", strg_id); printf("System_OnStrgAttach send UNMOUNT! dev_id = %d\n", strg_id);

View File

@ -766,12 +766,40 @@ UINT32 PhotoExe_GetFreePicNum(void)
UINT32 PhotoExe_GetTotalPicNum(void) UINT32 PhotoExe_GetTotalPicNum(void)
{ {
UINT64 uiSpace; UINT64 uiSpace = 0;
UINT32 totalImgNum; UINT32 totalImgNum;
UINT32 reserveSize = 0x80000; // 500KB UINT32 reserveSize = 0x80000; // 500KB
UINT32 CaptureSize; UINT32 CaptureSize;
UINT32 size; UINT32 size;
#if USE_MMC_DEV_CHECK
SF_ST_MMC_DEV *mmc_dev = SF_GetMMCDev();
if(mmc_dev == NULL)
{
DBG_ERR("No MMC_Dev Can use!\n");
return 0;
}
if(mmc_dev->dcf_handle < 0)
{
DBG_ERR("dcf_handle err!\n");
return 0;
}
#endif
#if USE_MMC_DEV_CHECK
if(mmc_dev->dev_type == MMC_DEV_SD)
{
uiSpace = FileSys_GetDiskInfoEx('A', FST_INFO_DISK_SIZE);
}
else if(mmc_dev->dev_type == MMC_DEV_EMMC)
{
uiSpace = FileSys_GetDiskInfoEx('B', FST_INFO_DISK_SIZE);
}
#else
uiSpace = FileSys_GetDiskInfo(FST_INFO_DISK_SIZE); uiSpace = FileSys_GetDiskInfo(FST_INFO_DISK_SIZE);
#endif
//DBG_IND("[cap]Free Space = %d KB\r\n", uiSpace / 1024); //DBG_IND("[cap]Free Space = %d KB\r\n", uiSpace / 1024);

View File

@ -905,10 +905,11 @@ static void UIFlowMovie_OnExeRecord(lv_obj_t* obj)
{ {
if (System_GetState(SYS_STATE_POWERON) == SYSTEM_POWERON_SAFE) { if (System_GetState(SYS_STATE_POWERON) == SYSTEM_POWERON_SAFE) {
if (System_GetState(SYS_STATE_CARD) == CARD_REMOVED) { // if (System_GetState(SYS_STATE_CARD) == CARD_REMOVED) {
//UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRID_PLEASE_INSERT_SD, warn_msgbox_auto_close_ms);
return; // UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRID_PLEASE_INSERT_SD, warn_msgbox_auto_close_ms);
} // return;
// }
} else if (System_GetState(SYS_STATE_POWERON) == SYSTEM_POWERON_NORMAL) { } else if (System_GetState(SYS_STATE_POWERON) == SYSTEM_POWERON_NORMAL) {
@ -919,10 +920,11 @@ static void UIFlowMovie_OnExeRecord(lv_obj_t* obj)
} }
if (System_GetState(SYS_STATE_CARD) == CARD_REMOVED) { // if (System_GetState(SYS_STATE_CARD) == CARD_REMOVED) {
UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRID_PLEASE_INSERT_SD, warn_msgbox_auto_close_ms);
return; // UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRID_PLEASE_INSERT_SD, warn_msgbox_auto_close_ms);
} // return;
// }
} }

View File

@ -672,7 +672,6 @@ static void update_gps_status(void)
} }
int get_storage_type(void) int get_storage_type(void)
{ {
return MMC_DEV_SD;
SF_ST_MMC_DEV *mmc_dev = SF_GetMMCDev(); SF_ST_MMC_DEV *mmc_dev = SF_GetMMCDev();
if (NULL == mmc_dev) if (NULL == mmc_dev)
{ {
@ -688,16 +687,16 @@ int get_storage_type(void)
} }
static void update_storage_sd_card(void) static void update_storage_sd_card(void)
{ {
if (System_GetState(SYS_STATE_FS) == FS_INIT_OK) // if (System_GetState(SYS_STATE_FS) == FS_INIT_OK)
{ {
UINT32 cardStatus = System_GetState(SYS_STATE_CARD); // UINT32 cardStatus = System_GetState(SYS_STATE_CARD);
if (cardStatus != CARD_REMOVED) // if (cardStatus != CARD_REMOVED)
{ {
if (g_SysStrg_Chg) if (g_SysStrg_Chg)
{ {
static int cnt = 0; static int cnt = 0;
if(cnt++<1){ if(cnt++<1){
lv_label_set_text(label_6_scr_uiflowphoto, ""); // lv_label_set_text(label_6_scr_uiflowphoto, "Loarding...");
}else{ }else{
g_SysStrg_Chg = false; g_SysStrg_Chg = false;
cnt = 0; cnt = 0;
@ -705,7 +704,7 @@ static void update_storage_sd_card(void)
} else if (UIStorageCheck(STORAGE_CHECK_ERROR, NULL) == TRUE) } else if (UIStorageCheck(STORAGE_CHECK_ERROR, NULL) == TRUE)
{ {
if(UIStorageCheck_DCIMWritable() == FALSE){ if(UIStorageCheck_DCIMWritable() == FALSE){
lv_label_set_text(label_6_scr_uiflowphoto, "SD CARD ERROR"); lv_label_set_text(label_6_scr_uiflowphoto, "No SD Card");
} }
} else if (UIStorageCheck(STORAGE_CHECK_FULL, NULL) == TRUE) } else if (UIStorageCheck(STORAGE_CHECK_FULL, NULL) == TRUE)
{ {
@ -719,17 +718,17 @@ static void update_storage_sd_card(void)
lv_label_set_text(label_6_scr_uiflowphoto, Get_FreePicNumString(g_uiFreePicNum)); lv_label_set_text(label_6_scr_uiflowphoto, Get_FreePicNumString(g_uiFreePicNum));
} }
} }
else // else
{ // {
set_warning_label_text(label_6_scr_uiflowphoto); // set_warning_label_text(label_6_scr_uiflowphoto);
lv_label_set_text(label_6_scr_uiflowphoto, "No SD Card"); // lv_label_set_text(label_6_scr_uiflowphoto, "No SD Card");
} // }
}
else
{
set_warning_label_text(label_6_scr_uiflowphoto);
lv_label_set_text(label_6_scr_uiflowphoto, "No SD Card");
} }
// else
// {
// set_warning_label_text(label_6_scr_uiflowphoto);
// lv_label_set_text(label_6_scr_uiflowphoto, "No SD Card");
// }
} }
unsigned int check_sd_size(UINT64 diskSize) unsigned int check_sd_size(UINT64 diskSize)
{ {

View File

@ -14,6 +14,8 @@
#define __DBGFLT__ "*" //*=All, [mark]=CustomClass #define __DBGFLT__ "*" //*=All, [mark]=CustomClass
#include <kwrap/debug.h> #include <kwrap/debug.h>
#include "SF_SysStrgMng.h"
PHOTO_TASK_DATA gPhotoData = { 0 }; PHOTO_TASK_DATA gPhotoData = { 0 };
static UINT32 g_uiFreePicNum = 0; static UINT32 g_uiFreePicNum = 0;
@ -28,7 +30,29 @@ CHAR *Get_FreePicNumString(UINT32 uiValue)
return 0; return 0;
} }
unsigned long fileCount = 0; unsigned long fileCount = 0;
#if USE_MMC_DEV_CHECK
SF_ST_MMC_DEV *mmc_dev = SF_GetMMCDev();
if(mmc_dev == NULL)
{
DBG_ERR("No MMC_Dev Can use!\n");
return NULL;
}
if(mmc_dev->dcf_handle < 0)
{
DBG_ERR("dcf_handle err!\n");
return NULL;
}
#endif
#if USE_MMC_DEV_CHECK
if(mmc_dev->dev_type != MMC_DEV_NO)
{
fileCount = DCF_GetDBInfoEx(mmc_dev->dcf_handle, DCF_INFO_TOL_FILE_COUNT);
}
#else
fileCount = DCF_GetDBInfo(DCF_INFO_TOL_FILE_COUNT); fileCount = DCF_GetDBInfo(DCF_INFO_TOL_FILE_COUNT);
#endif
snprintf(g_cFreePicNumStr, sizeof(g_cFreePicNumStr), "%05ld/%05ld", fileCount, uiValue); snprintf(g_cFreePicNumStr, sizeof(g_cFreePicNumStr), "%05ld/%05ld", fileCount, uiValue);
return g_cFreePicNumStr; return g_cFreePicNumStr;
} }

View File

@ -1368,6 +1368,7 @@ static void UIFlowPlay_ChildScrClose(lv_obj_t* obj, const void * data)
} }
break; break;
case NVTRET_ENTER_MENU: case NVTRET_ENTER_MENU:
break;
DBG_DUMP("NVTRET_ENTER_MENU"); DBG_DUMP("NVTRET_ENTER_MENU");
//#NT#2023/11/03#Eric - begin //#NT#2023/11/03#Eric - begin
//#NT#Support //#NT#Support IVOT_N12144_CO-148 -3 //#NT#Support //#NT#Support IVOT_N12144_CO-148 -3

View File

@ -206,9 +206,7 @@ void UIFlowWrnMsgAPI_Open_StringID(lv_plugin_res_id id, uint16_t auto_close_time
void UIFlowWrnMsgEventCallback_OnOpen(lv_obj_t* obj) void UIFlowWrnMsgEventCallback_OnOpen(lv_obj_t* obj)
{ {
evt = NVTEVT_NULL;
} }
static void UIFlowWrnMsg_OnNVTMSG(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* msg) static void UIFlowWrnMsg_OnNVTMSG(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* msg)
@ -223,7 +221,8 @@ static void UIFlowWrnMsg_OnNVTMSG(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA
{ {
printf("Complete format emmc.\n"); printf("Complete format emmc.\n");
lv_plugin_msgbox_set_text(msgbox, LV_PLUGIN_STRING_ID_STRING_COMPLETED); 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_plugin_label_set_text(label_msg_scr_uiflowwrnmsg, LV_PLUGIN_STRING_ID_STRING_COMPLETED);
lv_label_set_text_fmt(label_msg_scr_uiflowwrnmsg, "Completed!");
lv_msgbox_start_auto_close(msgbox, 3000); lv_msgbox_start_auto_close(msgbox, 3000);
break; break;
} }
@ -234,7 +233,8 @@ static void UIFlowWrnMsg_OnNVTMSG(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA
if(ret == CMD_FORMAT_SD_OK) if(ret == CMD_FORMAT_SD_OK)
{ {
lv_plugin_msgbox_set_text(msgbox, LV_PLUGIN_STRING_ID_STRING_COMPLETED); 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_plugin_label_set_text(label_msg_scr_uiflowwrnmsg, LV_PLUGIN_STRING_ID_STRING_COMPLETED);
lv_label_set_text_fmt(label_msg_scr_uiflowwrnmsg, "Completed!");
} }
else else
{ {

View File

@ -2354,6 +2354,7 @@ void sf_power_on_para_check_init(void)
puiPara->FristSendDailyAndGps = 1; puiPara->FristSendDailyAndGps = 1;
puiPara->GpsSendFlag = 0; puiPara->GpsSendFlag = 0;
memset(puiPara->SimIccid,'\0',sizeof(puiPara->SimIccid)); memset(puiPara->SimIccid,'\0',sizeof(puiPara->SimIccid));
memset(puiPara->ServiceProvider,'\0',sizeof(puiPara->ServiceProvider));
} }
else if(PowerOnMode == PWR_ON_TIME_SYNC) else if(PowerOnMode == PWR_ON_TIME_SYNC)
{ {

View File

@ -964,17 +964,7 @@ unsigned char sf_commu_parse_mcu_data(unsigned char * src, unsigned int len)
{ {
sf_set_pir_statu_flag(0); sf_set_pir_statu_flag(0);
sf_set_module_sleep_flag(0); sf_set_module_sleep_flag(0);
if((PWR_ON_SETUP != sf_poweron_type_get()) && (PWR_ON_USB!= sf_poweron_type_get())) sf_com_message_send_to_cardv(&stMessageBuf);
{
printf("[power off] %s(%d)\n", __FUNCTION__, __LINE__);
sf_set_power_off_flag(1);
//sf_app_battery_stop();
system("watchdog -T 1 -t 5 /dev/watchdog");
}
else
{
sf_com_message_send_to_cardv(&stMessageBuf);
}
} }
else if(0 == stMessageBuf.arg3) //ON->OFF else if(0 == stMessageBuf.arg3) //ON->OFF
{ {

View File

@ -449,7 +449,7 @@ SINT32 sf_hal_ttyusb2_read_buf(SF_TTY_DATA_TYPE_S *recv)
} }
else if (0 == s32ret) { else if (0 == s32ret) {
waitTime--; waitTime--;
MLOGW("FIFO select timeout [%d]\n",waitTime); //MLOGW("FIFO select timeout [%d]\n",waitTime);
continue; continue;
} }
} }

View File

@ -804,14 +804,7 @@ void sf_mcu_dataready_ck(UINT8 startMode)
gModuleSleep = 0; //power off 4G module gModuleSleep = 0; //power off 4G module
sf_set_power_off_flag(1); sf_set_power_off_flag(1);
printf("[power off] %s(%d)\n", __FUNCTION__, __LINE__); printf("[power off] %s(%d)\n", __FUNCTION__, __LINE__);
if((startMode == 1) && (PWR_ON_AUTO == sf_cardv_convert_power_on_mode())) Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, 0); //shutdown start
{
system("watchdog -T 1 -t 5 /dev/watchdog");
}
else
{
Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, 0); //shutdown start
}
} }
} }