1.將升級表示傳遞到Linux

This commit is contained in:
payton 2023-08-17 15:07:12 +08:00
parent 9f44f77a64
commit de142f968f
2 changed files with 9 additions and 3 deletions

View File

@ -841,7 +841,7 @@ static int make_bootargs(LINUXTMP_PARTITION *p_linuxtmp, unsigned int bootts_beg
//static char bootargs[] = "root=/dev/ram0 rootfstype=ramfs rdinit=/linuxrc bootts=568047,1720128 resume_addr=0x00007e88 user_debug=0xff"; //static char bootargs[] = "root=/dev/ram0 rootfstype=ramfs rdinit=/linuxrc bootts=568047,1720128 resume_addr=0x00007e88 user_debug=0xff";
#if HUNTING_CAMERA_MCU == ENABLE #if HUNTING_CAMERA_MCU == ENABLE
char PowerOnModeStr[32] = {'\0'}; char PowerOnModeStr[32] = {'\0'};
snprintf(PowerOnModeStr, sizeof(PowerOnModeStr), "Mode=%d",sf_get_power_on_mode()); snprintf(PowerOnModeStr, sizeof(PowerOnModeStr), "Mode=%d UpFw=%d",sf_get_power_on_mode(), sf_in_update());
linuxboot_set_extra_bootarg(PowerOnModeStr); linuxboot_set_extra_bootarg(PowerOnModeStr);
#endif #endif
p_linuxtmp->bootargs_addr = p_linuxtmp->tmp_curr; p_linuxtmp->bootargs_addr = p_linuxtmp->tmp_curr;

10
rtos/code/driver/na51089/source/mcu/sf_mcu.c Normal file → Executable file
View File

@ -37,7 +37,7 @@
#include <sf_i2c_driver.h> #include <sf_i2c_driver.h>
#include "PrjCfg.h" #include "PrjCfg.h"
#include "sf_battery.h" #include "sf_battery.h"
#include <IOCfg.h>
static UINT8 McuSubVersion = 0; static UINT8 McuSubVersion = 0;
static UINT16 McuVersion = 0; static UINT16 McuVersion = 0;
static UINT8 DailyReportStartMode = 0; static UINT8 DailyReportStartMode = 0;
@ -763,7 +763,13 @@ UINT32 sf_gpio_get_status(UINT32 ipin)
gpio_direction_input(ipin); gpio_direction_input(ipin);
return (UINT32) ((gpio_get_value(ipin) == 1) ? 1 : 0 ); return (UINT32) ((gpio_get_value(ipin) == 1) ? 1 : 0 );
} }
UINT32 sf_in_update(void)
{
if(!sf_gpio_get_status(GPIO_KEY_TEST)){
return 1;
}
return 0;
}
/************************************************* /*************************************************
Function: sf_mcu_dataready_get Function: sf_mcu_dataready_get
Description: Description: