diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100755 index 000000000..c4027c274 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,29 @@ +# +# 2023.07.23 Oliver: +# This file does not need to be modified. +# To increase the platform, please ask the administrator to increase the server script. +# + +stages: + - auto + +build-job: + stage: auto + tags: + - ${CI_PROJECT_NAME} + script: + - ~/${CI_PROJECT_NAME}/build.sh + - sleep 10 + + +analyze-job: + stage: auto + tags: + - ${CI_PROJECT_NAME} + variables: + GIT_STRATEGY: none + GIT_CHECKOUT: "false" + script: + - ~/${CI_PROJECT_NAME}/analyze.sh $CI_PROJECT_NAME $CI_COMMIT_BRANCH + needs: ["build-job"] + when: on_success diff --git a/BSP/linux-kernel/.gitignore b/BSP/linux-kernel/.gitignore index 980e5ca37..beb34b5de 100644 --- a/BSP/linux-kernel/.gitignore +++ b/BSP/linux-kernel/.gitignore @@ -72,4 +72,8 @@ scripts/sortextable usr/.initramfs_data.cpio.d usr/gen_init_cpio usr/initramfs_data.cpio -vmlinux \ No newline at end of file +vmlinux +arch/arm/plat-novatek/include/plat +arch/arm/plat-novatek/plat +drivers/soc/nvt/nvt_hdal/hdal +drivers/soc/nvt/nvt_hdal/vos \ No newline at end of file diff --git a/BSP/linux-kernel/arch/arm/plat-novatek/include/plat b/BSP/linux-kernel/arch/arm/plat-novatek/include/plat deleted file mode 120000 index d29f8ad06..000000000 --- a/BSP/linux-kernel/arch/arm/plat-novatek/include/plat +++ /dev/null @@ -1 +0,0 @@ -/home/payton/S530/BSP/linux-kernel/arch/arm/plat-novatek/include/plat-na51089 \ No newline at end of file diff --git a/BSP/linux-kernel/arch/arm/plat-novatek/plat b/BSP/linux-kernel/arch/arm/plat-novatek/plat deleted file mode 120000 index be865272d..000000000 --- a/BSP/linux-kernel/arch/arm/plat-novatek/plat +++ /dev/null @@ -1 +0,0 @@ -/home/payton/S530/BSP/linux-kernel/arch/arm/plat-novatek/plat-na51089 \ No newline at end of file diff --git a/BSP/linux-kernel/drivers/soc/nvt/nvt_hdal/hdal b/BSP/linux-kernel/drivers/soc/nvt/nvt_hdal/hdal deleted file mode 120000 index 82b63d2d4..000000000 --- a/BSP/linux-kernel/drivers/soc/nvt/nvt_hdal/hdal +++ /dev/null @@ -1 +0,0 @@ -/home/payton/S530/code/hdal \ No newline at end of file diff --git a/BSP/linux-kernel/drivers/soc/nvt/nvt_hdal/vos b/BSP/linux-kernel/drivers/soc/nvt/nvt_hdal/vos deleted file mode 120000 index bfe54dbe3..000000000 --- a/BSP/linux-kernel/drivers/soc/nvt/nvt_hdal/vos +++ /dev/null @@ -1 +0,0 @@ -/home/payton/S530/code/vos \ No newline at end of file diff --git a/build/nvt-tools/__pycache__/pyfdt.cpython-36.pyc b/build/nvt-tools/__pycache__/pyfdt.cpython-36.pyc deleted file mode 100644 index cabb4d884..000000000 Binary files a/build/nvt-tools/__pycache__/pyfdt.cpython-36.pyc and /dev/null differ diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c index c273efb58..9da211d10 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c @@ -742,9 +742,9 @@ EXIT: //origInfo_check = currentInfo; memcpy(&origInfo, ¤tInfo, sizeof(currentInfo)); memcpy(&origInfo_check, ¤tInfo, sizeof(currentInfo)); -#if HUNTING_CAMERA_MCU == ENABLE - sf_share_mem_customer_down(0); -#endif +//#if HUNTING_CAMERA_MCU == ENABLE +// sf_share_mem_customer_down(0); +//#endif if(sys_mtd_fp){ fclose(sys_mtd_fp); sys_mtd_fp = NULL; diff --git a/code/application/source/sf_app/code/include/sf_battery.h b/code/application/source/sf_app/code/include/sf_battery.h index e94f50002..a4a88d041 100644 --- a/code/application/source/sf_app/code/include/sf_battery.h +++ b/code/application/source/sf_app/code/include/sf_battery.h @@ -37,4 +37,5 @@ INT16 sf_adc2Temperature(UINT16 adcValue, UINT8 type);/*type: 0:F 1:C*/ void sf_stamp_temperature_get(INT16 *fTem,INT16 *cTem); /*0:F 1:C*/ void sf_temper_update(void); INT16 sf_celsius_change_to_fahrenheit(INT16 cTemper); +UINT16 sf_battery_val_get(void); #endif diff --git a/code/application/source/sf_app/code/source/app/sf_common.c b/code/application/source/sf_app/code/source/app/sf_common.c index dfd2005b4..df0359b7e 100755 --- a/code/application/source/sf_app/code/source/app/sf_common.c +++ b/code/application/source/sf_app/code/source/app/sf_common.c @@ -887,7 +887,7 @@ static SINT32 sf_app_proccess_cmd_dev(SF_MESSAGE_BUF_S *pMessageBuf) stMessageBuf.cmdId = CMD_DEV; stMessageBuf.arg1 = SF_DEV_CMD_BAT; stMessageBuf.arg2 = sf_battery_value_get(0); - stMessageBuf.arg3 = (SINT32)sf_battery_type_get(); + stMessageBuf.arg3 = ((SINT32)(((sf_battery_type_get()) << 16) | (sf_battery_val_get()))); printf("[%s:%d]batteryVal=%d battery_type:%d\n",__FUNCTION__,__LINE__,stMessageBuf.arg2, stMessageBuf.arg3); sf_com_message_send_to_cardv(&stMessageBuf); //sf_app_set_battery(pMessageBuf->arg2, pMessageBuf->arg3); diff --git a/code/application/source/sf_app/code/source/app/sf_service.c b/code/application/source/sf_app/code/source/app/sf_service.c index 856a7c606..466d368ae 100755 --- a/code/application/source/sf_app/code/source/app/sf_service.c +++ b/code/application/source/sf_app/code/source/app/sf_service.c @@ -192,10 +192,20 @@ SINT32 sf_USB_net_init(void) if(strncmp(puiPara->ModuleVer, GPRS_MODULE_TYPE_EG915Q, 6) == 0) { ret = sf_check_usb0(); + + if(ret != SUCCESS) + { + ret = sf_check_eth0(); + } } else { + ret = sf_check_eth0(); + if(ret != SUCCESS) + { + ret = sf_check_usb0(); + } } if (SUCCESS == ret) { diff --git a/code/application/source/sf_app/code/source/battery/sf_battery.c b/code/application/source/sf_app/code/source/battery/sf_battery.c index 29b7be3c2..4f16020d1 100755 --- a/code/application/source/sf_app/code/source/battery/sf_battery.c +++ b/code/application/source/sf_app/code/source/battery/sf_battery.c @@ -397,7 +397,7 @@ void sf_battery_level_update(void) stMessageBuf.cmdId = CMD_DEV; stMessageBuf.arg1 = SF_DEV_CMD_BAT; stMessageBuf.arg2 = batteryVal; - stMessageBuf.arg3 = (SINT32)sf_battery_type_get(); + stMessageBuf.arg3 = ((SINT32)(((sf_battery_type_get()) << 16) | (sf_battery_val_get()))); printf("[%s:%d]batteryVal=%d battery_type:%d\n",__FUNCTION__,__LINE__,batteryVal, stMessageBuf.arg3); sf_com_message_send_to_cardv(&stMessageBuf); #endif @@ -1290,6 +1290,26 @@ UINT8 sf_battery_type_get(void) return SF_POWER_TYPE_DC; } +/************************************************* + Function: sf_battery_type_get + Description: Get battery type. + Input: N/A + Output: N/A + Return: value: battery type, 0:normal 1:LiPolymer + Others: N/A +*************************************************/ +UINT16 sf_battery_val_get(void) +{ + if(IsPowerDcIn) + return (UINT16)DcVoltageVal; + else if(LiPolymerVoltageVal) + return (UINT16)LiPolymerVoltageVal; + else if(BatVoltageVal) + return (UINT16)BatVoltageVal; + else + return 0; +} + /************************************************* Function: sf_is_battery_low Description: Judge whether the power is low diff --git a/code/application/source/sf_app/code/source/paramMng/sf_param_common.c b/code/application/source/sf_app/code/source/paramMng/sf_param_common.c index 2e3fbf274..55f919e35 100755 --- a/code/application/source/sf_app/code/source/paramMng/sf_param_common.c +++ b/code/application/source/sf_app/code/source/paramMng/sf_param_common.c @@ -248,7 +248,89 @@ static int find_sys_mtd_device(char* result_buf, const UINT32 result_buf_size) return ret; } +UINT32 sf_app_set_pir_sensitivity(UINT8 pirs) +{ + UINT8 digPirLevel[10] = {200, 38, 30, 24, 18, 16, 10, 9, 8, 7}; + UINT8 digPirCount[10] = {0, 0, 0, 0, 0, 0, 1, 1, 1, 1}; + + UIMenuStoreInfo *puiPara = sf_app_ui_para_get(); + //UIMenuStoreInfo *puiPara = sf_ui_para_get(); + if(pirs >= 10) + return FAIL; + puiPara->PirSensitivity = pirs; + puiPara->DigitPirSensitivity = digPirLevel[pirs]; + puiPara->DigitPirCnt = digPirCount[pirs]; + puiPara->DigitPirWindowTime = 0; + //#if SF_IS_RELEASE == ENABLE + if(puiPara->PirSensitivity) + { + puiPara->TimelapseSwitch = SF_OFF; + puiPara->TimelapseTime.Hour = 0; + puiPara->TimelapseTime.Min = 0; + puiPara->TimelapseTime.Sec = 0; + //Save_MenuInfo(); + } + //#endif + return SUCCESS; +} +/************************************************* + Function: sf_power_on_para_check_init + Description: power on reset para + Input: N/A + Output: N/A + Return: N/A + Others: N/A +*************************************************/ +void sf_app_power_on_para_check_init(void) +{ +#if HUNTING_CAMERA_MCU == ENABLE + UIMenuStoreInfo *puiPara = sf_app_ui_para_get(); + UINT8 PowerOnMode = sf_poweron_type_get(); + if(((PowerOnMode == SF_MCU_STARTUP_NORMAL) || (PowerOnMode == SF_MCU_STARTUP_OFF) || (PowerOnMode == SF_MCU_STARTUP_ONKEY))) + { + if(1 == puiPara->NeedTimeSyncStartUp){ + puiPara->NeedTimeSyncStartUp = 0; + } + if(0 == puiPara->NetWorkNeedSearch){ + puiPara->NetWorkNeedSearch = 1; + } + memset(puiPara->SimIccid,'\0',sizeof(puiPara->SimIccid)); + } + printf("PowerOnMode=%d NeedTimeSyncStartUp=%d NetWorkNeedSearch:%d\n", PowerOnMode, puiPara->NeedTimeSyncStartUp, puiPara->NetWorkNeedSearch); + if(puiPara->Multishot != sf_sys_get_flag(FL_CONTINUE_SHOT)) + { + sf_sys_set_flag(FL_CONTINUE_SHOT, puiPara->Multishot); + } + + if(puiPara->VideoSize != sf_sys_get_flag(FL_MOVIE_SIZE)) + { + sf_sys_set_flag(FL_MOVIE_SIZE, puiPara->VideoSize); + sf_sys_set_flag(FL_MOVIE_SIZE_MENU, puiPara->VideoSize); + } + + if(puiPara->ImgSize != sf_sys_get_flag(FL_PHOTO_SIZE)) + { + sf_sys_set_flag(FL_PHOTO_SIZE, puiPara->ImgSize); + } + + if(puiPara->DateStyle != sf_sys_get_flag(FL_DateFormatIndex)) + { + sf_sys_set_flag(FL_DateFormatIndex, puiPara->DateStyle); + } + if(puiPara->Language != sf_sys_get_flag(FL_LANGUAGE)) + { + sf_sys_set_flag(FL_LANGUAGE, puiPara->Language); + } + if(puiPara->StampSwitch != sf_sys_get_flag(FL_DATE_STAMP)) + { + sf_sys_set_flag(FL_DATE_STAMP, puiPara->StampSwitch); + } + #if SF_HW_TEST != ENABLE + sf_app_set_pir_sensitivity(puiPara->PirSensitivity); + #endif +#endif +} int sf_customer_param_load(void) { unsigned long long partition_ofs= 0, partition_size = 0; @@ -321,6 +403,7 @@ EXIT: //SysCheckFlag(); //origInfo = currentInfo; //origInfo_check = currentInfo; + sf_app_power_on_para_check_init(); memcpy(&origInfo, ¤tInfo, sizeof(currentInfo)); memcpy(&origInfo_check, ¤tInfo, sizeof(currentInfo)); if(sys_mtd_fp){ diff --git a/code/lib/include/openssl/opensslconf.h b/code/lib/include/openssl/opensslconf.h deleted file mode 100644 index 73f3854fc..000000000 --- a/code/lib/include/openssl/opensslconf.h +++ /dev/null @@ -1,256 +0,0 @@ -/* opensslconf.h */ -/* WARNING: Generated automatically from opensslconf.h.in by Configure. */ - -#ifdef __cplusplus -extern "C" { -#endif -/* OpenSSL was configured with the following options: */ -#ifndef OPENSSL_DOING_MAKEDEPEND - - -#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 -# define OPENSSL_NO_EC_NISTP_64_GCC_128 -#endif -#ifndef OPENSSL_NO_GMP -# define OPENSSL_NO_GMP -#endif -#ifndef OPENSSL_NO_JPAKE -# define OPENSSL_NO_JPAKE -#endif -#ifndef OPENSSL_NO_KRB5 -# define OPENSSL_NO_KRB5 -#endif -#ifndef OPENSSL_NO_LIBUNBOUND -# define OPENSSL_NO_LIBUNBOUND -#endif -#ifndef OPENSSL_NO_MD2 -# define OPENSSL_NO_MD2 -#endif -#ifndef OPENSSL_NO_RC5 -# define OPENSSL_NO_RC5 -#endif -#ifndef OPENSSL_NO_RFC3779 -# define OPENSSL_NO_RFC3779 -#endif -#ifndef OPENSSL_NO_SCTP -# define OPENSSL_NO_SCTP -#endif -#ifndef OPENSSL_NO_SSL_TRACE -# define OPENSSL_NO_SSL_TRACE -#endif -#ifndef OPENSSL_NO_STORE -# define OPENSSL_NO_STORE -#endif -#ifndef OPENSSL_NO_UNIT_TEST -# define OPENSSL_NO_UNIT_TEST -#endif - -#endif /* OPENSSL_DOING_MAKEDEPEND */ - -#ifndef OPENSSL_THREADS -# define OPENSSL_THREADS -#endif -#ifndef OPENSSL_NO_STATIC_ENGINE -# define OPENSSL_NO_STATIC_ENGINE -#endif - -/* The OPENSSL_NO_* macros are also defined as NO_* if the application - asks for it. This is a transient feature that is provided for those - who haven't had the time to do the appropriate changes in their - applications. */ -#ifdef OPENSSL_ALGORITHM_DEFINES -# if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128) -# define NO_EC_NISTP_64_GCC_128 -# endif -# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) -# define NO_GMP -# endif -# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE) -# define NO_JPAKE -# endif -# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5) -# define NO_KRB5 -# endif -# if defined(OPENSSL_NO_LIBUNBOUND) && !defined(NO_LIBUNBOUND) -# define NO_LIBUNBOUND -# endif -# if defined(OPENSSL_NO_MD2) && !defined(NO_MD2) -# define NO_MD2 -# endif -# if defined(OPENSSL_NO_RC5) && !defined(NO_RC5) -# define NO_RC5 -# endif -# if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779) -# define NO_RFC3779 -# endif -# if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP) -# define NO_SCTP -# endif -# if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) -# define NO_SSL_TRACE -# endif -# if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) -# define NO_STORE -# endif -# if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) -# define NO_UNIT_TEST -# endif -#endif - -/* crypto/opensslconf.h.in */ - -/* Generate 80386 code? */ -#undef I386_ONLY - -#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */ -#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) -#define ENGINESDIR "/home/xiaojiazhu/project_codes/s530-ntk/code/lib/external/__install/lib/engines" -#define OPENSSLDIR "/home/xiaojiazhu/project_codes/s530-ntk/code/lib/external/__install/ssl" -#endif -#endif - -#undef OPENSSL_UNISTD -#define OPENSSL_UNISTD - -#undef OPENSSL_EXPORT_VAR_AS_FUNCTION - -#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) -#define IDEA_INT unsigned int -#endif - -#if defined(HEADER_MD2_H) && !defined(MD2_INT) -#define MD2_INT unsigned int -#endif - -#if defined(HEADER_RC2_H) && !defined(RC2_INT) -/* I need to put in a mod for the alpha - eay */ -#define RC2_INT unsigned int -#endif - -#if defined(HEADER_RC4_H) -#if !defined(RC4_INT) -/* using int types make the structure larger but make the code faster - * on most boxes I have tested - up to %20 faster. */ -/* - * I don't know what does "most" mean, but declaring "int" is a must on: - * - Intel P6 because partial register stalls are very expensive; - * - elder Alpha because it lacks byte load/store instructions; - */ -#define RC4_INT unsigned char -#endif -#if !defined(RC4_CHUNK) -/* - * This enables code handling data aligned at natural CPU word - * boundary. See crypto/rc4/rc4_enc.c for further details. - */ -#define RC4_CHUNK unsigned long -#endif -#endif - -#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG) -/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a - * %20 speed up (longs are 8 bytes, int's are 4). */ -#ifndef DES_LONG -#define DES_LONG unsigned int -#endif -#endif - -#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) -#define CONFIG_HEADER_BN_H -#define BN_LLONG - -/* Should we define BN_DIV2W here? */ - -/* Only one for the following should be defined */ -#undef SIXTY_FOUR_BIT_LONG -#undef SIXTY_FOUR_BIT -#define THIRTY_TWO_BIT -#endif - -#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) -#define CONFIG_HEADER_RC4_LOCL_H -/* if this is defined data[i] is used instead of *data, this is a %20 - * speedup on x86 */ -#undef RC4_INDEX -#endif - -#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) -#define CONFIG_HEADER_BF_LOCL_H -#define BF_PTR -#endif /* HEADER_BF_LOCL_H */ - -#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H) -#define CONFIG_HEADER_DES_LOCL_H -#ifndef DES_DEFAULT_OPTIONS -/* the following is tweaked from a config script, that is why it is a - * protected undef/define */ -#ifndef DES_PTR -#undef DES_PTR -#endif - -/* This helps C compiler generate the correct code for multiple functional - * units. It reduces register dependancies at the expense of 2 more - * registers */ -#ifndef DES_RISC1 -#undef DES_RISC1 -#endif - -#ifndef DES_RISC2 -#undef DES_RISC2 -#endif - -#if defined(DES_RISC1) && defined(DES_RISC2) -#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! -#endif - -/* Unroll the inner loop, this sometimes helps, sometimes hinders. - * Very mucy CPU dependant */ -#ifndef DES_UNROLL -#define DES_UNROLL -#endif - -/* These default values were supplied by - * Peter Gutman - * They are only used if nothing else has been defined */ -#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL) -/* Special defines which change the way the code is built depending on the - CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find - even newer MIPS CPU's, but at the moment one size fits all for - optimization options. Older Sparc's work better with only UNROLL, but - there's no way to tell at compile time what it is you're running on */ - -#if defined( sun ) /* Newer Sparc's */ -# define DES_PTR -# define DES_RISC1 -# define DES_UNROLL -#elif defined( __ultrix ) /* Older MIPS */ -# define DES_PTR -# define DES_RISC2 -# define DES_UNROLL -#elif defined( __osf1__ ) /* Alpha */ -# define DES_PTR -# define DES_RISC2 -#elif defined ( _AIX ) /* RS6000 */ - /* Unknown */ -#elif defined( __hpux ) /* HP-PA */ - /* Unknown */ -#elif defined( __aux ) /* 68K */ - /* Unknown */ -#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */ -# define DES_UNROLL -#elif defined( __sgi ) /* Newer MIPS */ -# define DES_PTR -# define DES_RISC2 -# define DES_UNROLL -#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */ -# define DES_PTR -# define DES_RISC1 -# define DES_UNROLL -#endif /* Systems-specific speed defines */ -#endif - -#endif /* DES_DEFAULT_OPTIONS */ -#endif /* HEADER_DES_LOCL_H */ -#ifdef __cplusplus -} -#endif diff --git a/code/lib/source/sifar/code/source/common/sf_common.c b/code/lib/source/sifar/code/source/common/sf_common.c index 54dccb19e..5e6d8b42a 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -80,6 +80,7 @@ static UINT8 FwUpdate = 0; static UINT8 IsNightLedOn = 0; static SF_BatteryLevel_e sf_LatestBattLevel = SF_BATT_LEVEL_0; static UINT8 batteryVal = 0; +static UINT16 powerVal = 0; static UINT8 batteryType = 0; static SINT16 fTemper = 0; static SINT16 cTemper = 0; @@ -1699,7 +1700,8 @@ static SINT32 sf_cardv_proccess_cmd_dev(SF_MESSAGE_BUF_S *pMessageBuf) break; case SF_DEV_CMD_BAT: batteryVal = pMessageBuf->arg2; - batteryType = pMessageBuf->arg3; + batteryType = pMessageBuf->arg3 & 0xf0; + powerVal = pMessageBuf->arg3 & 0xf; sf_cardv_battery_level_update(batteryVal); MLOGI("batteryVal:%d batteryType:%d\n",batteryVal,batteryType); @@ -2236,9 +2238,9 @@ UINT8 sf_cardv_battery_type_get(void) BOOL sf_is_flash_voltage_abnormal(void) { - printf("batteryVal=%d batteryType=%d \n", batteryVal, batteryType); + printf("powerVal=%d batteryType=%d \n", powerVal, batteryType); - if((/*SF_POWER_TYPE_DC*/1 != batteryType) && (batteryVal < 55) && (batteryVal < 55)) + if((/*SF_POWER_TYPE_DC*/1 != batteryType) && (powerVal < 55) ) { printf("low battery no write flash\n"); return TRUE; diff --git a/mkall.sh b/mkall.sh new file mode 100755 index 000000000..456c37600 --- /dev/null +++ b/mkall.sh @@ -0,0 +1,16 @@ +#!/bin/bash +#用于gitlab-ci.yml编译使用 +echo "Start compile." +export ROOT_PATH=$PWD + +cd rtos +source build/envsetup.sh +lunch rtos cfg_565_HUNTING_EVB_LINUX_4G_S530 gcc-6.5-newlib-2.4-2019.11-arm-ca9-eabihf +make all + +cd $ROOT_PATH +source build/envsetup.sh +lunch Linux cfg_565_HUNTING_EVB_LINUX_4G_S530 arm-ca9-linux-uclibcgnueabihf-8.4.01 +make all + +cd $ROOT_PATH \ No newline at end of file diff --git a/rtos/build/nvt-tools/__pycache__/pyfdt.cpython-36.pyc b/rtos/build/nvt-tools/__pycache__/pyfdt.cpython-36.pyc deleted file mode 100644 index c2ea84d65..000000000 Binary files a/rtos/build/nvt-tools/__pycache__/pyfdt.cpython-36.pyc and /dev/null differ diff --git a/rtos/code/application/source/cardv/SrcCode/FastFlow/flow_preview.c b/rtos/code/application/source/cardv/SrcCode/FastFlow/flow_preview.c index b241aca66..d3d5c6361 100755 --- a/rtos/code/application/source/cardv/SrcCode/FastFlow/flow_preview.c +++ b/rtos/code/application/source/cardv/SrcCode/FastFlow/flow_preview.c @@ -1165,19 +1165,19 @@ static UINT32 ae_adc_tbl[57][3] = { {702, 203, 1070}, {701, 267, 1070}, {700, 301, 1010}, - {699, 403, 1020}, - {698, 760, 1000}, - {697, 1085, 1000},// 524 - {696, 1516, 1000}, - {695, 1802, 1000}, - {694, 2333, 1000}, - {693, 3630, 1000}, - {691, 4668, 1000}, - {689, 7009, 1000}, - {687, 8333, 1600}, - {684, 8333, 2150}, - {681, 8333, 2550}, - {679, 8333, 2760}, + {699, 333, 1020}, + {698, 386, 1000}, + {697, 423, 1000},// 524 + {696, 502, 1000}, + {695, 560, 1000}, + {694, 828, 1000}, + {693, 991, 1000}, + {691, 1192, 1000}, + {689, 1325, 1000}, + {687, 1620, 1000}, + {684, 1999, 1000},//8333, 2150}, + {681, 3808, 1000},//8333, 2550}, + {679, 8333, 1070}, {669, 8333, 3030}, {645, 8333, 3160}, {617, 8333, 3400}, @@ -1191,9 +1191,9 @@ static UINT32 ae_adc_tbl[57][3] = { {446, 16666, 2720}, {422, 16666, 2890}, {399, 16666, 3000}, - {376, 16666, 3300}, - {353, 16666, 3500}, - {330, 16666, 4740}, + {376, 16666, 3000}, + {353, 16666, 3000}, + {330, 16666, 3000}, {308, 16666, 3950},// 12190}, {286, 16666, 4210},// 26600}, {264, 16666, 4500}, //45770}, diff --git a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.h b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.h index cc8a54c77..20f56df13 100755 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.h +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.h @@ -9,8 +9,8 @@ #define FLGPHOTOFAST_SHUTDOWN 0x00000002 #define FLGPHOTOFAST_MASK FLGPTN_BIT_ALL -#define PHOTOFAST_AE_PRESET_FRAME_CNT 21 /* lock AE */ -#define PHOTOFAST_START_CAP_FRAME_CNT (PHOTOFAST_AE_PRESET_FRAME_CNT + 4*2) /* capture frame, it should be larger than PHOTOFAST_AE_PRESET_FRAME_CNT by 3 */ +#define PHOTOFAST_AE_PRESET_FRAME_CNT 11 /* lock AE */ +#define PHOTOFAST_START_CAP_FRAME_CNT (PHOTOFAST_AE_PRESET_FRAME_CNT + 3*2) /* capture frame, it should be larger than PHOTOFAST_AE_PRESET_FRAME_CNT by 3 */ #define PHOTOFAST_HD_PUSH_PULL_TIMEOUT_MS 3000 // Naming rule & FileDB diff --git a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h index 98f0808ce..bf0fcd70a 100644 --- a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h +++ b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h @@ -264,10 +264,10 @@ #define SIFAR_FTP_USERNAME "cameraftp" #define SIFAR_FTP_PASSWORD "camera123456" -#define SIFAR_FTPS_IP "49.51.247.68" +#define SIFAR_FTPS_IP "150.109.112.64" #define SIFAR_FTPS_PORT "21" -#define SIFAR_FTPS_USERNAME "sifarftpsuser" -#define SIFAR_FTPS_PASSWORD "rsHkZJPg" +#define SIFAR_FTPS_USERNAME "ftp_user" +#define SIFAR_FTPS_PASSWORD "Sifar%%123456" #define CUSTOM_FTP_IP "ZnRwLTE1YmVuYWpmZWIuaXNoYXJlaXQubmV0" diff --git a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c index 2639cbaa0..79aeb8c38 100755 --- a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c +++ b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c @@ -348,6 +348,13 @@ void Load_MenuInfo(void) } else{ memcpy(¤tInfo, pCurrentInfoTmp, sizeof(UIMenuStoreInfo)); + #if HUNTING_CAMERA_MCU == ENABLE + if(currentInfo.OtaFlag) + { + SysResetFlag(); + Save_MenuInfo(); + } + #endif } free(pCurrentInfoTmp); @@ -368,7 +375,7 @@ void Load_MenuInfo(void) #if HUNTING_CAMERA_MCU == ENABLE sf_power_on_para_check_init(); #endif - origInfo = currentInfo; + memcpy(&origInfo, ¤tInfo, sizeof(currentInfo)); #endif @@ -1130,7 +1137,7 @@ void SysResetFlag(void) puiPara->DateStyle = DEFAULT_DATE_TIME; SysSetFlag(FL_DateFormatIndex, DEFAULT_DATE_TIME); ///////////// - puiPara->StampSwitch = DEFAULT_STAMP_SWITCH; + puiPara->StampSwitch = DEFAULT_DATE_STAMP;//DEFAULT_STAMP_SWITCH; puiPara->BatteryType = DEFAULT_BATTERY_TYPE; puiPara->SdLoopSwitch = DEFAULT_SD_LOOP_SWITCH; puiPara->PwdSwitch = DEFAULT_PWD_SWITCH; @@ -1200,12 +1207,42 @@ void SysResetFlag(void) #endif - snprintf((char *)puiPara->WifiApPWD, sizeof(puiPara->WifiApPWD), "Reveal2021"); - strcpy((char *)puiPara ->FtpIp, "119.23.174.139"); - strcpy((char *)puiPara ->FtpPort, "21"); - strcpy((char *)puiPara ->FtpUsr, "cameraftp"); - strcpy((char *)puiPara ->FtpPwd, "camera123456"); + UINT8 tmpStr[60] = {0}; +#if SF_TEST_GPRS + snprintf((char *)puiPara->FtpIp, sizeof(puiPara->FtpIp), USER_FTP_IP); + snprintf((char *)puiPara->FtpPort, sizeof(puiPara->FtpPort), USER_FTP_PORT); + snprintf((char *)puiPara->FtpUsr, sizeof(puiPara->FtpUsr), USER_FTP_USERNAME); + snprintf((char *)puiPara->FtpPwd, sizeof(puiPara->FtpPwd), USER_FTP_PASSWORD); + snprintf((char *)puiPara->FtpsIp, sizeof(puiPara->FtpsIp), SIFAR_FTPS_IP); + snprintf((char *)puiPara->FtpsPort, sizeof(puiPara->FtpsPort), SIFAR_FTPS_PORT); + snprintf((char *)puiPara->FtpsUsr, sizeof(puiPara->FtpsUsr), SIFAR_FTPS_USERNAME); + snprintf((char *)puiPara->FtpsPwd, sizeof(puiPara->FtpsPwd), SIFAR_FTPS_PASSWORD); + //SF_STRCPY(puiPara ->APNGPRS, "3gnet"); +#else + sf_base64_decode(USER_FTP_IP, (char *)tmpStr); + snprintf((char *)puiPara->FtpIp, sizeof(puiPara->FtpIp), (char *)tmpStr); + snprintf((char *)puiPara->FtpPort, sizeof(puiPara->FtpPort), USER_FTP_PORT); + memset(tmpStr, '\0', sizeof(tmpStr)); + sf_base64_decode(USER_FTP_USERNAME, (char *)tmpStr); + snprintf((char *)puiPara->FtpUsr, sizeof(puiPara->FtpUsr), (char *)tmpStr); + memset(tmpStr, '\0', sizeof(tmpStr)); + sf_base64_decode(USER_FTP_PASSWORD, (char *)tmpStr); + snprintf((char *)puiPara->FtpPwd, sizeof(puiPara->FtpPwd), (char *)tmpStr); +#endif + memset(tmpStr, '\0', sizeof(tmpStr)); + sf_base64_decode(OTA_FTP_IP, (char *)tmpStr); + snprintf((char *)puiPara->OtaFtpIp, sizeof(puiPara->OtaFtpIp), (char *)tmpStr); + snprintf((char *)puiPara->OtaFtpPort, sizeof(puiPara->OtaFtpPort), OTA_FTP_PORT); + + memset(tmpStr, '\0', sizeof(tmpStr)); + sf_base64_decode(OTA_FTP_USERNAME, (char *)tmpStr); + snprintf((char *)puiPara->OtaFtpUserName, sizeof(puiPara->OtaFtpUserName), (char *)tmpStr); + + memset(tmpStr, '\0', sizeof(tmpStr)); + sf_base64_decode(OTA_FTP_PASSWORD, (char *)tmpStr); + snprintf((char *)puiPara->OtaFtpPassWord, sizeof(puiPara->OtaFtpPassWord), (char *)tmpStr); + #if defined(_MODEL_565_HUNTING_EVB_LINUX_4G_S530_) puiPara->GpsNumber = DEFAULT_GPS_NUMBER; puiPara->TimeSend1Switch = DEFAULT_TIMESEND1_SWITCH; diff --git a/rtos/code/driver/na51089/include/sf_mcu.h b/rtos/code/driver/na51089/include/sf_mcu.h index d431adc00..1db44de03 100755 --- a/rtos/code/driver/na51089/include/sf_mcu.h +++ b/rtos/code/driver/na51089/include/sf_mcu.h @@ -527,5 +527,6 @@ UINT8 sf_convert_power_on_mode(void); void sf_hw_info_save(char *name,FST_FILE fd); void sf_set_iso_exp_lv(UINT32 adj, UINT32 iso, UINT32 exp, UINT32 lv); UINT32 sf_in_update(void); +int sf_base64_decode(const char * base64, char * bindata); #endif diff --git a/rtos/code/driver/na51089/source/mcu/sf_mcu.c b/rtos/code/driver/na51089/source/mcu/sf_mcu.c index af14cd50c..90c645198 100755 --- a/rtos/code/driver/na51089/source/mcu/sf_mcu.c +++ b/rtos/code/driver/na51089/source/mcu/sf_mcu.c @@ -2342,6 +2342,52 @@ void sf_para_print(void) sf_battery_print(); } +static char * base64char = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +int sf_base64_decode(const char * base64, char * bindata) +{ + int i, j; + unsigned char k; + unsigned char temp[4]; + for (i = 0, j = 0; base64[i] != '\0'; i += 4) + { + memset(temp, 0xFF, sizeof(temp)); + for (k = 0; k < 64; k++) + { + if (base64char[k] == base64[i]) + temp[0] = k; + } + for (k = 0; k < 64; k++) + { + if (base64char[k] == base64[i + 1]) + temp[1] = k; + } + for (k = 0; k < 64; k++) + { + if (base64char[k] == base64[i + 2]) + temp[2] = k; + } + for (k = 0; k < 64; k++) + { + if (base64char[k] == base64[i + 3]) + temp[3] = k; + } + + bindata[j++] = ((unsigned char)(((unsigned char)(temp[0] << 2)) & 0xFC)) | + ((unsigned char)((unsigned char)(temp[1] >> 4) & 0x03)); + if (base64[i + 2] == '=') + break; + + bindata[j++] = ((unsigned char)(((unsigned char)(temp[1] << 4)) & 0xF0)) | + ((unsigned char)((unsigned char)(temp[2] >> 2) & 0x0F)); + if (base64[i + 3] == '=') + break; + + bindata[j++] = ((unsigned char)(((unsigned char)(temp[2] << 6)) & 0xF0)) | + ((unsigned char)(temp[3] & 0x3F)); + } + return j; +} #if SF_HW_TEST == ENABLE UINT32 testadj = 0; UINT32 testiso = 0;