1.Linux下只有emmc错误才进行内存发送

This commit is contained in:
payton 2024-01-26 20:28:17 +08:00
parent 60c021b5d9
commit abb23e9db5
7 changed files with 36 additions and 4 deletions

View File

@ -271,15 +271,18 @@ void SF_StrgRegister(SF_MESSAGE_BUF_S *pMessageBuf)
else
{
sf_mmc_dev[MMC_DEV_EMMC]->node = MMC_DEV_NODE_STATE_NO_EXIST;
sf_set_emmc_err(1);
}
if(pMessageBuf->arg1 == CMD_SD_STRG_CB_MOUNT_FINISH)
{
sf_mmc_dev[MMC_DEV_EMMC]->moumted_state = MMC_DEV_MOUNT_STATE_MOUNTED;
sf_set_emmc_err(0);
}
else if(pMessageBuf->arg1 == CMD_SD_STRG_CB_UNMOUNT_FINISH)
{
sf_mmc_dev[MMC_DEV_EMMC]->moumted_state = MMC_DEV_MOUNT_STATE_UNMOUNTED;
sf_set_emmc_err(1);
}
}

View File

@ -70,6 +70,8 @@ SINT32 sf_in_update(void);
void sf_set_card_statu(UINT32 val);
UINT32 sf_get_card_statu(void);
BOOL sf_system_check_bt_ko(void);
void sf_set_emmc_err(BOOL val);
BOOL sf_is_emmc_err(void);
#ifdef __cplusplus
#if __cplusplus
}

View File

@ -616,6 +616,7 @@ static SINT32 sfStrgDevOnActionMount(int dev_id, int result)
{
printf("EMMC has Mounted!\r\n");
sf_strg_dev_register(MMC_DEV_EMMC, MMC_DEV_MOUNT_STATE_MOUNTED);
sf_set_emmc_err(0);
}
// if(SF_MCU_STARTUP_ONKEY == startup)
// {
@ -693,6 +694,7 @@ static SINT32 sfStrgDevSdHandler(int cb_evt, int dev_id, int result)
static SINT32 sfStrgDevEmmcHandler(int cb_evt, int dev_id, int result)
{
sf_set_emmc_err(1);
switch(cb_evt)
{
case CMD_SD_STRG_CB_UNKNOWN:

View File

@ -45,6 +45,7 @@ static SINT32 IsCardFull = 0;
static SINT32 isGoing2Pir = 0;
static SINT32 IsCard = 0;
static int formatSD = CMD_FORMAT_SD_ERR;
static BOOL IsEmmcErr = TRUE;
SF_THREAD_S PirMonitorTskCfg =
{
@ -547,7 +548,7 @@ SINT32 sf_is_card_full(void)
void sf_set_card_full(SINT32 vol)
{
UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
if((0 == puiPara->SendType) && (!sf_get_mode_flag()))
if((0 == puiPara->SendType) && (!sf_get_mode_flag()) &&(sf_is_emmc_err()))
{
MLOGW("The memory sending function has been enabled, but the identification is not effective. IsCardFull:%d\n",vol);
IsCardFull = 0;
@ -726,6 +727,17 @@ SINT32 sf_in_update(void)
return (regValue & 0xFF) ? 0:1;
}
BOOL sf_is_emmc_err(void)
{
//printf("[%s]:%d IsEmmcFull:%d\n", __FUNCTION__, __LINE__, IsEmmcFull);
return IsEmmcErr;
}
void sf_set_emmc_err(BOOL vol)
{
//printf("[%s]:%d IsEmmcFull:%d\n", __FUNCTION__, __LINE__, IsEmmcFull);
IsEmmcErr = vol;
}
#ifdef __cplusplus
#if __cplusplus
}

View File

@ -21,5 +21,7 @@ BOOL sf_in_card_exist(void);
BOOL sf_in_emmc_exist(void);
void sf_set_card_statu(UINT32 val);
UINT32 sf_get_card_statu(void);
void sf_set_emmc_err(BOOL val);
BOOL sf_is_emmc_err(void);
#endif

View File

@ -3591,7 +3591,7 @@ INT32 sf_mem_write_photo(UINT32 buf, UINT32 size)
{
UINT32 fd = 0;
UIMenuStoreInfo *puiPara = sf_ui_para_get();
if(0 == puiPara->SendType)
if((0 == puiPara->SendType) && sf_is_emmc_err())
{
MLOGD("filesys not ready, store data into mem\n");
system("rm -rf /tmp/MEMPHOTO.JPG");

View File

@ -49,7 +49,7 @@ SF_CALLBACK_SD_CMD g_fpSd_Exist_CB = NULL;
static int formatSD = CMD_FORMAT_SD_ERR;
static BOOL IsCardFull = TRUE;
static BOOL IsEmmcFull = TRUE;
static BOOL IsEmmcErr = TRUE;
void sf_sd_exist_reg_cb(SF_CALLBACK_SD_CMD fpCB)
{
g_fpSd_Exist_CB = fpCB;
@ -104,4 +104,15 @@ BOOL sf_is_emmc_full(void)
void sf_set_emmc_card_full(BOOL val)
{
IsEmmcFull = val;
}
}
BOOL sf_is_emmc_err(void)
{
//printf("[%s]:%d IsEmmcFull:%d\n", __FUNCTION__, __LINE__, IsEmmcFull);
return IsEmmcErr;
}
void sf_set_emmc_err(BOOL val)
{
//printf("[%s]:%d IsEmmcFull:%d\n", __FUNCTION__, __LINE__, IsEmmcFull);
IsEmmcErr = val;
}