1.mcu升级调整:升级开lcd;mcu读写超时时间调整;2.lib里的usb标识调整

This commit is contained in:
payton 2023-12-20 09:54:14 +08:00
parent 3ec82a2b9a
commit c1ef11a1cd
8 changed files with 29 additions and 8 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

@ -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

@ -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,7 +964,17 @@ 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);
sf_com_message_send_to_cardv(&stMessageBuf);
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
{

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;
}