Merge branch 'Branch_S550_Fast_Emmc' of 192.168.6.216:linux-em-group/s530-ntk into Branch_S550_Emmc

This commit is contained in:
xiehongyan 2023-12-20 10:10:43 +08:00
commit d1686a0290
10 changed files with 35 additions and 11 deletions

View File

@ -158,7 +158,7 @@ INT32 System_GetBootFirstMode(void)
{
return PRIMARY_MODE_USBMSDC;
}
else if((PWR_ON_SETUP != PowerOnMode) /*|| (sf_get_fw_update())*/)
else if((PWR_ON_SETUP != PowerOnMode) && (PWR_ON_MCU_UPDATA != PowerOnMode)/*|| (sf_get_fw_update())*/)
{
return PRIMARY_MODE_TRANSCODE;
}

View File

@ -424,6 +424,7 @@ void System_OnStrgInit_FS(void)
cfg.LogBuffSize2 = gLogFile_Buff2_Size;
#endif
LogFile_Config(&cfg);
DBG_DUMP("LogFile_Config ...\n");
}
#endif
@ -1064,7 +1065,7 @@ INT32 System_OnStrgAttach(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
logOpenParm.maxFileNum = maxFileNum;
logOpenParm.maxFileSize = maxFileSize;
logOpenParm.isPreAllocAllFiles = TRUE;
logOpenParm.isPreAllocAllFiles = FALSE;
#if defined(__FREERTOS)
logOpenParm.isSaveLastTimeSysErrLog = wdt_getResetNum()>0 ? TRUE : FALSE;
#else //defined(__LINUX_USER__)

View File

@ -321,7 +321,8 @@ typedef enum sf_STARTUP_TYPE_E
SF_MCU_STARTUP_RESET = 0x0A,/*power on to reset(reserve)*/
SF_MCU_STARTUP_SYN_PARAM = 0x0B,/*power on to syn param(reserve)*/
SF_MCU_STARTUP_BATCH_SEND= 0x0C,/*power on to send batch*/
SF_MCU_STARTUP_BUTT = 0X0D,
SF_MCU_STARTUP_MCU_UPDATA= 0x0F,/*power on to send batch*/
SF_MCU_STARTUP_BUTT = 0X10,
} SF_STARTUP_TYPE_E;
typedef enum sfPOWEROFF_TYPE_E

View File

@ -1829,7 +1829,8 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
s32ret = sf_get_utc();
if ((SF_ON == pCustomerParam->GpsSwitch)) {
if ((SF_ON == pCustomerParam->GpsSwitch) || (pCustomerParam->FristSendDailyAndGps))
{
s32ret = open_gps(s32ret);
}
if (0 != sf_get_cq_signal()) {
@ -1867,7 +1868,8 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
set_at_parament();
sf_USB_net_init();
if ((SF_ON == pCustomerParam->GpsSwitch)) {
if ((SF_ON == pCustomerParam->GpsSwitch) || (pCustomerParam->FristSendDailyAndGps))
{
const int KEEP_SERACHING_TIMEOUT_MS = 2000;
const int KEEP_SERACHING_PERIOD_MS = 200;
// keep_seraching_gps_location(KEEP_SERACHING_TIMEOUT_S);

View File

@ -995,6 +995,8 @@ const SF_CHAR* sf_poweron_type_string(SF_STARTUP_TYPE_E enType)
return "SF_MCU_STARTUP_SYN_PARAM";
case SF_MCU_STARTUP_BATCH_SEND:
return "SF_MCU_STARTUP_BATCH_SEND";
case SF_MCU_STARTUP_MCU_UPDATA:
return "SF_MCU_STARTUP_MCU_UPDATA";
default:
return "unknown poweron type!!!";
}

View File

@ -40,6 +40,7 @@
#include "kwrap/debug.h"
#include "kwrap/util.h"
#include <sys/select.h>
#include "sf_system.h"
#define SERIAL_DEVICE_PATH "/dev/ttyS2"
#ifdef __cplusplus
@ -707,7 +708,7 @@ unsigned int sf_get_mcu_reg_ack_depack_many(unsigned char reg[], unsigned char v
int sf_commu_wait(unsigned char cmd)
{
if(sf_mcu_flag_wait_done_timeout(cmd, 60))
if(sf_mcu_flag_wait_done_timeout(cmd, 100))
{
sf_commu_reset();
return - 1;
@ -963,8 +964,18 @@ unsigned char sf_commu_parse_mcu_data(unsigned char * src, unsigned int len)
{
sf_set_pir_statu_flag(0);
sf_set_module_sleep_flag(0);
if((PWR_ON_SETUP != sf_convert_power_on_mode()) && (PWR_ON_USB!= sf_convert_power_on_mode()))
{
printf("[power off] %s(%d)\n", __FUNCTION__, __LINE__);
sf_set_power_off_flag(1);
sf_app_battery_stop();
system("reboot");
}
else
{
sf_com_message_send_to_cardv(&stMessageBuf);
}
}
else if(0 == stMessageBuf.arg3) //ON->OFF
{
UIMenuStoreInfo *pCustomerParam = sf_app_ui_para_get();

View File

@ -51,6 +51,7 @@
#define PWR_ON_GPRS_INIT 0x0A
#define PWR_ON_TIME_SYNC 0x0B
#define PWR_ON_TIME_SEND 0x0C
#define PWR_ON_MCU_UPDATA 0x0F
/*REG FUNCTION_SWTICH*/
#define PIR_OFF 0x00

View File

@ -46,6 +46,7 @@
#include <io/gpio.h>
#include "UIInfo/UIInfo.h"
#include "sf_param_enum.h"
#include "GxUSB.h"
//#include "../../../application/source/cardv/SrcCode/PrjInc.h"
@ -1910,7 +1911,11 @@ BOOL sf_get_mode_flag(void)
BOOL sf_is_usb_flag(void)
{
return GxUSB_GetIsUSBPlug();
if(GxUSB_GetConnectType() == 1)
{
return 1;
}
return 0;//GxUSB_GetIsUSBPlug();
}
void sf_calculate_daily_report(UINT8*dailyHour, UINT8*dailyMin)
@ -2144,7 +2149,7 @@ void sf_set_power_on_mode(UINT8 data)
ModeFlag = 0;
PowerOnMode = data;
PowerOnMode &= 0x0f;
if(1 == PowerOnMode)
if((1 == PowerOnMode) || 15 == PowerOnMode)
{
ConfigureModeFlag = 1;
}

View File

@ -486,7 +486,7 @@ unsigned int sf_get_mcu_reg_ack_depack_many(unsigned char reg[], unsigned char v
int sf_commu_wait(unsigned char cmd)
{
//sf_mcu_flag_set_done(cmd);
if(sf_mcu_flag_wait_done_timeout(cmd, 30))
if(sf_mcu_flag_wait_done_timeout(cmd, 100))
{
sf_commu_reset();
return - 1;

View File

@ -691,13 +691,14 @@ UINT8 sf_get_power_on_mode(void)
if(gpio_getIntStatus(GPIO_INT_USBPLUGIN))
{
PowerOnMode = PWR_ON_USB;
ConfigureModeFlag = 1;
}
else{
//PowerOnMode = sf_mcu_power_on_para_get(SF_MCU_POWERON);
PowerOnMode = sf_mcu_power_on_para_get(SF_MCU_STARTMODE);
//PowerOnMode &= 0x0f;
//sf_is_night_mode(1);
if(1 == PowerOnMode)
if((PWR_ON_SETUP == PowerOnMode) || (PWR_ON_MCU_UPDATA == PowerOnMode))
{
ConfigureModeFlag = 1;
}