1.修改mcu升级问题
This commit is contained in:
parent
9f64fc75d1
commit
b1a479f8e1
|
@ -1640,9 +1640,21 @@ void* sf_app_mcu_updata_thread(void *arg)
|
||||||
MLOGI("MCU_UPGRADE\n");
|
MLOGI("MCU_UPGRADE\n");
|
||||||
UINT32 McuFsize = 0;
|
UINT32 McuFsize = 0;
|
||||||
SINT8 ret = 0;
|
SINT8 ret = 0;
|
||||||
|
int sdflag = 0;
|
||||||
|
int emmcflag = 0;
|
||||||
|
char file_path[64] = {0};
|
||||||
|
if((access("/mnt/sd/Mupgrade.bin", F_OK) == 0))
|
||||||
|
{
|
||||||
|
sdflag = 1;
|
||||||
|
snprintf(file_path, sizeof(file_path), "/mnt/sd/Mupgrade.bin");
|
||||||
|
|
||||||
char *file_path = sf_root_path_strcat(UPGRADE_FIRMWARE_NANE);
|
}
|
||||||
if(file_path == NULL)
|
if((access("/mnt/sd2/Mupgrade.bin", F_OK) == 0))
|
||||||
|
{
|
||||||
|
emmcflag = 1;
|
||||||
|
snprintf(file_path, sizeof(file_path), "/mnt/sd2/Mupgrade.bin");
|
||||||
|
}
|
||||||
|
if(emmcflag == 0 && sdflag == 0)
|
||||||
{
|
{
|
||||||
MLOGI(" sf_power_off_msg_to_cardv\n");
|
MLOGI(" sf_power_off_msg_to_cardv\n");
|
||||||
MLOGE("MCU_UPGRADE no file\n");
|
MLOGE("MCU_UPGRADE no file\n");
|
||||||
|
@ -1651,8 +1663,7 @@ void* sf_app_mcu_updata_thread(void *arg)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
ret = Fw_GetFirmwareSize(file_path, &McuFsize);
|
ret = Fw_GetFirmwareSize(file_path, &McuFsize);
|
||||||
if((sf_in_card_exist() == SF_TRUE) && (access(file_path, F_OK) == 0)
|
if((ret == 0) && (McuFsize > 1024) && (sf_is_enough_power_to_update() == SF_TRUE))
|
||||||
&& (ret == 0) && (McuFsize > 1024) && (sf_is_enough_power_to_update() == SF_TRUE))
|
|
||||||
{
|
{
|
||||||
sf_set_mcu_update_flag(SF_TRUE);
|
sf_set_mcu_update_flag(SF_TRUE);
|
||||||
Fw_UpgradeThreadStart();
|
Fw_UpgradeThreadStart();
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include "sf_common.h"
|
#include "sf_common.h"
|
||||||
|
#include "sf_log.h"
|
||||||
#include "sf_mcu_upgrade.h"
|
#include "sf_mcu_upgrade.h"
|
||||||
#include "sf_param_common.h"
|
#include "sf_param_common.h"
|
||||||
#include "sf_ledmng.h"
|
#include "sf_ledmng.h"
|
||||||
|
@ -340,11 +341,21 @@ static void * FwUpgradeTask(void * argv)
|
||||||
SINT8 param[1] = {0};
|
SINT8 param[1] = {0};
|
||||||
param[0] = 0;
|
param[0] = 0;
|
||||||
|
|
||||||
char *file_path = sf_root_path_strcat(UPGRADE_FIRMWARE_NANE);
|
//char *file_path = sf_root_path_strcat(UPGRADE_FIRMWARE_NANE);
|
||||||
if(file_path == NULL)
|
char file_path[64] = {0};
|
||||||
|
memset(file_path, '\0', sizeof(file_path));
|
||||||
|
if((access("/mnt/sd/Mupgrade.bin", F_OK) == 0))
|
||||||
|
{
|
||||||
|
snprintf(file_path, sizeof(file_path), "/mnt/sd/Mupgrade.bin");
|
||||||
|
}
|
||||||
|
if((access("/mnt/sd2/Mupgrade.bin", F_OK) == 0))
|
||||||
|
{
|
||||||
|
snprintf(file_path, sizeof(file_path), "/mnt/sd2/Mupgrade.bin");
|
||||||
|
}
|
||||||
|
if(file_path[0] == '\0')
|
||||||
{
|
{
|
||||||
free(file_path);
|
MLOGE("no update file\n");
|
||||||
return;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(FwUpgradeExit == 0)
|
while(FwUpgradeExit == 0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user