Merge branch 'Branch_S550_GUI' of 192.168.6.216:/linux-em-group/s530-ntk into branch_s550_gui_debug
This commit is contained in:
commit
6053e38e26
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -56,4 +56,5 @@ BSP/root-fs/rootfs/usr/lib/libgettextpo.so.0
|
||||||
BSP/root-fs/rootfs/usr/lib/libglib-2.0.so.0
|
BSP/root-fs/rootfs/usr/lib/libglib-2.0.so.0
|
||||||
BSP/root-fs/rootfs/usr/lib/libintl.so.8
|
BSP/root-fs/rootfs/usr/lib/libintl.so.8
|
||||||
BSP/root-fs/rootfs/usr/lib/libncurses.so.6
|
BSP/root-fs/rootfs/usr/lib/libncurses.so.6
|
||||||
BSP/root-fs/rootfs/usr/lib/libreadline.so.8
|
BSP/root-fs/rootfs/usr/lib/libreadline.so.8
|
||||||
|
BSP/root-fs/rootfs/usr/lib/libbluetooth.so.3
|
4
BSP/linux-kernel/arch/arm/configs/na51089_evb_cardv_defconfig_release
Normal file → Executable file
4
BSP/linux-kernel/arch/arm/configs/na51089_evb_cardv_defconfig_release
Normal file → Executable file
|
@ -2076,7 +2076,7 @@ CONFIG_NVT_HDAL_KDRV_BUILTIN=y
|
||||||
# CONFIG_PM_DEVFREQ is not set
|
# CONFIG_PM_DEVFREQ is not set
|
||||||
# CONFIG_EXTCON is not set
|
# CONFIG_EXTCON is not set
|
||||||
# CONFIG_MEMORY is not set
|
# CONFIG_MEMORY is not set
|
||||||
CONFIG_IIO=y
|
CONFIG_IIO=m
|
||||||
# CONFIG_IIO_BUFFER is not set
|
# CONFIG_IIO_BUFFER is not set
|
||||||
# CONFIG_IIO_CONFIGFS is not set
|
# CONFIG_IIO_CONFIGFS is not set
|
||||||
# CONFIG_IIO_TRIGGER is not set
|
# CONFIG_IIO_TRIGGER is not set
|
||||||
|
@ -2156,7 +2156,7 @@ CONFIG_IIO=y
|
||||||
# CONFIG_TI_ADS8688 is not set
|
# CONFIG_TI_ADS8688 is not set
|
||||||
# CONFIG_TI_TLC4541 is not set
|
# CONFIG_TI_TLC4541 is not set
|
||||||
# CONFIG_VF610_ADC is not set
|
# CONFIG_VF610_ADC is not set
|
||||||
CONFIG_NVT_ADC=y
|
CONFIG_NVT_ADC=m
|
||||||
|
|
||||||
#
|
#
|
||||||
# Analog Front Ends
|
# Analog Front Ends
|
||||||
|
|
|
@ -20,12 +20,17 @@
|
||||||
#include <linux/of_device.h>
|
#include <linux/of_device.h>
|
||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
#include <linux/thermal.h>
|
#include <linux/thermal.h>
|
||||||
|
#include <linux/workqueue.h>
|
||||||
|
#include <linux/delay.h>
|
||||||
#include <plat/adc_reg.h>
|
#include <plat/adc_reg.h>
|
||||||
#include <plat/efuse_protected.h>
|
#include <plat/efuse_protected.h>
|
||||||
#include <plat/top.h>
|
#include <plat/top.h>
|
||||||
|
|
||||||
#define DRV_VERSION "1.03.000"
|
#include <linux/proc_fs.h>
|
||||||
|
#include <linux/seq_file.h>
|
||||||
|
#include <linux/uaccess.h>
|
||||||
|
|
||||||
|
#define DRV_VERSION "1.06.003"
|
||||||
|
|
||||||
#ifdef CONFIG_NVT_FPGA_EMULATION
|
#ifdef CONFIG_NVT_FPGA_EMULATION
|
||||||
#define CALI_VDDADC 3300
|
#define CALI_VDDADC 3300
|
||||||
|
@ -43,7 +48,7 @@
|
||||||
.indexed = 1, \
|
.indexed = 1, \
|
||||||
.channel = num, \
|
.channel = num, \
|
||||||
.address = num, \
|
.address = num, \
|
||||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
|
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_AVERAGE_RAW), \
|
||||||
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),\
|
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),\
|
||||||
.scan_index = num, \
|
.scan_index = num, \
|
||||||
.scan_type = { \
|
.scan_type = { \
|
||||||
|
@ -55,11 +60,13 @@
|
||||||
.datasheet_name = id, \
|
.datasheet_name = id, \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static UINT8 debug_adc = 0;
|
||||||
|
|
||||||
static uint nvt_adc_poll_mode = 1;
|
static uint nvt_adc_poll_mode = 1;
|
||||||
module_param(nvt_adc_poll_mode, int, S_IRUGO | S_IWUSR);
|
module_param(nvt_adc_poll_mode, int, S_IRUGO | S_IWUSR);
|
||||||
MODULE_PARM_DESC(nvt_adc_poll_mode, "1:poll mode, 0:irq mode");
|
MODULE_PARM_DESC(nvt_adc_poll_mode, "1:poll mode, 0:irq mode");
|
||||||
|
|
||||||
static uint nvt_adc_pow2div = 1;
|
static uint nvt_adc_pow2div = 7;
|
||||||
module_param(nvt_adc_pow2div, int, S_IRUGO | S_IWUSR);
|
module_param(nvt_adc_pow2div, int, S_IRUGO | S_IWUSR);
|
||||||
MODULE_PARM_DESC(nvt_adc_pow2div, "adc sample clock pow2 div");
|
MODULE_PARM_DESC(nvt_adc_pow2div, "adc sample clock pow2 div");
|
||||||
|
|
||||||
|
@ -75,8 +82,54 @@ struct nvt_adc_state {
|
||||||
struct clk *clk;
|
struct clk *clk;
|
||||||
unsigned long trim_value;
|
unsigned long trim_value;
|
||||||
u32 cali_value;
|
u32 cali_value;
|
||||||
|
struct delayed_work adc_avg_work;// cal adc mid work
|
||||||
|
struct proc_dir_entry *pproc_adc;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ADC Average func //
|
||||||
|
// data 0
|
||||||
|
static UINT32 *t_data = NULL;
|
||||||
|
static UINT32 t_data_now = 0; // store t_data amount
|
||||||
|
static UINT32 adc_mid_val = 0; // store average value
|
||||||
|
static UINT32 adc_mid_vol = 0; // store average voltage
|
||||||
|
static UINT32 adc_mid = 0;
|
||||||
|
static UINT32 adc_mid_first = 0; // first read ready
|
||||||
|
|
||||||
|
// data_1
|
||||||
|
static UINT32 *t_data1 = NULL;
|
||||||
|
static UINT32 t_data_now1 = 0; // store t_data amount
|
||||||
|
static UINT32 adc_mid1_val = 0; // store average value
|
||||||
|
static UINT32 adc_mid1_vol = 0; // store average voltage
|
||||||
|
static UINT32 adc_mid1 = 0;
|
||||||
|
static UINT32 adc_mid1_first = 0; // mid2 first read ready
|
||||||
|
|
||||||
|
// data_2
|
||||||
|
static UINT32 *t_data2 = NULL;
|
||||||
|
static UINT32 t_data_now2 = 0; // store t_data amount
|
||||||
|
static UINT32 adc_mid2_val = 0; // store average value
|
||||||
|
static UINT32 adc_mid2_vol = 0; // store average voltage
|
||||||
|
static UINT32 adc_mid2 = 0;
|
||||||
|
static UINT32 adc_mid2_first = 0; // mid2 first read ready
|
||||||
|
|
||||||
|
// data_3
|
||||||
|
static UINT32 *t_data3 = NULL;
|
||||||
|
static UINT32 t_data_now3 = 0; // store t_data amount
|
||||||
|
static UINT32 adc_mid3_val = 0; // store average value
|
||||||
|
static UINT32 adc_mid3_vol = 0; // store average voltage
|
||||||
|
static UINT32 adc_mid3 = 0;
|
||||||
|
static UINT32 adc_mid3_first = 0; // mid2 first read ready
|
||||||
|
//
|
||||||
|
|
||||||
|
static u32 adc_base = 0;
|
||||||
|
static UINT32 adc_trim = 0;
|
||||||
|
|
||||||
|
static UINT32 adc_avg_times = 50;
|
||||||
|
static UINT32 filter = 3 ;
|
||||||
|
static UINT32 avg_sel = 3;
|
||||||
|
static UINT32 avg_sel_sts = 0;
|
||||||
|
|
||||||
|
|
||||||
static u32 adc_getreg(struct nvt_adc_state *adc, u32 offset)
|
static u32 adc_getreg(struct nvt_adc_state *adc, u32 offset)
|
||||||
{
|
{
|
||||||
return nvt_readl(adc->base + offset);
|
return nvt_readl(adc->base + offset);
|
||||||
|
@ -121,10 +174,414 @@ static void adc_set_default_hw(struct nvt_adc_state *adc)
|
||||||
ctrl_reg.bit.clkdiv = nvt_adc_pow2div;
|
ctrl_reg.bit.clkdiv = nvt_adc_pow2div;
|
||||||
ctrl_reg.bit.sampavg = 0;
|
ctrl_reg.bit.sampavg = 0;
|
||||||
ctrl_reg.bit.extsamp_cnt = nvt_adc_plusdiv;
|
ctrl_reg.bit.extsamp_cnt = nvt_adc_plusdiv;
|
||||||
ctrl_reg.bit.adc_en = 0;
|
ctrl_reg.bit.adc_en = 1;
|
||||||
adc_setreg(adc, ADC_CTRL_REG_OFS, ctrl_reg.reg);
|
adc_setreg(adc, ADC_CTRL_REG_OFS, ctrl_reg.reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
static int nvt_adc_read_avg_int(void)
|
||||||
|
{
|
||||||
|
t_data = (int*)kmalloc(sizeof(int) * adc_avg_times , GFP_KERNEL);
|
||||||
|
memset(t_data ,0, adc_avg_times*sizeof(int));
|
||||||
|
|
||||||
|
t_data1 = (int*)kmalloc(sizeof(int) * adc_avg_times , GFP_KERNEL);
|
||||||
|
memset(t_data1 ,0, adc_avg_times*sizeof(int));
|
||||||
|
|
||||||
|
t_data2 = (int*)kmalloc(sizeof(int) * adc_avg_times , GFP_KERNEL);
|
||||||
|
memset(t_data2 ,0, adc_avg_times*sizeof(int));
|
||||||
|
|
||||||
|
t_data3 = (int*)kmalloc(sizeof(int) * adc_avg_times , GFP_KERNEL);
|
||||||
|
memset(t_data3 ,0, adc_avg_times*sizeof(int));
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void nvt_adc_read_avg(struct work_struct *work) //(struct nvt_adc_state *adc, u8 channel)
|
||||||
|
{
|
||||||
|
UINT32 adc_data = 0;
|
||||||
|
UINT32 i = 0, temp = 0;
|
||||||
|
UINT32 channel = 0;
|
||||||
|
|
||||||
|
struct nvt_adc_state *adc = container_of(work, struct nvt_adc_state,
|
||||||
|
adc_avg_work.work);
|
||||||
|
|
||||||
|
//adc_mid_val = adc_mid;
|
||||||
|
//adc_mid_vol = (adc_mid +CALI_OFFSET)*adc_trim/511;
|
||||||
|
//printk("\n adc_mid = %d , adc_mid_val = %d , adc_mid_vol = %d \r\n\n", adc_mid, adc_mid_val, adc_mid_vol);
|
||||||
|
if (adc_mid3_first == 0) {
|
||||||
|
//schedule_delayed_work(&adc->adc_avg_work, msecs_to_jiffies(10));
|
||||||
|
goto adc_avg_work ;
|
||||||
|
}
|
||||||
|
|
||||||
|
// data 0
|
||||||
|
if( avg_sel == 0 ){
|
||||||
|
|
||||||
|
if (adc_mid_first == 0 ){ // firstly ready
|
||||||
|
if (avg_sel_sts == 1 ){
|
||||||
|
mdelay(1);
|
||||||
|
avg_sel_sts = 0;
|
||||||
|
}
|
||||||
|
adc_mid = nvt_readl(adc_base + ADC_AIN0_DATA_REG_OFS + channel*4);
|
||||||
|
if (avg_sel_sts == 1 ){
|
||||||
|
mdelay(1);
|
||||||
|
avg_sel_sts = 0;
|
||||||
|
|
||||||
|
}else{
|
||||||
|
adc_mid_val = adc_mid;
|
||||||
|
adc_mid_vol = (adc_mid + CALI_OFFSET)*adc_trim/511;
|
||||||
|
adc_mid_first++ ;
|
||||||
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
if (avg_sel_sts == 1 ){
|
||||||
|
mdelay(1);
|
||||||
|
avg_sel_sts = 0;
|
||||||
|
}
|
||||||
|
temp = nvt_readl(adc_base + ADC_AIN0_DATA_REG_OFS + channel*4);
|
||||||
|
if (avg_sel_sts == 1 ){
|
||||||
|
mdelay(1);
|
||||||
|
avg_sel_sts = 0;
|
||||||
|
|
||||||
|
}else {
|
||||||
|
|
||||||
|
if( (temp <= (adc_mid + filter)) && (temp >= (adc_mid - filter) ) ){
|
||||||
|
t_data[t_data_now] = temp;
|
||||||
|
t_data_now++;
|
||||||
|
}
|
||||||
|
if (t_data_now != 0 && debug_adc){
|
||||||
|
printk("0.temp = %d, t_data[t_data_now = %d] = %d , adc_mid = %u, filter = %u\r\n",temp, t_data_now-1, t_data[t_data_now-1], adc_mid, filter);
|
||||||
|
}
|
||||||
|
|
||||||
|
// calculate average
|
||||||
|
if (t_data_now >= adc_avg_times ){
|
||||||
|
adc_data = 0;
|
||||||
|
for( i = 0 ; i < adc_avg_times ; i++ ){
|
||||||
|
adc_data += t_data[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
adc_data = adc_data / adc_avg_times ;
|
||||||
|
|
||||||
|
adc_mid_val = adc_data;
|
||||||
|
adc_mid = adc_data;
|
||||||
|
t_data_now = 0 ;
|
||||||
|
|
||||||
|
adc_mid_val = adc_mid;
|
||||||
|
adc_mid_vol = (adc_mid +CALI_OFFSET)*adc_trim/511;
|
||||||
|
|
||||||
|
printk("reset0 adc_mid_val = %d, adc_mid_vol = %d \r\n",adc_mid_val, adc_mid_vol);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// data 1
|
||||||
|
} else if( avg_sel == 1 ) {
|
||||||
|
|
||||||
|
if (adc_mid1_first == 0 ){ // firstly ready
|
||||||
|
if (avg_sel_sts == 1 ){
|
||||||
|
mdelay(1);
|
||||||
|
avg_sel_sts = 0;
|
||||||
|
}
|
||||||
|
adc_mid1 = nvt_readl(adc_base + ADC_AIN0_DATA_REG_OFS + channel*4);
|
||||||
|
if (avg_sel_sts == 1 ){
|
||||||
|
mdelay(1);
|
||||||
|
avg_sel_sts = 0;
|
||||||
|
} else {
|
||||||
|
adc_mid1_val = adc_mid1;
|
||||||
|
adc_mid1_vol = (adc_mid1 + CALI_OFFSET)*adc_trim/511;
|
||||||
|
adc_mid1_first++ ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}else{
|
||||||
|
if (avg_sel_sts == 1 ){
|
||||||
|
mdelay(1);
|
||||||
|
avg_sel_sts = 0;
|
||||||
|
}
|
||||||
|
temp = nvt_readl(adc_base + ADC_AIN0_DATA_REG_OFS + channel*4);
|
||||||
|
|
||||||
|
if (avg_sel_sts == 1 ){
|
||||||
|
mdelay(1);
|
||||||
|
avg_sel_sts = 0;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if( (temp <= (adc_mid1 + filter)) && (temp >= (adc_mid1 - filter) ) ){
|
||||||
|
t_data1[t_data_now1] = temp;
|
||||||
|
t_data_now1++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (t_data_now1 != 0 && debug_adc){
|
||||||
|
printk("1.temp = %d, t_data1[t_data_now1 = %d] = %d \r\n",temp ,t_data_now1-1, t_data1[t_data_now1-1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// calculate average
|
||||||
|
if (t_data_now1 >= adc_avg_times ){
|
||||||
|
adc_data = 0;
|
||||||
|
for( i = 0 ; i < adc_avg_times ; i++ ){
|
||||||
|
adc_data += t_data1[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
adc_data = adc_data / adc_avg_times ;
|
||||||
|
|
||||||
|
adc_mid1_val = adc_data;
|
||||||
|
adc_mid1 = adc_data;
|
||||||
|
t_data_now1 = 0 ;
|
||||||
|
|
||||||
|
adc_mid1_val = adc_mid1;
|
||||||
|
adc_mid1_vol = (adc_mid1 +CALI_OFFSET)*adc_trim/511;
|
||||||
|
|
||||||
|
printk("reset1 adc_mid1 = %d, adc_mid1_vol = %d \r\n",adc_mid1, adc_mid1_val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// data 2
|
||||||
|
} else if( avg_sel == 2 ) {
|
||||||
|
|
||||||
|
if (adc_mid2_first == 0 ){ // firstly ready
|
||||||
|
if (avg_sel_sts == 1 ){
|
||||||
|
mdelay(1);
|
||||||
|
avg_sel_sts = 0;
|
||||||
|
}
|
||||||
|
adc_mid2 = nvt_readl(adc_base + ADC_AIN0_DATA_REG_OFS + channel*4);
|
||||||
|
if (avg_sel_sts == 1 ){
|
||||||
|
mdelay(1);
|
||||||
|
avg_sel_sts = 0;
|
||||||
|
} else {
|
||||||
|
adc_mid2_val = adc_mid2;
|
||||||
|
adc_mid2_vol = (adc_mid2 + CALI_OFFSET)*adc_trim/511;
|
||||||
|
adc_mid2_first++ ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}else{
|
||||||
|
if (avg_sel_sts == 1 ){
|
||||||
|
mdelay(1);
|
||||||
|
avg_sel_sts = 0;
|
||||||
|
}
|
||||||
|
temp = nvt_readl(adc_base + ADC_AIN0_DATA_REG_OFS + channel*4);
|
||||||
|
|
||||||
|
if (avg_sel_sts == 1 ){
|
||||||
|
mdelay(1);
|
||||||
|
avg_sel_sts = 0;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if( (temp <= (adc_mid2 + filter)) && (temp >= (adc_mid2 - filter) ) ){
|
||||||
|
t_data2[t_data_now2] = temp;
|
||||||
|
t_data_now2++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (t_data_now2 != 0 && debug_adc){
|
||||||
|
printk("2.temp = %d, t_data2[t_data_now2 = %d] = %d \r\n",temp ,t_data_now2-1, t_data2[t_data_now2-1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// calculate average
|
||||||
|
if (t_data_now2 >= adc_avg_times ){
|
||||||
|
adc_data = 0;
|
||||||
|
for( i = 0 ; i < adc_avg_times ; i++ ){
|
||||||
|
adc_data += t_data2[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
adc_data = adc_data / adc_avg_times ;
|
||||||
|
|
||||||
|
adc_mid2_val = adc_data;
|
||||||
|
adc_mid2 = adc_data;
|
||||||
|
t_data_now2 = 0 ;
|
||||||
|
|
||||||
|
adc_mid2_val = adc_mid2;
|
||||||
|
adc_mid2_vol = (adc_mid2 +CALI_OFFSET)*adc_trim/511;
|
||||||
|
|
||||||
|
printk("reset2 adc_mid2 = %d, adc_mid2_vol = %d \r\n",adc_mid2, adc_mid2_val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// data 3
|
||||||
|
} else if( avg_sel == 3 ) {
|
||||||
|
|
||||||
|
if (adc_mid3_first == 0 ){ // firstly ready
|
||||||
|
if (avg_sel_sts == 1 ){
|
||||||
|
mdelay(1);
|
||||||
|
avg_sel_sts = 0;
|
||||||
|
}
|
||||||
|
adc_mid3 = nvt_readl(adc_base + ADC_AIN0_DATA_REG_OFS + channel*4);
|
||||||
|
if (avg_sel_sts == 1 ){
|
||||||
|
mdelay(1);
|
||||||
|
avg_sel_sts = 0;
|
||||||
|
} else {
|
||||||
|
adc_mid3_val = adc_mid3;
|
||||||
|
adc_mid3_vol = (adc_mid3 + CALI_OFFSET)*adc_trim/511;
|
||||||
|
adc_mid3_first++ ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}else{
|
||||||
|
if (avg_sel_sts == 1 ){
|
||||||
|
mdelay(1);
|
||||||
|
avg_sel_sts = 0;
|
||||||
|
}
|
||||||
|
temp = nvt_readl(adc_base + ADC_AIN0_DATA_REG_OFS + channel*4);
|
||||||
|
|
||||||
|
if (avg_sel_sts == 1 ){
|
||||||
|
mdelay(1);
|
||||||
|
avg_sel_sts = 0;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if( (temp <= (adc_mid3 + filter)) && (temp >= (adc_mid3 - filter) ) ){
|
||||||
|
t_data3[t_data_now3] = temp;
|
||||||
|
t_data_now3++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (t_data_now3 != 0 && debug_adc){
|
||||||
|
printk("3.temp = %d, t_data3[t_data_now3 = %d] = %d \r\n",temp ,t_data_now3-1, t_data3[t_data_now3-1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// calculate average
|
||||||
|
if (t_data_now3 >= adc_avg_times ){
|
||||||
|
adc_data = 0;
|
||||||
|
for( i = 0 ; i < adc_avg_times ; i++ ){
|
||||||
|
adc_data += t_data3[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
adc_data = adc_data / adc_avg_times ;
|
||||||
|
|
||||||
|
adc_mid3_val = adc_data;
|
||||||
|
adc_mid3 = adc_data;
|
||||||
|
t_data_now3 = 0 ;
|
||||||
|
|
||||||
|
adc_mid3_val = adc_mid3;
|
||||||
|
adc_mid3_vol = (adc_mid3 +CALI_OFFSET)*adc_trim/511;
|
||||||
|
|
||||||
|
printk("reset3 adc_mid3 = %d, adc_mid3_vol = %d adc_mid3_vol=%u\r\n",adc_mid3, adc_mid3_val, adc_mid3_vol);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
adc_avg_work :
|
||||||
|
schedule_delayed_work(&adc->adc_avg_work, msecs_to_jiffies(5));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#if 1
|
||||||
|
|
||||||
|
#define MAX_CMD_LENGTH 10
|
||||||
|
static ssize_t data_proc_cmd_write(struct file *file, const char __user *buf,
|
||||||
|
size_t size, loff_t *off)
|
||||||
|
{
|
||||||
|
int val;
|
||||||
|
int len = size;
|
||||||
|
char cmd_line[MAX_CMD_LENGTH];
|
||||||
|
char *cmdstr = cmd_line;
|
||||||
|
const char delimiters[] = {' ', 0x0A, 0x0D, '\0'};
|
||||||
|
char *p_arg;
|
||||||
|
union ADC_CTRL_REG ctrl_reg;
|
||||||
|
UINT32 temp;
|
||||||
|
|
||||||
|
// check command length
|
||||||
|
if (len > (MAX_CMD_LENGTH - 1)) {
|
||||||
|
printk("%s: Command length %d is too long\n", __func__, len);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// copy command string from user space
|
||||||
|
if (copy_from_user(cmd_line, buf, len)) {
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (len == 0)
|
||||||
|
cmd_line[0] = '\0';
|
||||||
|
else
|
||||||
|
cmd_line[len - 1] = '\0';
|
||||||
|
|
||||||
|
p_arg = strsep(&cmdstr, delimiters);
|
||||||
|
sscanf(p_arg, "%x", &val);
|
||||||
|
|
||||||
|
// set avg_sel = 0 or 1 for 1 CH connect two device
|
||||||
|
avg_sel = val;
|
||||||
|
avg_sel_sts = 1;
|
||||||
|
|
||||||
|
printk("avg_sel = %d \n", avg_sel);
|
||||||
|
|
||||||
|
if ( avg_sel == 5 ){
|
||||||
|
|
||||||
|
// Check ADC is Enable
|
||||||
|
ctrl_reg.reg = nvt_readl(adc_base + ADC_CTRL_REG_OFS);
|
||||||
|
if(!ctrl_reg.bit.adc_en){
|
||||||
|
ctrl_reg.reg = nvt_readl(adc_base + ADC_CTRL_REG_OFS);
|
||||||
|
ctrl_reg.bit.adc_en = 1;
|
||||||
|
nvt_writel(ctrl_reg.reg, adc_base + ADC_CTRL_REG_OFS);
|
||||||
|
}
|
||||||
|
|
||||||
|
// second value
|
||||||
|
temp = nvt_readl(adc_base + ADC_AIN0_DATA_REG_OFS + 0*4);
|
||||||
|
printk("ch0 second val = %d \n", temp);
|
||||||
|
|
||||||
|
// cal second trim2
|
||||||
|
if(temp)
|
||||||
|
adc_trim = adc_mid3_vol * 511 / temp ;
|
||||||
|
else{
|
||||||
|
adc_trim = 511;
|
||||||
|
printk("!!!!!!!!! temp is zero\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
printk("adc_trim = %d \n", adc_trim);
|
||||||
|
|
||||||
|
t_data3[t_data_now3] = temp;
|
||||||
|
t_data_now3++;
|
||||||
|
adc_mid3 = temp;
|
||||||
|
adc_mid3_val = adc_mid3;
|
||||||
|
adc_mid3_vol = (adc_mid3 + CALI_OFFSET)*adc_trim/511;
|
||||||
|
|
||||||
|
adc_mid3_first = 1 ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int adc_proc_show(struct seq_file *seq, void *v)
|
||||||
|
{
|
||||||
|
UINT32 volt = 0 ;
|
||||||
|
//printk("adc_avg_value = %d, adc_avg_voltage = %d \n", adc_mid_val, adc_mid_vol);
|
||||||
|
//printk("adc_avg2 value = %d, adc2_avg_voltage = %d \n", adc_mid1_val, adc_mid1_vol);
|
||||||
|
if ( avg_sel == 0 ){
|
||||||
|
//printk("%d\n", adc_mid_vol);
|
||||||
|
volt = adc_mid_vol;
|
||||||
|
}else if ( avg_sel == 1 ){
|
||||||
|
//printk("%d\n", adc_mid1_vol);
|
||||||
|
volt = adc_mid1_vol;
|
||||||
|
}else if ( avg_sel == 2 ){
|
||||||
|
//printk("%d\n", adc_mid2_vol);
|
||||||
|
volt = adc_mid2_vol;
|
||||||
|
}else if ( avg_sel == 3 ){
|
||||||
|
printk("adc_mid3_vol = %d\n", adc_mid3_vol);
|
||||||
|
volt = adc_mid3_vol;
|
||||||
|
}
|
||||||
|
seq_printf(seq,"%d\n",volt);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int adc_proc_open(struct inode *inode, struct file *file)
|
||||||
|
{
|
||||||
|
return single_open(file, adc_proc_show, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct file_operations proc_adc_fops = {
|
||||||
|
.owner = THIS_MODULE,
|
||||||
|
.open = adc_proc_open,
|
||||||
|
.read = seq_read,
|
||||||
|
.llseek = seq_lseek,
|
||||||
|
.release = single_release,
|
||||||
|
.write = data_proc_cmd_write,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
static u32 nvt_adc_get_value(struct nvt_adc_state *adc, u8 channel)
|
static u32 nvt_adc_get_value(struct nvt_adc_state *adc, u8 channel)
|
||||||
{
|
{
|
||||||
u16 adc_data;
|
u16 adc_data;
|
||||||
|
@ -150,6 +607,16 @@ static int nvt_adc_read_raw(struct iio_dev *iio,
|
||||||
*value = nvt_adc_get_value(adc, channel->address);
|
*value = nvt_adc_get_value(adc, channel->address);
|
||||||
return IIO_VAL_INT;
|
return IIO_VAL_INT;
|
||||||
|
|
||||||
|
// Read Average
|
||||||
|
case IIO_CHAN_INFO_AVERAGE_RAW:
|
||||||
|
if ( avg_sel == 0 ){
|
||||||
|
*value = adc_mid_vol;
|
||||||
|
}else{
|
||||||
|
*value = adc_mid1_vol;
|
||||||
|
}
|
||||||
|
|
||||||
|
return IIO_VAL_INT;
|
||||||
|
|
||||||
case IIO_CHAN_INFO_SCALE:
|
case IIO_CHAN_INFO_SCALE:
|
||||||
printk("IIO_CHAN_INFO_SCALE\n");
|
printk("IIO_CHAN_INFO_SCALE\n");
|
||||||
return IIO_VAL_FRACTIONAL_LOG2;
|
return IIO_VAL_FRACTIONAL_LOG2;
|
||||||
|
@ -188,7 +655,7 @@ static ssize_t nvt_adc_enable(struct device *dev,
|
||||||
ret = kstrtoul(buf, 10, &input);
|
ret = kstrtoul(buf, 10, &input);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
adc_set_enable(adc, input);
|
adc_set_enable(adc, input);
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
|
@ -408,6 +875,8 @@ static void nvt_adc_get_trimdata(struct nvt_adc_state *adc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
adc_trim = adc->cali_value;
|
||||||
|
//printk("adc_trim = %d \r\n",adc_trim);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -415,9 +884,15 @@ static int nvt_adc_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct iio_dev *iio;
|
struct iio_dev *iio;
|
||||||
struct nvt_adc_state *adc;
|
struct nvt_adc_state *adc;
|
||||||
int err = 0, irq;
|
int err = 0, irq , i=0;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
struct thermal_zone_device *thermal_zone = NULL;
|
struct thermal_zone_device *thermal_zone = NULL;
|
||||||
|
int ret_avg = 0;
|
||||||
|
struct proc_dir_entry *pentry = NULL;
|
||||||
|
|
||||||
|
union ADC_AIN0_DATA_REG data_reg;
|
||||||
|
union ADC_STATUS_REG sts_reg;
|
||||||
|
|
||||||
#ifdef CONFIG_OF
|
#ifdef CONFIG_OF
|
||||||
const struct of_device_id *of_id;
|
const struct of_device_id *of_id;
|
||||||
|
|
||||||
|
@ -426,19 +901,19 @@ static int nvt_adc_probe(struct platform_device *pdev)
|
||||||
dev_err(&pdev->dev, "[NVT ADC] OF not found\n");
|
dev_err(&pdev->dev, "[NVT ADC] OF not found\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//pr_info("%s %d: of_id->compatible = %s\n", __func__, __LINE__, of_id->compatible);
|
//pr_info("%s %d: of_id->compatible = %s\n", __func__, __LINE__, of_id->compatible);
|
||||||
#endif
|
#endif
|
||||||
|
printk("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
|
||||||
adc = kzalloc(sizeof(struct nvt_adc_state), GFP_KERNEL);
|
iio = iio_device_alloc(sizeof(struct nvt_adc_state) );
|
||||||
if (!adc)
|
if (!iio){
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
iio = iio_device_alloc(sizeof(*adc));
|
|
||||||
if (!iio)
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
adc = iio_priv(iio);
|
adc = iio_priv(iio);
|
||||||
|
if (!adc ){
|
||||||
|
err = -ENOMEM;
|
||||||
|
goto iio_free;
|
||||||
|
}
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
|
@ -450,6 +925,8 @@ static int nvt_adc_probe(struct platform_device *pdev)
|
||||||
if (!adc->base)
|
if (!adc->base)
|
||||||
goto iio_free;
|
goto iio_free;
|
||||||
|
|
||||||
|
adc_base = (u32)adc->base;
|
||||||
|
|
||||||
adc->clk = clk_get(&pdev->dev, dev_name(&pdev->dev));
|
adc->clk = clk_get(&pdev->dev, dev_name(&pdev->dev));
|
||||||
if (!IS_ERR(adc->clk)) {
|
if (!IS_ERR(adc->clk)) {
|
||||||
clk_prepare(adc->clk);
|
clk_prepare(adc->clk);
|
||||||
|
@ -485,7 +962,7 @@ static int nvt_adc_probe(struct platform_device *pdev)
|
||||||
adc->sample_rate = (clk_get_rate(adc->clk) / (2 * (nvt_adc_pow2div + 1))) / (4 * (26 + nvt_adc_plusdiv));
|
adc->sample_rate = (clk_get_rate(adc->clk) / (2 * (nvt_adc_pow2div + 1))) / (4 * (26 + nvt_adc_plusdiv));
|
||||||
|
|
||||||
adc_set_default_hw(adc);
|
adc_set_default_hw(adc);
|
||||||
|
|
||||||
iio->name = "nvt_adc";
|
iio->name = "nvt_adc";
|
||||||
iio->modes = INDIO_DIRECT_MODE;
|
iio->modes = INDIO_DIRECT_MODE;
|
||||||
iio->info = &nvt_adc_info;
|
iio->info = &nvt_adc_info;
|
||||||
|
@ -503,12 +980,83 @@ static int nvt_adc_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
pr_info("%s: %s done voltage %d ver %s\n", __func__, dev_name(&pdev->dev), adc->cali_value, DRV_VERSION);
|
pr_info("%s: %s done voltage %d ver %s\n", __func__, dev_name(&pdev->dev), adc->cali_value, DRV_VERSION);
|
||||||
|
|
||||||
|
udelay(30);
|
||||||
|
|
||||||
|
// if data ready
|
||||||
|
for( i = 0 ; i< 5 ; i++ ){
|
||||||
|
sts_reg.reg = adc_getreg(adc, ADC_STATUS_REG_OFS);
|
||||||
|
if(sts_reg.bit.ain0_datardy ==1 ){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
udelay(50);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i==5){
|
||||||
|
printk("\n adc ready timout !!\r\n");
|
||||||
|
}
|
||||||
|
data_reg.reg = adc_getreg(adc, ADC_AIN0_DATA_REG_OFS);
|
||||||
|
|
||||||
|
// read first value
|
||||||
|
adc_mid3_first = 0;
|
||||||
|
if ( avg_sel == 0 ){
|
||||||
|
adc_mid = data_reg.reg;
|
||||||
|
adc_mid_first = 1 ; // already get firstly value
|
||||||
|
adc_mid_val = adc_mid;
|
||||||
|
adc_mid_vol = (adc_mid +CALI_OFFSET)*adc_trim/511;
|
||||||
|
|
||||||
|
printk("adc_mid first value = %u\n", adc_mid_val);
|
||||||
|
|
||||||
|
}else if(avg_sel == 1 ) {
|
||||||
|
adc_mid1 = data_reg.reg;
|
||||||
|
adc_mid1_first = 1 ; // already get firstly value
|
||||||
|
adc_mid1_val = adc_mid1;
|
||||||
|
adc_mid1_vol = (adc_mid1 +CALI_OFFSET)*adc_trim/511;
|
||||||
|
|
||||||
|
printk("adc_mid1 first value = %u\n", adc_mid1_val);
|
||||||
|
|
||||||
|
}else if(avg_sel == 2 ) {
|
||||||
|
adc_mid2 = data_reg.reg;
|
||||||
|
adc_mid2_first = 1 ; // already get firstly value
|
||||||
|
adc_mid2_val = adc_mid2;
|
||||||
|
adc_mid2_vol = (adc_mid2 +CALI_OFFSET)*adc_trim/511;
|
||||||
|
|
||||||
|
printk("adc_mid2 first value = %u\n", adc_mid2_val);
|
||||||
|
|
||||||
|
}else if(avg_sel == 3 ) {
|
||||||
|
adc_mid3 = data_reg.reg;
|
||||||
|
// adc_mid3_first = 1 ; // already get firstly value
|
||||||
|
adc_mid3_val = adc_mid3;
|
||||||
|
adc_mid3_vol = (adc_mid3 +CALI_OFFSET)*adc_trim/511;
|
||||||
|
|
||||||
|
printk("adc_mid3 first value = %u\n", adc_mid3_val);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
// ADC Average data
|
||||||
|
/* tempeture compensation */
|
||||||
|
ret_avg = nvt_adc_read_avg_int();
|
||||||
|
|
||||||
|
if(ret_avg){
|
||||||
|
INIT_DELAYED_WORK(&adc->adc_avg_work, nvt_adc_read_avg);
|
||||||
|
schedule_delayed_work(&adc->adc_avg_work, msecs_to_jiffies(1));
|
||||||
|
}
|
||||||
|
|
||||||
|
pentry = proc_create("adc", 0, NULL, &proc_adc_fops);
|
||||||
|
if (pentry == NULL) {
|
||||||
|
dev_err(&pdev->dev, "failed to create adc proc!\n");
|
||||||
|
err = -EINVAL;
|
||||||
|
goto t_data_free;
|
||||||
|
}
|
||||||
|
adc->pproc_adc = pentry;
|
||||||
|
#endif
|
||||||
|
|
||||||
thermal_zone = thermal_zone_device_register("nvt_thermal", 0, 0,
|
thermal_zone = thermal_zone_device_register("nvt_thermal", 0, 0,
|
||||||
adc, &ops, NULL, 0, 0);
|
adc, &ops, NULL, 0, 0);
|
||||||
if (IS_ERR(thermal_zone)) {
|
if (IS_ERR(thermal_zone)) {
|
||||||
dev_err(&pdev->dev, "thermal zone device is NULL\n");
|
dev_err(&pdev->dev, "thermal zone device is NULL\n");
|
||||||
return PTR_ERR(thermal_zone);
|
err = PTR_ERR(thermal_zone);
|
||||||
|
goto t_data_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
thermal_get_trimdata(adc);
|
thermal_get_trimdata(adc);
|
||||||
|
@ -518,7 +1066,14 @@ static int nvt_adc_probe(struct platform_device *pdev)
|
||||||
platform_set_drvdata(pdev, thermal_zone);
|
platform_set_drvdata(pdev, thermal_zone);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
t_data_free:
|
||||||
|
cancel_delayed_work(&adc->adc_avg_work);
|
||||||
|
kfree(t_data);
|
||||||
|
kfree(t_data1);
|
||||||
|
kfree(t_data2);
|
||||||
|
kfree(t_data3);
|
||||||
|
|
||||||
iio_free:
|
iio_free:
|
||||||
iio_device_free(iio);
|
iio_device_free(iio);
|
||||||
|
|
||||||
|
@ -527,10 +1082,16 @@ iio_free:
|
||||||
|
|
||||||
static int nvt_adc_remove(struct platform_device *pdev)
|
static int nvt_adc_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct iio_dev *iio = platform_get_drvdata(pdev);;
|
struct iio_dev *iio = platform_get_drvdata(pdev);
|
||||||
|
struct nvt_adc_state *adc ;
|
||||||
|
|
||||||
|
adc = iio_priv(iio);
|
||||||
|
|
||||||
|
cancel_delayed_work(&adc->adc_avg_work);
|
||||||
iio_device_unregister(iio);
|
iio_device_unregister(iio);
|
||||||
iio_device_free(iio);
|
iio_device_free(iio);
|
||||||
|
remove_proc_entry("adc", NULL);
|
||||||
|
kfree(t_data);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,72 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
KERVER=`cat /proc/version | awk -F'version ' '{print $2}' | awk -F' ' '{print $1}'`
|
||||||
|
|
||||||
device_node_create()
|
device_node_create()
|
||||||
{
|
{
|
||||||
mknod /dev/$1 c `cat /sys/class/$1/$1/dev | sed "s/:/\ /g"`
|
mknod /dev/$1 c `cat /sys/class/$1/$1/dev | sed "s/:/\ /g"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
P_GPIO0=32
|
||||||
|
P_GPIO1=33
|
||||||
|
DELAY=0.003
|
||||||
|
|
||||||
|
echo ${P_GPIO0} > /sys/class/gpio/export
|
||||||
|
echo ${P_GPIO1} > /sys/class/gpio/export
|
||||||
|
|
||||||
|
sleep ${DELAY}
|
||||||
|
|
||||||
|
echo "out" > /sys/devices/gpiochip0/gpio/gpio${P_GPIO0}/direction
|
||||||
|
echo "out" > /sys/devices/gpiochip0/gpio/gpio${P_GPIO1}/direction
|
||||||
|
|
||||||
|
echo 1 > /sys/devices/gpiochip0/gpio/gpio${P_GPIO0}/value
|
||||||
|
echo 1 > /sys/devices/gpiochip0/gpio/gpio${P_GPIO1}/value
|
||||||
|
|
||||||
|
sleep ${DELAY}
|
||||||
|
|
||||||
|
echo "insert adc ko"
|
||||||
|
mem bit 0xF0020074 3 0
|
||||||
|
insmod /lib/modules/$KERVER/kernel/drivers/iio/industrialio.ko
|
||||||
|
insmod /lib/modules/$KERVER/kernel/drivers/iio/adc/nvt_adc.ko
|
||||||
|
mem bit 0xF0020074 3 1
|
||||||
|
|
||||||
# Setup mdev
|
# Setup mdev
|
||||||
echo "fs" > /proc/nvt_info/bootts
|
echo "fs" > /proc/nvt_info/bootts
|
||||||
echo "/sbin/mdev" > /proc/sys/kernel/hotplug
|
echo "/sbin/mdev" > /proc/sys/kernel/hotplug
|
||||||
#modprobe mmc_na51055
|
#modprobe mmc_na51055
|
||||||
|
|
||||||
|
if [ 1 ] ; then
|
||||||
|
|
||||||
|
sleep ${DELAY}
|
||||||
|
|
||||||
|
echo 0x5 > /proc/adc
|
||||||
|
cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw
|
||||||
|
echo 0x3 > /proc/adc
|
||||||
|
sleep ${DELAY}
|
||||||
|
|
||||||
|
echo 1 > /sys/devices/gpiochip0/gpio/gpio${P_GPIO0}/value
|
||||||
|
echo 0 > /sys/devices/gpiochip0/gpio/gpio${P_GPIO1}/value
|
||||||
|
sleep ${DELAY}
|
||||||
|
cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw
|
||||||
|
echo 0x1 > /proc/adc
|
||||||
|
sleep ${DELAY}
|
||||||
|
|
||||||
|
echo 0 > /sys/devices/gpiochip0/gpio/gpio${P_GPIO0}/value
|
||||||
|
echo 0 > /sys/devices/gpiochip0/gpio/gpio${P_GPIO1}/value
|
||||||
|
sleep ${DELAY}
|
||||||
|
cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw
|
||||||
|
echo 0x0 > /proc/adc
|
||||||
|
sleep ${DELAY}
|
||||||
|
|
||||||
|
echo 0 > /sys/devices/gpiochip0/gpio/gpio${P_GPIO0}/value
|
||||||
|
echo 1 > /sys/devices/gpiochip0/gpio/gpio${P_GPIO1}/value
|
||||||
|
sleep ${DELAY}
|
||||||
|
echo 0x2 > /proc/adc
|
||||||
|
sleep ${DELAY}
|
||||||
|
cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
mdev -s
|
mdev -s
|
||||||
|
|
||||||
# Scan for without insert card
|
# Scan for without insert card
|
||||||
|
|
|
@ -132,13 +132,13 @@ fi
|
||||||
|
|
||||||
#iio & adc (for keyscan)
|
#iio & adc (for keyscan)
|
||||||
|
|
||||||
if [[ -f ${PREFIX}/lib/modules/$KERVER/kernel/drivers/iio/industrialio.ko ]]; then
|
#if [[ -f ${PREFIX}/lib/modules/$KERVER/kernel/drivers/iio/industrialio.ko ]]; then
|
||||||
insmod ${PREFIX}/lib/modules/$KERVER/kernel/drivers/iio/industrialio.ko
|
#insmod ${PREFIX}/lib/modules/$KERVER/kernel/drivers/iio/industrialio.ko
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
if [[ -f ${PREFIX}/lib/modules/$KERVER/kernel/drivers/iio/adc/nvt_adc.ko ]]; then
|
#if [[ -f ${PREFIX}/lib/modules/$KERVER/kernel/drivers/iio/adc/nvt_adc.ko ]]; then
|
||||||
insmod ${PREFIX}/lib/modules/$KERVER/kernel/drivers/iio/adc/nvt_adc.ko
|
#insmod ${PREFIX}/lib/modules/$KERVER/kernel/drivers/iio/adc/nvt_adc.ko
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
#usb
|
#usb
|
||||||
#if [[ -f ${PREFIX}/lib/modules/$KERVER/hdal/comm/uvcp/nvt_uvcp.ko ]]; then
|
#if [[ -f ${PREFIX}/lib/modules/$KERVER/hdal/comm/uvcp/nvt_uvcp.ko ]]; then
|
||||||
|
|
|
@ -1,14 +1,72 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
KERVER=`cat /proc/version | awk -F'version ' '{print $2}' | awk -F' ' '{print $1}'`
|
||||||
|
|
||||||
device_node_create()
|
device_node_create()
|
||||||
{
|
{
|
||||||
mknod /dev/$1 c `cat /sys/class/$1/$1/dev | sed "s/:/\ /g"`
|
mknod /dev/$1 c `cat /sys/class/$1/$1/dev | sed "s/:/\ /g"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
P_GPIO0=32
|
||||||
|
P_GPIO1=33
|
||||||
|
DELAY=0.003
|
||||||
|
|
||||||
|
echo ${P_GPIO0} > /sys/class/gpio/export
|
||||||
|
echo ${P_GPIO1} > /sys/class/gpio/export
|
||||||
|
|
||||||
|
sleep ${DELAY}
|
||||||
|
|
||||||
|
echo "out" > /sys/devices/gpiochip0/gpio/gpio${P_GPIO0}/direction
|
||||||
|
echo "out" > /sys/devices/gpiochip0/gpio/gpio${P_GPIO1}/direction
|
||||||
|
|
||||||
|
echo 1 > /sys/devices/gpiochip0/gpio/gpio${P_GPIO0}/value
|
||||||
|
echo 1 > /sys/devices/gpiochip0/gpio/gpio${P_GPIO1}/value
|
||||||
|
|
||||||
|
sleep ${DELAY}
|
||||||
|
|
||||||
|
echo "insert adc ko"
|
||||||
|
mem bit 0xF0020074 3 0
|
||||||
|
insmod /lib/modules/$KERVER/kernel/drivers/iio/industrialio.ko
|
||||||
|
insmod /lib/modules/$KERVER/kernel/drivers/iio/adc/nvt_adc.ko
|
||||||
|
mem bit 0xF0020074 3 1
|
||||||
|
|
||||||
# Setup mdev
|
# Setup mdev
|
||||||
echo "fs" > /proc/nvt_info/bootts
|
echo "fs" > /proc/nvt_info/bootts
|
||||||
echo "/sbin/mdev" > /proc/sys/kernel/hotplug
|
echo "/sbin/mdev" > /proc/sys/kernel/hotplug
|
||||||
#modprobe mmc_na51055
|
#modprobe mmc_na51055
|
||||||
|
|
||||||
|
if [ 1 ] ; then
|
||||||
|
|
||||||
|
sleep ${DELAY}
|
||||||
|
|
||||||
|
echo 0x5 > /proc/adc
|
||||||
|
cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw
|
||||||
|
echo 0x3 > /proc/adc
|
||||||
|
sleep ${DELAY}
|
||||||
|
|
||||||
|
echo 1 > /sys/devices/gpiochip0/gpio/gpio${P_GPIO0}/value
|
||||||
|
echo 0 > /sys/devices/gpiochip0/gpio/gpio${P_GPIO1}/value
|
||||||
|
sleep ${DELAY}
|
||||||
|
cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw
|
||||||
|
echo 0x1 > /proc/adc
|
||||||
|
sleep ${DELAY}
|
||||||
|
|
||||||
|
echo 0 > /sys/devices/gpiochip0/gpio/gpio${P_GPIO0}/value
|
||||||
|
echo 0 > /sys/devices/gpiochip0/gpio/gpio${P_GPIO1}/value
|
||||||
|
sleep ${DELAY}
|
||||||
|
cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw
|
||||||
|
echo 0x0 > /proc/adc
|
||||||
|
sleep ${DELAY}
|
||||||
|
|
||||||
|
echo 0 > /sys/devices/gpiochip0/gpio/gpio${P_GPIO0}/value
|
||||||
|
echo 1 > /sys/devices/gpiochip0/gpio/gpio${P_GPIO1}/value
|
||||||
|
sleep ${DELAY}
|
||||||
|
echo 0x2 > /proc/adc
|
||||||
|
sleep ${DELAY}
|
||||||
|
cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
mdev -s
|
mdev -s
|
||||||
|
|
||||||
# Scan for without insert card
|
# Scan for without insert card
|
||||||
|
|
|
@ -99,6 +99,8 @@ insmod ${PREFIX}/lib/modules/$KERVER/hdal/kflow_audiocapture/unit/kflow_audiocap
|
||||||
insmod ${PREFIX}/lib/modules/$KERVER/hdal/kflow_audioout/unit/kflow_audioout.ko
|
insmod ${PREFIX}/lib/modules/$KERVER/hdal/kflow_audioout/unit/kflow_audioout.ko
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
insmod /lib/modules/$KERVER/hdal/kdrv_audioio/audlib_anr/nvt_audlib_anr.ko
|
||||||
|
|
||||||
insmod ${PREFIX}/lib/modules/$KERVER/hdal/kdrv_audioio/audlib_aac/nvt_audlib_aac.ko
|
insmod ${PREFIX}/lib/modules/$KERVER/hdal/kdrv_audioio/audlib_aac/nvt_audlib_aac.ko
|
||||||
|
|
||||||
# isf audenc
|
# isf audenc
|
||||||
|
@ -132,13 +134,13 @@ fi
|
||||||
|
|
||||||
#iio & adc (for keyscan)
|
#iio & adc (for keyscan)
|
||||||
|
|
||||||
if [[ -f ${PREFIX}/lib/modules/$KERVER/kernel/drivers/iio/industrialio.ko ]]; then
|
#if [[ -f ${PREFIX}/lib/modules/$KERVER/kernel/drivers/iio/industrialio.ko ]]; then
|
||||||
insmod ${PREFIX}/lib/modules/$KERVER/kernel/drivers/iio/industrialio.ko
|
#insmod ${PREFIX}/lib/modules/$KERVER/kernel/drivers/iio/industrialio.ko
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
if [[ -f ${PREFIX}/lib/modules/$KERVER/kernel/drivers/iio/adc/nvt_adc.ko ]]; then
|
#if [[ -f ${PREFIX}/lib/modules/$KERVER/kernel/drivers/iio/adc/nvt_adc.ko ]]; then
|
||||||
insmod ${PREFIX}/lib/modules/$KERVER/kernel/drivers/iio/adc/nvt_adc.ko
|
#insmod ${PREFIX}/lib/modules/$KERVER/kernel/drivers/iio/adc/nvt_adc.ko
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
#usb
|
#usb
|
||||||
#if [[ -f ${PREFIX}/lib/modules/$KERVER/hdal/comm/uvcp/nvt_uvcp.ko ]]; then
|
#if [[ -f ${PREFIX}/lib/modules/$KERVER/hdal/comm/uvcp/nvt_uvcp.ko ]]; then
|
||||||
|
|
|
@ -82,3 +82,4 @@ alias stampsw='cardv sys stampsw'
|
||||||
alias gprssw='cardv sys gprssw'
|
alias gprssw='cardv sys gprssw'
|
||||||
alias multiintevel='cardv sys multiintevel'
|
alias multiintevel='cardv sys multiintevel'
|
||||||
alias blusw='cardv sys blusw'
|
alias blusw='cardv sys blusw'
|
||||||
|
alias wifisw='cardv sys wifisw'
|
||||||
|
|
5
BSP/u-boot/.gitignore
vendored
5
BSP/u-boot/.gitignore
vendored
|
@ -41,4 +41,7 @@ u-boot.cfg
|
||||||
u-boot.lds
|
u-boot.lds
|
||||||
u-boot.lz.bin
|
u-boot.lz.bin
|
||||||
u-boot.lzma.bin
|
u-boot.lzma.bin
|
||||||
u-boot.srec
|
u-boot.srec
|
||||||
|
include/bmp_logo.h
|
||||||
|
include/bmp_logo_data.h
|
||||||
|
tools/bmp_logo
|
|
@ -178,7 +178,8 @@ CONFIG_NVT_IVOT_DEBUG_LEVEL=7
|
||||||
# CONFIG_NVT_IVOT_OPTEE_SUPPORT is not set
|
# CONFIG_NVT_IVOT_OPTEE_SUPPORT is not set
|
||||||
# CONFIG_NVT_IVOT_TZPC_SUPPORT is not set
|
# CONFIG_NVT_IVOT_TZPC_SUPPORT is not set
|
||||||
# CONFIG_NVT_IVOT_DDR_RANGE_SCAN_SUPPORT is not set
|
# CONFIG_NVT_IVOT_DDR_RANGE_SCAN_SUPPORT is not set
|
||||||
# CONFIG_VIDEO_LOGO is not set
|
CONFIG_VIDEO_LOGO=y
|
||||||
|
CONFIG_NVT_DISPLAY_BAR_FWUPDATE=y
|
||||||
# CONFIG_NVT_IVOT_CRYPTO_CMD is not set
|
# CONFIG_NVT_IVOT_CRYPTO_CMD is not set
|
||||||
# CONFIG_NVT_IVOT_HASH_CMD is not set
|
# CONFIG_NVT_IVOT_HASH_CMD is not set
|
||||||
# CONFIG_NVT_IVOT_RSA_CMD is not set
|
# CONFIG_NVT_IVOT_RSA_CMD is not set
|
||||||
|
|
|
@ -970,6 +970,10 @@
|
||||||
#define SF_CAM_UP_FILE_PATH "/mnt/sd/S530.tar.bz2"
|
#define SF_CAM_UP_FILE_PATH "/mnt/sd/S530.tar.bz2"
|
||||||
#define SF_CAMERA_GPS_INFO_FILENAME SF_SD_ROOT"/gps.txt"
|
#define SF_CAMERA_GPS_INFO_FILENAME SF_SD_ROOT"/gps.txt"
|
||||||
#define SF_UBOOT_UPDATA_FW ENABLE
|
#define SF_UBOOT_UPDATA_FW ENABLE
|
||||||
|
|
||||||
|
#ifndef ANR_FUNC
|
||||||
|
#define ANR_FUNC ENABLE
|
||||||
|
#endif
|
||||||
//////////////////////sf end///////////////////////////////
|
//////////////////////sf end///////////////////////////////
|
||||||
|
|
||||||
/*******************************************************************************************
|
/*******************************************************************************************
|
||||||
|
|
|
@ -244,6 +244,7 @@ INT32 System_OnBoot(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
|
||||||
|
|
||||||
#if HUNTING_CAMERA_MCU == ENABLE
|
#if HUNTING_CAMERA_MCU == ENABLE
|
||||||
sf_cardv_para_check_start();
|
sf_cardv_para_check_start();
|
||||||
|
sf_cardv_wifi_start();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (UCTRL_FUNC)
|
#if (UCTRL_FUNC)
|
||||||
|
|
|
@ -262,6 +262,7 @@ SXCMD_ITEM("sf_sw_esim %", sf_cmd_switch_esim, "sf_switch_esim")
|
||||||
SXCMD_ITEM("gprssw %", sf_cmd_gprs_switch, "gprssw 0/1")
|
SXCMD_ITEM("gprssw %", sf_cmd_gprs_switch, "gprssw 0/1")
|
||||||
SXCMD_ITEM("uiprint %", sf_cmd_para_printf, "uiprint")
|
SXCMD_ITEM("uiprint %", sf_cmd_para_printf, "uiprint")
|
||||||
SXCMD_ITEM("blusw %", cmd_blu_switch, "blusw 0/1")
|
SXCMD_ITEM("blusw %", cmd_blu_switch, "blusw 0/1")
|
||||||
|
SXCMD_ITEM("wifisw %", cmd_wifi_switch, "wifisw 0/1")
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -151,6 +151,7 @@ static BOOL System_InsmodUsb(BOOL isHost)
|
||||||
|
|
||||||
if(isHost == FALSE){
|
if(isHost == FALSE){
|
||||||
#if HUNTING_CAMERA_MCU == ENABLE
|
#if HUNTING_CAMERA_MCU == ENABLE
|
||||||
|
sf_set_msdc_clk();
|
||||||
sf_usb_mux_s(0);
|
sf_usb_mux_s(0);
|
||||||
vos_util_delay_ms(200);
|
vos_util_delay_ms(200);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2132,6 +2132,17 @@ INT32 MovieExe_OnOpen(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
|
||||||
ImageApp_MovieMulti_SetParam(_CFG_REC_ID_1, MOVIEMULTI_PARAM_FILE_CB_CLOSED_FILE_INFO, TRUE);
|
ImageApp_MovieMulti_SetParam(_CFG_REC_ID_1, MOVIEMULTI_PARAM_FILE_CB_CLOSED_FILE_INFO, TRUE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (ANR_FUNC == ENABLE)
|
||||||
|
HD_AUDIOCAP_ANR audio_cfg_param = {0};
|
||||||
|
|
||||||
|
// set audio ANR function parameter
|
||||||
|
audio_cfg_param.enabled = TRUE;
|
||||||
|
audio_cfg_param.suppress_level = 13;
|
||||||
|
audio_cfg_param.hpf_cut_off_freq = 200;
|
||||||
|
audio_cfg_param.bias_sensitive = 9;
|
||||||
|
|
||||||
|
ImageApp_MovieMulti_SetParam(_CFG_REC_ID_1, MOVIEMULTI_PARAM_AUD_ACAP_ANR, (UINT32)&audio_cfg_param);
|
||||||
|
#endif
|
||||||
|
|
||||||
ImageApp_MovieMulti_Open();
|
ImageApp_MovieMulti_Open();
|
||||||
#if 0
|
#if 0
|
||||||
|
|
|
@ -692,7 +692,8 @@ UINT32 PhotoExe_GetFreePicNum(void)
|
||||||
UINT64 uiFreeSpace;
|
UINT64 uiFreeSpace;
|
||||||
UINT32 uiMaxImageSize;
|
UINT32 uiMaxImageSize;
|
||||||
UINT32 freeImgNum;
|
UINT32 freeImgNum;
|
||||||
UINT32 reserveSize = 0x80000; // 500KB
|
// UINT32 reserveSize = 0x80000; // 500KB
|
||||||
|
UINT32 reserveSize = 0x1e00000; // 30MB
|
||||||
UINT32 CaptureSize;
|
UINT32 CaptureSize;
|
||||||
UINT32 size;
|
UINT32 size;
|
||||||
|
|
||||||
|
@ -1708,7 +1709,7 @@ void PhotoExe_CommPoolInit(void)
|
||||||
// #else
|
// #else
|
||||||
// g_photo_mem_cfg.pool_info[id].blk_cnt = 8;
|
// g_photo_mem_cfg.pool_info[id].blk_cnt = 8;
|
||||||
// #endif
|
// #endif
|
||||||
g_photo_mem_cfg.pool_info[id].blk_cnt = 4;
|
g_photo_mem_cfg.pool_info[id].blk_cnt = 6;
|
||||||
g_photo_mem_cfg.pool_info[id].ddr_id = DDR_ID0;
|
g_photo_mem_cfg.pool_info[id].ddr_id = DDR_ID0;
|
||||||
|
|
||||||
// config common pool (wifi)
|
// config common pool (wifi)
|
||||||
|
@ -2866,12 +2867,14 @@ INT32 PhotoExe_OnEV(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
|
||||||
INT32 PhotoExe_OnCaptureSize(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
|
INT32 PhotoExe_OnCaptureSize(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
|
||||||
{
|
{
|
||||||
UINT32 uhSelect = 0;
|
UINT32 uhSelect = 0;
|
||||||
DBG_IND("%d \r\n", paramArray[0]);
|
DBG_DUMP("PhotoExe_OnCaptureSize %d \r\n", paramArray[0]);
|
||||||
|
|
||||||
if (paramNum > 0) {
|
if (paramNum > 0) {
|
||||||
uhSelect = paramArray[0];
|
uhSelect = paramArray[0];
|
||||||
}
|
}
|
||||||
UI_SetData(FL_PHOTO_SIZE, uhSelect);
|
|
||||||
|
// uhSelect = PHOTO_SIZE_40M;
|
||||||
|
// UI_SetData(FL_PHOTO_SIZE, uhSelect);
|
||||||
Photo_SetUserIndex(PHOTO_USR_SIZE, uhSelect);
|
Photo_SetUserIndex(PHOTO_USR_SIZE, uhSelect);
|
||||||
DBG_IND("photo capture size %d\r\n", uhSelect);
|
DBG_IND("photo capture size %d\r\n", uhSelect);
|
||||||
return NVTEVT_CONSUME;
|
return NVTEVT_CONSUME;
|
||||||
|
@ -4466,8 +4469,11 @@ static INT32 PhotoExe_Preview_SliceEncode_Get_Curr_Dst_Slice_Info(PhotoExe_Slice
|
||||||
else{
|
else{
|
||||||
PHOTO_SLICE_ENC_DUMP("cap_size = %lu buf_size = %lu\n", cap_size, buf_size);
|
PHOTO_SLICE_ENC_DUMP("cap_size = %lu buf_size = %lu\n", cap_size, buf_size);
|
||||||
|
|
||||||
UINT32 lines = (buf_size / cap_size_w);
|
// UINT32 lines = (buf_size / cap_size_w);
|
||||||
max_slice_num = cap_size_h / lines + (cap_size_h % lines ? 1 : 0);
|
// max_slice_num = cap_size_h / lines + (cap_size_h % lines ? 1 : 0);
|
||||||
|
UINT32 lines = (buf_size / cap_size_w);
|
||||||
|
UINT32 slice_height = ALIGN_CEIL(lines, 16);
|
||||||
|
max_slice_num = (cap_size_h / slice_height) + (cap_size_h % slice_height ? 1 : 0);
|
||||||
|
|
||||||
UINT32 tmp_src_h = src_frame.dim.h / 2;
|
UINT32 tmp_src_h = src_frame.dim.h / 2;
|
||||||
UINT32 tmp_dst_h = cap_size_h / 16;
|
UINT32 tmp_dst_h = cap_size_h / 16;
|
||||||
|
@ -4537,8 +4543,11 @@ static INT32 PhotoExe_Preview_SliceEncode_Get_Max_Dst_Slice_Info(PhotoExe_SliceS
|
||||||
else{
|
else{
|
||||||
PHOTO_SLICE_ENC_DUMP("cap_size = %lu buf_size = %lu\n", tmp_cap_size.w * tmp_cap_size.h, buf_size);
|
PHOTO_SLICE_ENC_DUMP("cap_size = %lu buf_size = %lu\n", tmp_cap_size.w * tmp_cap_size.h, buf_size);
|
||||||
|
|
||||||
UINT32 lines = (buf_size / tmp_cap_size.w);
|
// UINT32 lines = (buf_size / tmp_cap_size.w);
|
||||||
max_slice_num = tmp_cap_size.h / lines + (tmp_cap_size.h % lines ? 1 : 0);
|
// max_slice_num = tmp_cap_size.h / lines + (tmp_cap_size.h % lines ? 1 : 0);
|
||||||
|
UINT32 lines = (buf_size / tmp_cap_size.w);
|
||||||
|
UINT32 slice_height = ALIGN_CEIL(lines, 16);
|
||||||
|
max_slice_num = (tmp_cap_size.h / slice_height) + (tmp_cap_size.h % slice_height ? 1 : 0);
|
||||||
|
|
||||||
UINT32 tmp_src_h = sensor_info->sSize.h / 2;
|
UINT32 tmp_src_h = sensor_info->sSize.h / 2;
|
||||||
UINT32 tmp_dst_h = tmp_cap_size.h / 16;
|
UINT32 tmp_dst_h = tmp_cap_size.h / 16;
|
||||||
|
@ -5734,7 +5743,6 @@ static INT32 PhotoExe_Preview_SliceEncode_Encode_Primary(
|
||||||
|
|
||||||
/* check restart */
|
/* check restart */
|
||||||
if(restart == FALSE){
|
if(restart == FALSE){
|
||||||
CHKPNT;
|
|
||||||
ret = HD_ERR_SYS;
|
ret = HD_ERR_SYS;
|
||||||
goto EXIT;
|
goto EXIT;
|
||||||
}
|
}
|
||||||
|
@ -5933,15 +5941,6 @@ INT32 PhotoExe_Preview_SliceEncode(VControl *pCtrl, UINT32 paramNum, UINT32 *par
|
||||||
Ux_SendEvent(&CustomPhotoObjCtrl, NVTEVT_EXE_INIT_DATE_BUF, 0);
|
Ux_SendEvent(&CustomPhotoObjCtrl, NVTEVT_EXE_INIT_DATE_BUF, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if PHOTO_PREVIEW_SLICE_ENC_SRC_STAMP == ENABLE
|
|
||||||
/*******************************************************************
|
|
||||||
* Stamp on the src frame
|
|
||||||
******************************************************************/
|
|
||||||
if(PhotoExe_Preview_SliceEncode_Src_DateStamp(&video_frame, &src_slice_info, &dst_slice_info) != E_OK){
|
|
||||||
goto EXIT;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if PHOTO_SLICE_ENC_DBG_PRIMARY_YUV
|
#if PHOTO_SLICE_ENC_DBG_PRIMARY_YUV
|
||||||
|
|
||||||
PhotoExe_Preview_SliceEncode_Dump_Frame(video_frame);
|
PhotoExe_Preview_SliceEncode_Dump_Frame(video_frame);
|
||||||
|
@ -5987,6 +5986,10 @@ INT32 PhotoExe_Preview_SliceEncode(VControl *pCtrl, UINT32 paramNum, UINT32 *par
|
||||||
goto EXIT;
|
goto EXIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(PhotoExe_Preview_SliceEncode_DateStamp(&video_frame_out_screennail, CAP_DS_EVENT_SCR) != E_OK){
|
||||||
|
goto EXIT;
|
||||||
|
}
|
||||||
|
|
||||||
SLICE_ENC_VOS_TICK_TRIG(SLICE_ENC_VOS_TICK_SCR_SCALE_E);
|
SLICE_ENC_VOS_TICK_TRIG(SLICE_ENC_VOS_TICK_SCR_SCALE_E);
|
||||||
|
|
||||||
/* thumbnail scale, 2pass from screennail */
|
/* thumbnail scale, 2pass from screennail */
|
||||||
|
@ -6001,11 +6004,11 @@ INT32 PhotoExe_Preview_SliceEncode(VControl *pCtrl, UINT32 paramNum, UINT32 *par
|
||||||
/* screennail date stamp */
|
/* screennail date stamp */
|
||||||
SLICE_ENC_VOS_TICK_TRIG(SLICE_ENC_VOS_TICK_THUMB_STAMP_S);
|
SLICE_ENC_VOS_TICK_TRIG(SLICE_ENC_VOS_TICK_THUMB_STAMP_S);
|
||||||
|
|
||||||
#if PHOTO_PREVIEW_SLICE_ENC_SRC_STAMP == DISABLE
|
//#if PHOTO_PREVIEW_SLICE_ENC_SRC_STAMP == DISABLE
|
||||||
if(PhotoExe_Preview_SliceEncode_DateStamp(&video_frame_out_screennail, CAP_DS_EVENT_SCR) != E_OK){
|
// if(PhotoExe_Preview_SliceEncode_DateStamp(&video_frame_out_screennail, CAP_DS_EVENT_SCR) != E_OK){
|
||||||
goto EXIT;
|
// goto EXIT;
|
||||||
}
|
// }
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
SLICE_ENC_VOS_TICK_TRIG(SLICE_ENC_VOS_TICK_THUMB_STAMP_E);
|
SLICE_ENC_VOS_TICK_TRIG(SLICE_ENC_VOS_TICK_THUMB_STAMP_E);
|
||||||
|
|
||||||
|
@ -6018,6 +6021,16 @@ INT32 PhotoExe_Preview_SliceEncode(VControl *pCtrl, UINT32 paramNum, UINT32 *par
|
||||||
|
|
||||||
SLICE_ENC_VOS_TICK_TRIG(SLICE_ENC_VOS_TICK_QVIEW_E);
|
SLICE_ENC_VOS_TICK_TRIG(SLICE_ENC_VOS_TICK_QVIEW_E);
|
||||||
|
|
||||||
|
|
||||||
|
#if PHOTO_PREVIEW_SLICE_ENC_SRC_STAMP == ENABLE
|
||||||
|
/*******************************************************************
|
||||||
|
* Stamp on the src frame
|
||||||
|
******************************************************************/
|
||||||
|
if(PhotoExe_Preview_SliceEncode_Src_DateStamp(&video_frame, &src_slice_info, &dst_slice_info) != E_OK){
|
||||||
|
goto EXIT;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
* Primary
|
* Primary
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
|
@ -6457,7 +6470,6 @@ INT32 PhotoExe_Preview_SliceEncode_CB2(void* user_data)
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
slice_encode_thumbnail_info->bs_buf_mem_info.blk_size = (CFG_THUMBNAIL_W * CFG_THUMBNAIL_H) / 2;
|
slice_encode_thumbnail_info->bs_buf_mem_info.blk_size = (CFG_THUMBNAIL_W * CFG_THUMBNAIL_H) / 2;
|
||||||
if(PhotoExe_Preview_SliceEncode_Alloc_Buffer(&slice_encode_thumbnail_info->bs_buf_mem_info, "slice_enc_thumbnail") != E_OK){
|
if(PhotoExe_Preview_SliceEncode_Alloc_Buffer(&slice_encode_thumbnail_info->bs_buf_mem_info, "slice_enc_thumbnail") != E_OK){
|
||||||
CHKPNT;
|
|
||||||
goto EXIT;
|
goto EXIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6468,7 +6480,6 @@ INT32 PhotoExe_Preview_SliceEncode_CB2(void* user_data)
|
||||||
|
|
||||||
exif_mem_info.blk_size = CFG_JPG_HEADER_SIZE;
|
exif_mem_info.blk_size = CFG_JPG_HEADER_SIZE;
|
||||||
if(PhotoExe_Preview_SliceEncode_Alloc_Buffer(&exif_mem_info, "slice_enc_exif") != E_OK){
|
if(PhotoExe_Preview_SliceEncode_Alloc_Buffer(&exif_mem_info, "slice_enc_exif") != E_OK){
|
||||||
CHKPNT;
|
|
||||||
goto EXIT;
|
goto EXIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6492,7 +6503,6 @@ INT32 PhotoExe_Preview_SliceEncode_CB2(void* user_data)
|
||||||
* Calculate dst slice info
|
* Calculate dst slice info
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
if(PhotoExe_Preview_SliceEncode_Get_Curr_Dst_Slice_Info(&dst_slice_info, queue_ele_in->frame) != E_OK){
|
if(PhotoExe_Preview_SliceEncode_Get_Curr_Dst_Slice_Info(&dst_slice_info, queue_ele_in->frame) != E_OK){
|
||||||
CHKPNT;
|
|
||||||
goto EXIT;
|
goto EXIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6501,15 +6511,6 @@ INT32 PhotoExe_Preview_SliceEncode_CB2(void* user_data)
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
PhotoExe_Preview_SliceEncode_Get_Src_Slice_Info(&dst_slice_info, &src_slice_info, queue_ele_in->frame);
|
PhotoExe_Preview_SliceEncode_Get_Src_Slice_Info(&dst_slice_info, &src_slice_info, queue_ele_in->frame);
|
||||||
|
|
||||||
#if PHOTO_PREVIEW_SLICE_ENC_SRC_STAMP == ENABLE
|
|
||||||
/*******************************************************************
|
|
||||||
* Stamp on the src frame
|
|
||||||
******************************************************************/
|
|
||||||
if(PhotoExe_Preview_SliceEncode_Src_DateStamp(&queue_ele_in->frame, &src_slice_info, &dst_slice_info) != E_OK){
|
|
||||||
goto EXIT;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if PHOTO_SLICE_ENC_DBG_PRIMARY_YUV
|
#if PHOTO_SLICE_ENC_DBG_PRIMARY_YUV
|
||||||
|
|
||||||
PhotoExe_Preview_SliceEncode_Dump_Frame(queue_ele_in->frame);
|
PhotoExe_Preview_SliceEncode_Dump_Frame(queue_ele_in->frame);
|
||||||
|
@ -6536,7 +6537,7 @@ INT32 PhotoExe_Preview_SliceEncode_CB2(void* user_data)
|
||||||
goto EXIT;
|
goto EXIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
* Screennail & Thumbnail Scale
|
* Screennail & Thumbnail Scale
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
|
|
||||||
|
@ -6545,6 +6546,10 @@ INT32 PhotoExe_Preview_SliceEncode_CB2(void* user_data)
|
||||||
goto EXIT;
|
goto EXIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(PhotoExe_Preview_SliceEncode_DateStamp(&video_frame_out_screennail, CAP_DS_EVENT_SCR) != E_OK){
|
||||||
|
goto EXIT;
|
||||||
|
}
|
||||||
|
|
||||||
/* thumbnail scale, 2pass from screennail */
|
/* thumbnail scale, 2pass from screennail */
|
||||||
if(PhotoExe_Preview_SliceEncode_Scale_Thumbnail(&video_frame_out_screennail, &video_frame_out_thumbnail) != E_OK){
|
if(PhotoExe_Preview_SliceEncode_Scale_Thumbnail(&video_frame_out_screennail, &video_frame_out_thumbnail) != E_OK){
|
||||||
goto EXIT;
|
goto EXIT;
|
||||||
|
@ -6561,6 +6566,17 @@ INT32 PhotoExe_Preview_SliceEncode_CB2(void* user_data)
|
||||||
// goto EXIT;
|
// goto EXIT;
|
||||||
// }
|
// }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if PHOTO_PREVIEW_SLICE_ENC_SRC_STAMP == ENABLE
|
||||||
|
/*******************************************************************
|
||||||
|
* Stamp on the src frame
|
||||||
|
******************************************************************/
|
||||||
|
if(PhotoExe_Preview_SliceEncode_Src_DateStamp(&queue_ele_in->frame, &src_slice_info, &dst_slice_info) != E_OK){
|
||||||
|
goto EXIT;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
* Primary
|
* Primary
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
|
@ -6570,7 +6586,6 @@ INT32 PhotoExe_Preview_SliceEncode_CB2(void* user_data)
|
||||||
PhotoExe_Preview_SliceEncode_Encode_Set_Out(slice_encode_primary_info->enc_path_id, primary_quality);
|
PhotoExe_Preview_SliceEncode_Encode_Set_Out(slice_encode_primary_info->enc_path_id, primary_quality);
|
||||||
|
|
||||||
if(PhotoExe_Preview_SliceEncode_Encode_Primary(&queue_ele_in->frame, src_slice_info, dst_slice_info, &enc_accum_size, &primary_quality) != E_OK){
|
if(PhotoExe_Preview_SliceEncode_Encode_Primary(&queue_ele_in->frame, src_slice_info, dst_slice_info, &enc_accum_size, &primary_quality) != E_OK){
|
||||||
CHKPNT;
|
|
||||||
goto EXIT;
|
goto EXIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6592,14 +6607,12 @@ INT32 PhotoExe_Preview_SliceEncode_CB2(void* user_data)
|
||||||
|
|
||||||
#if CFG_JPG_PREVIEW_SLICE_ENC_RC_SCREENNAIL
|
#if CFG_JPG_PREVIEW_SLICE_ENC_RC_SCREENNAIL
|
||||||
if(PhotoExe_Preview_SliceEncode_Encode_Screennail_RC(&video_frame_out_screennail, &screennail_quality) != E_OK){
|
if(PhotoExe_Preview_SliceEncode_Encode_Screennail_RC(&video_frame_out_screennail, &screennail_quality) != E_OK){
|
||||||
CHKPNT;
|
|
||||||
goto EXIT;
|
goto EXIT;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
PhotoExe_Preview_SliceEncode_Encode_Set_Out(slice_encode_screennail_info->enc_path_id, CFG_JPG_PREVIEW_SLICE_ENC_INIT_QUALITY_SCREENNAIL);
|
PhotoExe_Preview_SliceEncode_Encode_Set_Out(slice_encode_screennail_info->enc_path_id, CFG_JPG_PREVIEW_SLICE_ENC_INIT_QUALITY_SCREENNAIL);
|
||||||
|
|
||||||
if(PhotoExe_Preview_SliceEncode_Encode_Screennail(&video_frame_out_screennail) != E_OK){
|
if(PhotoExe_Preview_SliceEncode_Encode_Screennail(&video_frame_out_screennail) != E_OK){
|
||||||
CHKPNT;
|
|
||||||
goto EXIT;
|
goto EXIT;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -6609,7 +6622,6 @@ INT32 PhotoExe_Preview_SliceEncode_CB2(void* user_data)
|
||||||
PhotoExe_Preview_SliceEncode_Encode_Set_Out(slice_encode_thumbnail_info->enc_path_id, CFG_JPG_PREVIEW_SLICE_ENC_INIT_QUALITY_THUMBNAIL);
|
PhotoExe_Preview_SliceEncode_Encode_Set_Out(slice_encode_thumbnail_info->enc_path_id, CFG_JPG_PREVIEW_SLICE_ENC_INIT_QUALITY_THUMBNAIL);
|
||||||
|
|
||||||
if(PhotoExe_Preview_SliceEncode_Encode_Thumbnail(&video_frame_out_thumbnail) != E_OK){
|
if(PhotoExe_Preview_SliceEncode_Encode_Thumbnail(&video_frame_out_thumbnail) != E_OK){
|
||||||
CHKPNT;
|
|
||||||
goto EXIT;
|
goto EXIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -473,11 +473,10 @@ char * UiDateImprint_InitStrBuf(void)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DATEIMPRINT_DATE_TIME:
|
case DATEIMPRINT_DATE_TIME:
|
||||||
|
default:
|
||||||
dateStr = DateTime_MakeYMDHMS();
|
dateStr = DateTime_MakeYMDHMS();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -853,21 +852,21 @@ void UiDateImprint_ChkUpdateData(DATE_IMPRINT_INFO *pInfo)
|
||||||
DBG_IND("event=%d, bScreenNailEn=%d, bGenEn=%d\r\n",pInfo->pCapInfo->event,bScreenNailEn,bGenEn);
|
DBG_IND("event=%d, bScreenNailEn=%d, bGenEn=%d\r\n",pInfo->pCapInfo->event,bScreenNailEn,bGenEn);
|
||||||
|
|
||||||
//if (pInfo->pCapInfo->event == CAP_DS_EVENT_QV || pInfo->pCapInfo->event == CAP_DS_EVENT_SCR) {
|
//if (pInfo->pCapInfo->event == CAP_DS_EVENT_QV || pInfo->pCapInfo->event == CAP_DS_EVENT_SCR) {
|
||||||
if (pInfo->pCapInfo->event == CAP_DS_EVENT_PRI) {
|
if (1/*pInfo->pCapInfo->event == CAP_DS_EVENT_PRI*/) {
|
||||||
#if HUNTING_CAMERA_MCU == ENABLE
|
#if HUNTING_CAMERA_MCU == ENABLE
|
||||||
pInfo->isStrDirty = UiDateImprint_UpdateDate(pInfo->StrBuf,sizeof(pInfo->StrBuf));
|
pInfo->isStrDirty = UiDateImprint_UpdateDate(pInfo->StrBuf,sizeof(pInfo->StrBuf));
|
||||||
#else
|
#else
|
||||||
if ((UI_GetData(FL_CONTINUE_SHOT) == CONTINUE_SHOT_BURST_3)) {
|
if ((UI_GetData(FL_CONTINUE_SHOT) == CONTINUE_SHOT_BURST_3)) {
|
||||||
if (pInfo->pic_cnt == 0)
|
if (pInfo->pic_cnt == 0)
|
||||||
pInfo->isStrDirty = UiDateImprint_UpdateDate(pInfo->StrBuf,sizeof(pInfo->StrBuf));
|
pInfo->isStrDirty = UiDateImprint_UpdateDate(pInfo->StrBuf,sizeof(pInfo->StrBuf));
|
||||||
else
|
else
|
||||||
pInfo->isStrDirty = FALSE;
|
pInfo->isStrDirty = FALSE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pInfo->isStrDirty = UiDateImprint_UpdateDate(pInfo->StrBuf,sizeof(pInfo->StrBuf));
|
pInfo->isStrDirty = UiDateImprint_UpdateDate(pInfo->StrBuf,sizeof(pInfo->StrBuf));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
// need to update primary info to screenail
|
// need to update primary info to screenail
|
||||||
if (pInfo->pCapInfo->event == CAP_DS_EVENT_PRI)
|
if (pInfo->pCapInfo->event == CAP_DS_EVENT_PRI)
|
||||||
|
@ -912,7 +911,7 @@ void UiDateImprint_DrawBG(DS_STAMP_INFOR *stampInfo, HD_VIDEO_FRAME* Img)
|
||||||
param.color = LV_USER_CFG_STAMP_COLOR_BACKGROUND; /* ARGB format */
|
param.color = LV_USER_CFG_STAMP_COLOR_BACKGROUND; /* ARGB format */
|
||||||
param.thickness = 10;
|
param.thickness = 10;
|
||||||
param.rect.w = Img->dim.w;
|
param.rect.w = Img->dim.w;
|
||||||
param.rect.h = stampInfo->Img.dim.h*11/10; /*add heigt*/
|
param.rect.h = (stampInfo->Img.dim.h/10)*12;
|
||||||
param.rect.x = 0;
|
param.rect.x = 0;
|
||||||
//param.rect.y = stampInfo->PosY;
|
//param.rect.y = stampInfo->PosY;
|
||||||
param.rect.y = Img->dim.h - param.rect.h;
|
param.rect.y = Img->dim.h - param.rect.h;
|
||||||
|
|
|
@ -158,6 +158,12 @@ int General_MenuCallback(UINT32 uiMessage, UINT32 uiParam)
|
||||||
case IDM_DELAY:
|
case IDM_DELAY:
|
||||||
{
|
{
|
||||||
puiPara->PirDelaySwitch = uwOption == 0 ? SF_OFF : SF_ON;
|
puiPara->PirDelaySwitch = uwOption == 0 ? SF_OFF : SF_ON;
|
||||||
|
if (SF_OFF == puiPara->PirDelaySwitch)
|
||||||
|
{
|
||||||
|
puiPara->PirDelayTime.Hour = 0;
|
||||||
|
puiPara->PirDelayTime.Min = 0;
|
||||||
|
puiPara->PirDelayTime.Sec = 15;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IDM_OPERATING_TIME:
|
case IDM_OPERATING_TIME:
|
||||||
|
@ -465,11 +471,11 @@ void show_Delay_page(lv_obj_t* obj)
|
||||||
|
|
||||||
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
||||||
// if(!puiPara->PirDelaySwitch)
|
// if(!puiPara->PirDelaySwitch)
|
||||||
{
|
// {
|
||||||
puiPara->PirDelayTime.Hour = 0;
|
// puiPara->PirDelayTime.Hour = 0;
|
||||||
puiPara->PirDelayTime.Min = 0;
|
// puiPara->PirDelayTime.Min = 0;
|
||||||
puiPara->PirDelayTime.Sec = 30;
|
// puiPara->PirDelayTime.Sec = 30;
|
||||||
}
|
// }
|
||||||
snprintf(DelayHHBuf, 3, "%02d", puiPara->PirDelayTime.Hour);
|
snprintf(DelayHHBuf, 3, "%02d", puiPara->PirDelayTime.Hour);
|
||||||
snprintf(DelayMMBuf, 3, "%02d", puiPara->PirDelayTime.Min);
|
snprintf(DelayMMBuf, 3, "%02d", puiPara->PirDelayTime.Min);
|
||||||
snprintf(DelaySSBuf, 3, "%02d", puiPara->PirDelayTime.Sec);
|
snprintf(DelaySSBuf, 3, "%02d", puiPara->PirDelayTime.Sec);
|
||||||
|
|
|
@ -83,13 +83,13 @@ int Send_MenuCallback(UINT32 uiMessage, UINT32 uiParam)
|
||||||
{
|
{
|
||||||
case FOUR_TIME_DAY:
|
case FOUR_TIME_DAY:
|
||||||
puiPara->TimeSend4Switch = 1;
|
puiPara->TimeSend4Switch = 1;
|
||||||
break;
|
// break;
|
||||||
case TWICE_DAY:
|
case TWICE_DAY:
|
||||||
puiPara->TimeSend3Switch = 1;
|
puiPara->TimeSend3Switch = 1;
|
||||||
break;
|
// break;
|
||||||
case ONCE_DAY:
|
case ONCE_DAY:
|
||||||
puiPara->TimeSend2Switch = 1;
|
puiPara->TimeSend2Switch = 1;
|
||||||
break;
|
// break;
|
||||||
default:
|
default:
|
||||||
puiPara->TimeSend1Switch = 1;
|
puiPara->TimeSend1Switch = 1;
|
||||||
break;
|
break;
|
||||||
|
@ -386,13 +386,13 @@ static void update_send_time_msg(lv_obj_t* obj)
|
||||||
if(NULL != SendTimeMatrixObj_0)
|
if(NULL != SendTimeMatrixObj_0)
|
||||||
{
|
{
|
||||||
lv_btnmatrix_set_focused_btn(SendTimeMatrixObj_0, gMatrixIndex);
|
lv_btnmatrix_set_focused_btn(SendTimeMatrixObj_0, gMatrixIndex);
|
||||||
|
lv_btnmatrix_set_map(SendTimeMatrixObj_0, SendTimeMap_0);
|
||||||
}
|
}
|
||||||
if(NULL != SendTimeMatrixObj_1)
|
if(NULL != SendTimeMatrixObj_1)
|
||||||
{
|
{
|
||||||
lv_btnmatrix_set_focused_btn(SendTimeMatrixObj_1, gMatrixIndex);
|
lv_btnmatrix_set_focused_btn(SendTimeMatrixObj_1, gMatrixIndex);
|
||||||
|
lv_btnmatrix_set_map(SendTimeMatrixObj_1, SendTimeMap_1);
|
||||||
}
|
}
|
||||||
lv_btnmatrix_set_map(SendTimeMatrixObj_0, SendTimeMap_0);
|
|
||||||
lv_btnmatrix_set_map(SendTimeMatrixObj_1, SendTimeMap_1);
|
|
||||||
}
|
}
|
||||||
void show_send_time_page(lv_obj_t* obj, const int sendType)
|
void show_send_time_page(lv_obj_t* obj, const int sendType)
|
||||||
{
|
{
|
||||||
|
|
|
@ -366,8 +366,11 @@ static void update_camera_message(void)
|
||||||
{
|
{
|
||||||
if (UIStorageCheck(STORAGE_CHECK_ERROR, NULL) == TRUE)
|
if (UIStorageCheck(STORAGE_CHECK_ERROR, NULL) == TRUE)
|
||||||
{
|
{
|
||||||
lv_label_set_text(label_6_scr_uiflowmovie, "SD CARD ERROR");
|
// lv_label_set_text(label_6_scr_uiflowphoto, "SD CARD ERROR");
|
||||||
}
|
} if (UIStorageCheck(STORAGE_CHECK_FULL, NULL) == TRUE)
|
||||||
|
{
|
||||||
|
lv_label_set_text(label_6_scr_uiflowphoto, "SD FULL");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UIStorageCheck(STORAGE_CHECK_FULL, &freePicNum);
|
UIStorageCheck(STORAGE_CHECK_FULL, &freePicNum);
|
||||||
|
|
|
@ -472,8 +472,11 @@ static void update_camera_message(void)
|
||||||
{
|
{
|
||||||
if (UIStorageCheck(STORAGE_CHECK_ERROR, NULL) == TRUE)
|
if (UIStorageCheck(STORAGE_CHECK_ERROR, NULL) == TRUE)
|
||||||
{
|
{
|
||||||
lv_label_set_text(label_6_scr_uiflowphoto, "SD CARD ERROR");
|
// lv_label_set_text(label_6_scr_uiflowphoto, "SD CARD ERROR");
|
||||||
}
|
} if (UIStorageCheck(STORAGE_CHECK_FULL, NULL) == TRUE)
|
||||||
|
{
|
||||||
|
lv_label_set_text(label_6_scr_uiflowphoto, "SD FULL");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UIStorageCheck(STORAGE_CHECK_FULL, &g_uiFreePicNum);
|
UIStorageCheck(STORAGE_CHECK_FULL, &g_uiFreePicNum);
|
||||||
|
@ -520,6 +523,7 @@ static void update_bluetooth(void)
|
||||||
// SF_BLE_BUTT,
|
// SF_BLE_BUTT,
|
||||||
const int EMPTY_IMAGE = 0;
|
const int EMPTY_IMAGE = 0;
|
||||||
SF_BLE_STATUS_E status = sf_get_ble_status();
|
SF_BLE_STATUS_E status = sf_get_ble_status();
|
||||||
|
// printf(" ============ sf_get_ble_status = %d\n", status);
|
||||||
lv_plugin_res_id res[] = {
|
lv_plugin_res_id res[] = {
|
||||||
EMPTY_IMAGE,
|
EMPTY_IMAGE,
|
||||||
LV_PLUGIN_IMG_ID_SF_BLUETOOTH_UNSUPPORT,
|
LV_PLUGIN_IMG_ID_SF_BLUETOOTH_UNSUPPORT,
|
||||||
|
|
|
@ -22,7 +22,7 @@ extern void UIFlowPhoto_update_selftimer_cnt(UINT32 time);
|
||||||
|
|
||||||
CHAR *Get_FreePicNumString(UINT32 uiValue)
|
CHAR *Get_FreePicNumString(UINT32 uiValue)
|
||||||
{
|
{
|
||||||
snprintf(g_cFreePicNumStr, sizeof(g_cFreePicNumStr), "%05ld/%05ld", PhotoExe_GetTotalPicNum(), uiValue);
|
snprintf(g_cFreePicNumStr, sizeof(g_cFreePicNumStr), "%05ld/%05ld", uiValue, PhotoExe_GetTotalPicNum());
|
||||||
return g_cFreePicNumStr;
|
return g_cFreePicNumStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -263,7 +263,7 @@
|
||||||
#define DEFAULT_MULTISHOT_INTEVEL SF_MULTISHOT_INTEVEL_1S
|
#define DEFAULT_MULTISHOT_INTEVEL SF_MULTISHOT_INTEVEL_1S
|
||||||
#define DEFAULT_PIC_UP_DAILY_REPORT SF_OFF
|
#define DEFAULT_PIC_UP_DAILY_REPORT SF_OFF
|
||||||
#define DEFAULT_BLU_SWITCH SF_ON
|
#define DEFAULT_BLU_SWITCH SF_ON
|
||||||
|
#define DEFAULT_WIFI_SWITCH SF_ON
|
||||||
#define SIFAR_FTP_IP "119.23.174.139"
|
#define SIFAR_FTP_IP "119.23.174.139"
|
||||||
#define SIFAR_FTP_PORT "21"
|
#define SIFAR_FTP_PORT "21"
|
||||||
#define SIFAR_FTP_USERNAME "cameraftp"
|
#define SIFAR_FTP_USERNAME "cameraftp"
|
||||||
|
|
|
@ -1680,7 +1680,11 @@ void SysResetFlag(void)
|
||||||
puiPara->VideoLenth = DEFAULT_VIDEO_LENTH;
|
puiPara->VideoLenth = DEFAULT_VIDEO_LENTH;
|
||||||
puiPara->PirSwitch = DEFAULT_PIR_SWITCH;
|
puiPara->PirSwitch = DEFAULT_PIR_SWITCH;
|
||||||
puiPara->PirSensitivity = DEFAULT_PIR_SENSITIVITY;
|
puiPara->PirSensitivity = DEFAULT_PIR_SENSITIVITY;
|
||||||
|
|
||||||
puiPara->PirDelaySwitch = DEFAULT_PIR_DELAY_SWITCH;
|
puiPara->PirDelaySwitch = DEFAULT_PIR_DELAY_SWITCH;
|
||||||
|
puiPara->PirDelayTime.Hour = 0;
|
||||||
|
puiPara->PirDelayTime.Min = 0;
|
||||||
|
puiPara->PirDelayTime.Sec = 15;
|
||||||
|
|
||||||
puiPara->TimelapseSwitch = DEFAULT_TIMELAPSE_SWITCH;
|
puiPara->TimelapseSwitch = DEFAULT_TIMELAPSE_SWITCH;
|
||||||
if(puiPara->TimelapseSwitch)
|
if(puiPara->TimelapseSwitch)
|
||||||
|
@ -1765,6 +1769,7 @@ void SysResetFlag(void)
|
||||||
puiPara->MultiShotIntevel = DEFAULT_MULTISHOT_INTEVEL;
|
puiPara->MultiShotIntevel = DEFAULT_MULTISHOT_INTEVEL;
|
||||||
puiPara->PicUpDailyReport = DEFAULT_PIC_UP_DAILY_REPORT;
|
puiPara->PicUpDailyReport = DEFAULT_PIC_UP_DAILY_REPORT;
|
||||||
puiPara->BluSwitch = DEFAULT_BLU_SWITCH;
|
puiPara->BluSwitch = DEFAULT_BLU_SWITCH;
|
||||||
|
puiPara->WifiSwitch = DEFAULT_WIFI_SWITCH;
|
||||||
if(puiPara->ModuleImei[0] != '\0')
|
if(puiPara->ModuleImei[0] != '\0')
|
||||||
{
|
{
|
||||||
puiPara->DailyReportTime.Hour = ((UINT16)(puiPara->ModuleImei[11]-48)*10+(puiPara->ModuleImei[12]-48))%12;
|
puiPara->DailyReportTime.Hour = ((UINT16)(puiPara->ModuleImei[11]-48)*10+(puiPara->ModuleImei[12]-48))%12;
|
||||||
|
|
|
@ -30,7 +30,7 @@ typedef struct {
|
||||||
|
|
||||||
static PHOTO_SIZE_PARAM g_PhotoCapSizeTable[PHOTO_SIZE_ID_MAX + 2] = {
|
static PHOTO_SIZE_PARAM g_PhotoCapSizeTable[PHOTO_SIZE_ID_MAX + 2] = {
|
||||||
#if PHOTO_PREVIEW_SLICE_ENC_FUNC || POWERON_FAST_SLICE_ENC
|
#if PHOTO_PREVIEW_SLICE_ENC_FUNC || POWERON_FAST_SLICE_ENC
|
||||||
{7296, 5760, IMAGERATIO_4_3, "40M"}, /* 40M */
|
{7296, 5472, IMAGERATIO_4_3, "40M"}, /* 40M */
|
||||||
#endif
|
#endif
|
||||||
{6528, 4896, IMAGERATIO_4_3, "32M"}, /* 32M */
|
{6528, 4896, IMAGERATIO_4_3, "32M"}, /* 32M */
|
||||||
{5664, 4248, IMAGERATIO_4_3, "24M"}, //16M
|
{5664, 4248, IMAGERATIO_4_3, "24M"}, //16M
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
#include "kwrap/nvt_type.h"
|
#include "kwrap/nvt_type.h"
|
||||||
#include "sf_type.h"
|
#include "sf_type.h"
|
||||||
|
#include <time.h>
|
||||||
typedef enum _FTP_SIM_E
|
typedef enum _FTP_SIM_E
|
||||||
{
|
{
|
||||||
FTP_SIM_CGDCONT = 0,
|
FTP_SIM_CGDCONT = 0,
|
||||||
|
@ -220,5 +221,7 @@ SINT32 sf_video_ftp_send(void);
|
||||||
SINT32 sf_get_ftp_open_flag(void);
|
SINT32 sf_get_ftp_open_flag(void);
|
||||||
SINT32 sf_log_send_ftp(void);
|
SINT32 sf_log_send_ftp(void);
|
||||||
SINT32 sf_low_power_warn_send_ftp(void);
|
SINT32 sf_low_power_warn_send_ftp(void);
|
||||||
|
double sf_sys_s_time_get(time_t end_time);
|
||||||
|
time_t sf_time (time_t *__timer);
|
||||||
#endif /*_SF_FTP_H_*/
|
#endif /*_SF_FTP_H_*/
|
||||||
|
|
||||||
|
|
|
@ -266,5 +266,6 @@ UINT8 sf_set_send_hd(UINT8 value);
|
||||||
UINT8 sf_set_send_video(UINT8 value);
|
UINT8 sf_set_send_video(UINT8 value);
|
||||||
UINT8 sf_get_send_log(void);
|
UINT8 sf_get_send_log(void);
|
||||||
UINT8 sf_set_send_log(UINT8 value);
|
UINT8 sf_set_send_log(UINT8 value);
|
||||||
|
SINT32 sf_power_off_statistics(void);
|
||||||
#endif /*_SF_SMS_H_*/
|
#endif /*_SF_SMS_H_*/
|
||||||
|
|
||||||
|
|
|
@ -466,6 +466,10 @@ typedef struct
|
||||||
UINT8 sendFirstTimeM; /* 0~59 (12小时和 24小时共用) */
|
UINT8 sendFirstTimeM; /* 0~59 (12小时和 24小时共用) */
|
||||||
UINT8 sendSecondTimeH; /* 0~23 */
|
UINT8 sendSecondTimeH; /* 0~23 */
|
||||||
UINT8 sendSecondTimeM; /* 0~59 */
|
UINT8 sendSecondTimeM; /* 0~59 */
|
||||||
|
UINT8 sendThirdTimeH; /* 0~23 */
|
||||||
|
UINT8 sendThirdTimeM; /* 0~59 */
|
||||||
|
UINT8 sendFourthTimeH; /* 0~23 */
|
||||||
|
UINT8 sendFourthTimeM; /* 0~59 */
|
||||||
UINT16 suffix; /* 0xFFEE */
|
UINT16 suffix; /* 0xFFEE */
|
||||||
} __attribute__((packed)) MSG_DEV_SendType_Set_T;
|
} __attribute__((packed)) MSG_DEV_SendType_Set_T;
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ UINT8 AddCimiTimes = 0;
|
||||||
UINT8 simErrorCode = SIM_AT_ERROR;
|
UINT8 simErrorCode = SIM_AT_ERROR;
|
||||||
BOOL NetworkScan = FALSE;
|
BOOL NetworkScan = FALSE;
|
||||||
BOOL GprsNetWorkReady = FALSE;
|
BOOL GprsNetWorkReady = FALSE;
|
||||||
|
time_t sendStartTime;
|
||||||
UINT8 gprs_search_process = GPRS_SEARCH_STEP_IDLE;
|
UINT8 gprs_search_process = GPRS_SEARCH_STEP_IDLE;
|
||||||
extern SF_PARA_TIME_S rtcTime;
|
extern SF_PARA_TIME_S rtcTime;
|
||||||
|
|
||||||
|
@ -4525,7 +4525,9 @@ SINT32 sf_auto_net_reg(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
SF_MODULE_END:
|
SF_MODULE_END:
|
||||||
printf("[%s:%d]ret:[0x%08X]\n\n", __FUNCTION__, __LINE__, ret);
|
// sendStartTime = clock();
|
||||||
|
sf_time(&sendStartTime);
|
||||||
|
printf("[%s:%d]ret:[0x%08X] sendStartTime:%d\n\n", __FUNCTION__, __LINE__, ret, sendStartTime);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4659,7 +4661,7 @@ SINT32 sf_get_utc(VOID)
|
||||||
printf("[%s:%d] s\n", __FUNCTION__, __LINE__);
|
printf("[%s:%d] s\n", __FUNCTION__, __LINE__);
|
||||||
|
|
||||||
UIMenuStoreInfo *pPara = sf_app_ui_para_get();
|
UIMenuStoreInfo *pPara = sf_app_ui_para_get();
|
||||||
SF_TTY_DATA_TYPE_S ttyData = { .waitMs = 2000, .len = 3, .lenMax = (GPRS_INFO_LINE_MAX-1), .cmp = "OK", .cmperr = "ERROR", .data = gsmPara};
|
SF_TTY_DATA_TYPE_S ttyData = { .waitMs = 1000, .len = 3, .lenMax = (GPRS_INFO_LINE_MAX-1), .cmp = "OK", .cmperr = "ERROR", .data = gsmPara};
|
||||||
|
|
||||||
|
|
||||||
sf_gsm_para_buff_clear();
|
sf_gsm_para_buff_clear();
|
||||||
|
@ -4727,7 +4729,7 @@ SINT32 sf_get_utc(VOID)
|
||||||
ttyRet = sf_hal_ttyusb2_write(gsmPara, strlen(gsmPara));
|
ttyRet = sf_hal_ttyusb2_write(gsmPara, strlen(gsmPara));
|
||||||
SF_CHECK_RETURN(ttyRet, SF_GPRS_MODULE_ERROR_WRITE);
|
SF_CHECK_RETURN(ttyRet, SF_GPRS_MODULE_ERROR_WRITE);
|
||||||
ttyData.cmp = "OK";
|
ttyData.cmp = "OK";
|
||||||
ttyData.len = strlen(gsmPara) + 2;
|
ttyData.len = 48;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4795,7 +4797,7 @@ SINT32 sf_get_ntp(SINT32 value, SF_PARA_TIME_S *current_time)
|
||||||
printf("[%s:%d] s\n", __FUNCTION__, __LINE__);
|
printf("[%s:%d] s\n", __FUNCTION__, __LINE__);
|
||||||
|
|
||||||
UIMenuStoreInfo *pPara = sf_app_ui_para_get();
|
UIMenuStoreInfo *pPara = sf_app_ui_para_get();
|
||||||
SF_TTY_DATA_TYPE_S ttyData = { .waitMs = 2000, .len = 3, .lenMax = (GPRS_INFO_LINE_MAX-1), .cmp = "OK", .cmperr = "ERROR", .data = gsmPara};
|
SF_TTY_DATA_TYPE_S ttyData = { .waitMs = 1000, .len = 3, .lenMax = (GPRS_INFO_LINE_MAX-1), .cmp = "OK", .cmperr = "ERROR", .data = gsmPara};
|
||||||
|
|
||||||
SF_DEBUG("Sim4gApn=%s", pPara->Sim4gApn);
|
SF_DEBUG("Sim4gApn=%s", pPara->Sim4gApn);
|
||||||
sf_gsm_para_buff_clear();
|
sf_gsm_para_buff_clear();
|
||||||
|
@ -4838,7 +4840,7 @@ SINT32 sf_get_ntp(SINT32 value, SF_PARA_TIME_S *current_time)
|
||||||
SF_CHECK_RETURN(ttyRet, SF_GPRS_MODULE_ERROR_WRITE);
|
SF_CHECK_RETURN(ttyRet, SF_GPRS_MODULE_ERROR_WRITE);
|
||||||
eSmsLocation = SMS_SIM_INIT_ATCNTP;
|
eSmsLocation = SMS_SIM_INIT_ATCNTP;
|
||||||
calltime = 0;
|
calltime = 0;
|
||||||
ttyData.cmp = "OK";
|
ttyData.cmp = "+QNTP:";
|
||||||
ttyData.len = strlen(gsmPara) + 2;
|
ttyData.len = strlen(gsmPara) + 2;
|
||||||
}
|
}
|
||||||
else if(strstr((const char *)gsmPara, "ERROR") != NULL)
|
else if(strstr((const char *)gsmPara, "ERROR") != NULL)
|
||||||
|
|
|
@ -105,7 +105,8 @@ UINT8 DailyReportFtpSendSucess = 0;
|
||||||
SINT32 FtpOpenOk = FAIL;
|
SINT32 FtpOpenOk = FAIL;
|
||||||
extern char logStr[128];
|
extern char logStr[128];
|
||||||
extern char gsmPara[GPRS_INFO_LINE_MAX];
|
extern char gsmPara[GPRS_INFO_LINE_MAX];
|
||||||
|
extern time_t sendStartTime;
|
||||||
|
time_t sendEndTime = 0;
|
||||||
/*************************************************
|
/*************************************************
|
||||||
Function: sf_check_max_num
|
Function: sf_check_max_num
|
||||||
Description: check the max num one day limit.
|
Description: check the max num one day limit.
|
||||||
|
@ -884,11 +885,11 @@ SINT32 sf_pic_send_ftp(void)
|
||||||
UINT8 pic = 0;
|
UINT8 pic = 0;
|
||||||
UINT8 csqlevel = 0;
|
UINT8 csqlevel = 0;
|
||||||
int timeout = 120000;
|
int timeout = 120000;
|
||||||
SINT64 sendStartTime = 0;
|
//SINT64 sendStartTime = 0;
|
||||||
SINT64 sendEndTime = 0;
|
|
||||||
SF_SRCFILE_ATTR_S *pThumbFileCfg = sf_file_thumb_cfg_get();
|
SF_SRCFILE_ATTR_S *pThumbFileCfg = sf_file_thumb_cfg_get();
|
||||||
MLOGD("start\n");
|
MLOGD("start\n");
|
||||||
sendStartTime = sf_sys_os_utime_get()/1000;
|
//sendStartTime = sf_sys_os_utime_get()/1000;
|
||||||
|
|
||||||
sf_custom_str_get(CamNameStr);
|
sf_custom_str_get(CamNameStr);
|
||||||
sf_4G_signal_level_get(pPara->NetGeneration,sf_get_cq_signal(),&csqlevel);
|
sf_4G_signal_level_get(pPara->NetGeneration,sf_get_cq_signal(),&csqlevel);
|
||||||
|
@ -991,14 +992,41 @@ SINT32 sf_pic_send_ftp(void)
|
||||||
printf("%s:%d err up file ftpFileName:%s filePath:%s\n", __FUNCTION__, __LINE__, ftpFileName[pic], filePath[pic]);
|
printf("%s:%d err up file ftpFileName:%s filePath:%s\n", __FUNCTION__, __LINE__, ftpFileName[pic], filePath[pic]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sendEndTime = sf_sys_os_utime_get()/1000;
|
// sendEndTime = clock();
|
||||||
pSifarPara->picSendTimeCount +=sendEndTime - sendStartTime;
|
|
||||||
pSifarPara->sendThumbnailTimeCount += sendEndTime - sendStartTime;
|
//pSifarPara->picSendTimeCount +=sendEndTime - sendStartTime;
|
||||||
|
//pSifarPara->sendThumbnailTimeCount += sendEndTime - sendStartTime;
|
||||||
|
|
||||||
MLOGD(" end ret:[0x%08X] sendTime:%ds\n", ret, (sendEndTime - sendStartTime));
|
MLOGD(" end ret:[0x%08X] \n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
double sf_sys_ms_time_get(clock_t end_time)
|
||||||
|
{
|
||||||
|
// ms
|
||||||
|
double elapsed_time = (double)(end_time - sendStartTime) / CLOCKS_PER_SEC * 1000;
|
||||||
|
|
||||||
|
printf("time: %.2f ms\n", elapsed_time);
|
||||||
|
|
||||||
|
return elapsed_time;
|
||||||
|
}
|
||||||
|
double sf_sys_s_time_get(time_t end_time)
|
||||||
|
{
|
||||||
|
// time
|
||||||
|
double elapsed_time = difftime(end_time, sendStartTime);
|
||||||
|
|
||||||
|
// s
|
||||||
|
printf("start_time: %s", ctime(&sendStartTime));
|
||||||
|
printf("end_time: %s", ctime(&end_time));
|
||||||
|
|
||||||
|
|
||||||
|
printf("time: %.2f s\n", elapsed_time);
|
||||||
|
|
||||||
|
return elapsed_time;
|
||||||
|
}
|
||||||
|
time_t sf_time (time_t *__timer)
|
||||||
|
{
|
||||||
|
time(__timer);
|
||||||
|
}
|
||||||
SINT32 sf_video_send_ftp(void)
|
SINT32 sf_video_send_ftp(void)
|
||||||
{
|
{
|
||||||
//extern UINT8 PicName[5][2][35];
|
//extern UINT8 PicName[5][2][35];
|
||||||
|
@ -1197,7 +1225,8 @@ SINT32 sf_send_file_to_ftp(UINT8 mode)
|
||||||
UINT8 gprsMode = 0;
|
UINT8 gprsMode = 0;
|
||||||
int timeout = 120000;
|
int timeout = 120000;
|
||||||
UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
|
UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
|
||||||
|
SF_PDT_PARAM_STATISTICS_S *pSifarPara = sf_statistics_param_get();
|
||||||
|
SINT64 sendEndTime = 0;
|
||||||
MLOGD("start\n");
|
MLOGD("start\n");
|
||||||
|
|
||||||
ssl = ((2 == puiPara->FtpSwitch) ? 1 : 0);
|
ssl = ((2 == puiPara->FtpSwitch) ? 1 : 0);
|
||||||
|
@ -1271,6 +1300,13 @@ SINT32 sf_send_file_to_ftp(UINT8 mode)
|
||||||
ret1 = sf_video_send_ftp();
|
ret1 = sf_video_send_ftp();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//sendEndTime = clock();
|
||||||
|
time(&sendEndTime);
|
||||||
|
double elapsed_time = sf_sys_s_time_get(sendEndTime);
|
||||||
|
pSifarPara->picSendTimeCount +=elapsed_time;
|
||||||
|
pSifarPara->sendThumbnailTimeCount += elapsed_time;
|
||||||
|
MLOGD("SendTime:%d s picSendTimeCount:%d s sendThumbnailTimeCount:%d s\n", elapsed_time, pSifarPara->picSendTimeCount,pSifarPara->sendThumbnailTimeCount);
|
||||||
|
time(&sendStartTime);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1519,12 +1555,12 @@ SINT32 sf_concentrated_ftp_send(void)
|
||||||
UINT8 sendFailFlag = 0;
|
UINT8 sendFailFlag = 0;
|
||||||
UINT8 sendAlreadyFlag = 0;
|
UINT8 sendAlreadyFlag = 0;
|
||||||
UINT8 timeoutCnt = 0;
|
UINT8 timeoutCnt = 0;
|
||||||
SINT64 sendStartTime = 0;
|
// SINT64 sendStartTime = 0;
|
||||||
SINT64 sendEndTime = 0;
|
SINT64 sendEndTime = 0;
|
||||||
sf_custom_str_get(CamNameStr);
|
sf_custom_str_get(CamNameStr);
|
||||||
sf_4G_signal_level_get(pPara->NetGeneration,sf_get_cq_signal(),&csqlevel);
|
sf_4G_signal_level_get(pPara->NetGeneration,sf_get_cq_signal(),&csqlevel);
|
||||||
|
|
||||||
sendStartTime = sf_sys_os_utime_get()/1000;
|
// sendStartTime = sf_sys_os_utime_get()/1000;
|
||||||
|
|
||||||
SF_CONCENTRATED_MODULE_REBOOT://Restart the module once.
|
SF_CONCENTRATED_MODULE_REBOOT://Restart the module once.
|
||||||
ret1 = sf_ftp_config(ssl, gprsMode, timeout);
|
ret1 = sf_ftp_config(ssl, gprsMode, timeout);
|
||||||
|
@ -1579,9 +1615,9 @@ SINT32 sf_concentrated_ftp_send(void)
|
||||||
}
|
}
|
||||||
else if(1 == sendFailFlag){
|
else if(1 == sendFailFlag){
|
||||||
sendFailFlag++;
|
sendFailFlag++;
|
||||||
sendEndTime = sf_sys_os_utime_get()/1000;
|
// sendEndTime = sf_sys_os_utime_get()/1000;
|
||||||
pSifarPara->picSendTimeCount +=sendEndTime - sendStartTime;
|
// pSifarPara->picSendTimeCount +=sendEndTime - sendStartTime;
|
||||||
pSifarPara->sendThumbnailTimeCount += sendEndTime - sendStartTime;
|
// pSifarPara->sendThumbnailTimeCount += sendEndTime - sendStartTime;
|
||||||
if(sf_ttyusb_restart() != SUCCESS)
|
if(sf_ttyusb_restart() != SUCCESS)
|
||||||
{
|
{
|
||||||
printf("%s:%d restart tty usb err\n", __FUNCTION__, __LINE__);
|
printf("%s:%d restart tty usb err\n", __FUNCTION__, __LINE__);
|
||||||
|
@ -1617,10 +1653,12 @@ SINT32 sf_concentrated_ftp_send(void)
|
||||||
|
|
||||||
SF_CONCENTRATED_END:
|
SF_CONCENTRATED_END:
|
||||||
|
|
||||||
sendEndTime = sf_sys_os_utime_get()/1000;
|
time(&sendEndTime);
|
||||||
pSifarPara->picSendTimeCount +=sendEndTime - sendStartTime;
|
double elapsed_time = sf_sys_s_time_get(sendEndTime);
|
||||||
pSifarPara->sendThumbnailTimeCount += sendEndTime - sendStartTime;
|
pSifarPara->picSendTimeCount +=elapsed_time;
|
||||||
printf("[%s:%d] : sendStartTime:%d sendEndTime:%d\n\n", __FUNCTION__, __LINE__, sendStartTime, sendEndTime);
|
pSifarPara->sendThumbnailTimeCount += elapsed_time;
|
||||||
|
MLOGD("SendTime:%d s picSendTimeCount:%d s sendThumbnailTimeCount:%d s\n", elapsed_time, pSifarPara->picSendTimeCount,pSifarPara->sendThumbnailTimeCount);
|
||||||
|
time(&sendStartTime);
|
||||||
|
|
||||||
if(!(((piccount+1) <= SendFileTotal) && ((pSifarPara->picSendMax < pPara->SendMaxNum) || (pPara->SendMaxNum == 0))))
|
if(!(((piccount+1) <= SendFileTotal) && ((pSifarPara->picSendMax < pPara->SendMaxNum) || (pPara->SendMaxNum == 0))))
|
||||||
{
|
{
|
||||||
|
@ -1697,14 +1735,13 @@ SINT32 sf_hd_ftp_send(void)
|
||||||
UINT8 sendFailFlag = 0;
|
UINT8 sendFailFlag = 0;
|
||||||
UINT8 sendAlreadyFlag = 0;
|
UINT8 sendAlreadyFlag = 0;
|
||||||
UINT8 timeoutCnt = 0;
|
UINT8 timeoutCnt = 0;
|
||||||
SINT64 sendStartTime = 0;
|
double elapsed_time = 0;
|
||||||
SINT64 sendEndTime = 0;
|
|
||||||
|
|
||||||
sf_set_send_hd(0);
|
sf_set_send_hd(0);
|
||||||
sf_custom_str_get(CamNameStr);
|
sf_custom_str_get(CamNameStr);
|
||||||
sf_4G_signal_level_get(pPara->NetGeneration,sf_get_cq_signal(),&csqlevel);
|
sf_4G_signal_level_get(pPara->NetGeneration,sf_get_cq_signal(),&csqlevel);
|
||||||
|
|
||||||
sendStartTime = sf_sys_os_utime_get()/1000;
|
// sendStartTime = sf_sys_os_utime_get()/1000;
|
||||||
|
|
||||||
SF_HD_MODULE_REBOOT://Restart the module once.
|
SF_HD_MODULE_REBOOT://Restart the module once.
|
||||||
ret1 = sf_ftp_config(ssl, gprsMode, timeout);
|
ret1 = sf_ftp_config(ssl, gprsMode, timeout);
|
||||||
|
@ -1755,9 +1792,12 @@ SINT32 sf_hd_ftp_send(void)
|
||||||
}
|
}
|
||||||
else if(1 == sendFailFlag){
|
else if(1 == sendFailFlag){
|
||||||
sendFailFlag++;
|
sendFailFlag++;
|
||||||
sendEndTime = sf_sys_os_utime_get()/1000;
|
time(&sendEndTime);
|
||||||
pSifarPara->picSendTimeCount +=sendEndTime - sendStartTime;
|
elapsed_time = sf_sys_s_time_get(sendEndTime);
|
||||||
pSifarPara->sendThumbnailTimeCount += sendEndTime - sendStartTime;
|
pSifarPara->picSendTimeCount +=elapsed_time;
|
||||||
|
pSifarPara->sendThumbnailTimeCount += elapsed_time;
|
||||||
|
MLOGD("SendTime:%d s picSendTimeCount:%d s sendThumbnailTimeCount:%d s\n", elapsed_time, pSifarPara->picSendTimeCount,pSifarPara->sendThumbnailTimeCount);
|
||||||
|
time(&sendStartTime);
|
||||||
if(sf_ttyusb_restart() != SUCCESS)
|
if(sf_ttyusb_restart() != SUCCESS)
|
||||||
{
|
{
|
||||||
printf("%s:%d restart tty usb err\n", __FUNCTION__, __LINE__);
|
printf("%s:%d restart tty usb err\n", __FUNCTION__, __LINE__);
|
||||||
|
@ -1796,10 +1836,11 @@ SINT32 sf_hd_ftp_send(void)
|
||||||
|
|
||||||
SF_HD_END:
|
SF_HD_END:
|
||||||
|
|
||||||
sendEndTime = sf_sys_os_utime_get()/1000;
|
time(&sendEndTime);
|
||||||
pSifarPara->picSendTimeCount +=sendEndTime - sendStartTime;
|
elapsed_time = sf_sys_s_time_get(sendEndTime);
|
||||||
//pSifarPara->sendThumbnailTimeCount += sendEndTime - sendStartTime;
|
pSifarPara->picSendTimeCount +=elapsed_time;
|
||||||
printf("[%s:%d] : sendStartTime:%d sendEndTime:%d\n\n", __FUNCTION__, __LINE__, sendStartTime, sendEndTime);
|
MLOGD("SendTime:%d s picSendTimeCount:%d s sendThumbnailTimeCount:%d s\n", elapsed_time, pSifarPara->picSendTimeCount,pSifarPara->sendThumbnailTimeCount);
|
||||||
|
time(&sendStartTime);
|
||||||
|
|
||||||
if(!(((piccount) <= SendFileTotal) && ((pSifarPara->picSendMax < pPara->SendMaxNum) || (pPara->SendMaxNum == 0))))
|
if(!(((piccount) <= SendFileTotal) && ((pSifarPara->picSendMax < pPara->SendMaxNum) || (pPara->SendMaxNum == 0))))
|
||||||
{
|
{
|
||||||
|
@ -1913,7 +1954,7 @@ SINT32 sf_video_ftp_send(void)
|
||||||
UINT8 sendFailFlag = 0;
|
UINT8 sendFailFlag = 0;
|
||||||
UINT8 sendAlreadyFlag = 0;
|
UINT8 sendAlreadyFlag = 0;
|
||||||
UINT8 timeoutCnt = 0;
|
UINT8 timeoutCnt = 0;
|
||||||
SINT64 sendStartTime = 0;
|
double elapsed_time = 0;
|
||||||
SINT64 sendEndTime = 0;
|
SINT64 sendEndTime = 0;
|
||||||
UINT32 size = 0;
|
UINT32 size = 0;
|
||||||
|
|
||||||
|
@ -1921,7 +1962,7 @@ SINT32 sf_video_ftp_send(void)
|
||||||
sf_custom_str_get(CamNameStr);
|
sf_custom_str_get(CamNameStr);
|
||||||
sf_4G_signal_level_get(pPara->NetGeneration,sf_get_cq_signal(),&csqlevel);
|
sf_4G_signal_level_get(pPara->NetGeneration,sf_get_cq_signal(),&csqlevel);
|
||||||
|
|
||||||
sendStartTime = sf_sys_os_utime_get()/1000;
|
// sendStartTime = sf_sys_os_utime_get()/1000;
|
||||||
|
|
||||||
SF_VIDEO_MODULE_REBOOT://Restart the module once.
|
SF_VIDEO_MODULE_REBOOT://Restart the module once.
|
||||||
ret1 = sf_ftp_config(ssl, gprsMode, timeout);
|
ret1 = sf_ftp_config(ssl, gprsMode, timeout);
|
||||||
|
@ -1980,9 +2021,14 @@ SINT32 sf_video_ftp_send(void)
|
||||||
}
|
}
|
||||||
else if(1 == sendFailFlag){
|
else if(1 == sendFailFlag){
|
||||||
sendFailFlag++;
|
sendFailFlag++;
|
||||||
sendEndTime = sf_sys_os_utime_get()/1000;
|
|
||||||
pSifarPara->picSendTimeCount +=sendEndTime - sendStartTime;
|
time(&sendEndTime);
|
||||||
pSifarPara->sendThumbnailTimeCount += sendEndTime - sendStartTime;
|
elapsed_time = sf_sys_s_time_get(sendEndTime);
|
||||||
|
//pSifarPara->picSendTimeCount +=elapsed_time;
|
||||||
|
pSifarPara->videoSendTimeCount += elapsed_time;
|
||||||
|
MLOGD("SendTime:%d s picSendTimeCount:%d s sendThumbnailTimeCount:%d s\n", elapsed_time, pSifarPara->picSendTimeCount,pSifarPara->sendThumbnailTimeCount);
|
||||||
|
time(&sendStartTime);
|
||||||
|
|
||||||
if(sf_ttyusb_restart() != SUCCESS)
|
if(sf_ttyusb_restart() != SUCCESS)
|
||||||
{
|
{
|
||||||
printf("%s:%d restart tty usb err\n", __FUNCTION__, __LINE__);
|
printf("%s:%d restart tty usb err\n", __FUNCTION__, __LINE__);
|
||||||
|
@ -2021,11 +2067,12 @@ SINT32 sf_video_ftp_send(void)
|
||||||
|
|
||||||
SF_VIDEO_END:
|
SF_VIDEO_END:
|
||||||
|
|
||||||
sendEndTime = sf_sys_os_utime_get()/1000;
|
time(&sendEndTime);
|
||||||
pSifarPara->videoSendTimeCount +=sendEndTime - sendStartTime;
|
elapsed_time = sf_sys_s_time_get(sendEndTime);
|
||||||
//pSifarPara->sendThumbnailTimeCount += sendEndTime - sendStartTime;
|
pSifarPara->videoSendTimeCount +=elapsed_time;
|
||||||
printf("[%s:%d] : sendStartTime:%d sendEndTime:%d\n\n", __FUNCTION__, __LINE__, sendStartTime, sendEndTime);
|
MLOGD("SendTime:%d s videoSendTimeCount:%d s sendThumbnailTimeCount:%d s\n", elapsed_time, pSifarPara->videoSendTimeCount,pSifarPara->sendThumbnailTimeCount);
|
||||||
|
time(&sendStartTime);
|
||||||
|
|
||||||
if(ret1 != SF_FTP_ERROR_TERM)
|
if(ret1 != SF_FTP_ERROR_TERM)
|
||||||
{
|
{
|
||||||
ret2 = sf_ftp_stop(ssl, gprsMode);
|
ret2 = sf_ftp_stop(ssl, gprsMode);
|
||||||
|
|
|
@ -2609,6 +2609,36 @@ SINT32 sf_power_off_check_ui_para_sava(void)
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
/*************************************************
|
||||||
|
Function: sf_power_off_statistics
|
||||||
|
Description: sf power off .
|
||||||
|
Input: N/A
|
||||||
|
Output: N/A
|
||||||
|
Return: 0:SUCCESS, errcode:FAIL
|
||||||
|
Others: N/A
|
||||||
|
*************************************************/
|
||||||
|
SINT32 sf_power_off_statistics(void)
|
||||||
|
{
|
||||||
|
UINT8 PowerOnMode = sf_poweron_type_get();
|
||||||
|
UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
|
||||||
|
SF_PDT_PARAM_STATISTICS_S *psfPara = sf_statistics_param_get();
|
||||||
|
|
||||||
|
|
||||||
|
if(((PowerOnMode == PWR_ON_TIME_SEND) || (PowerOnMode == PWR_ON_TIMELAPSE) || (PowerOnMode == PWR_ON_PIR)) && (sf_get_signal_ready_flag()))
|
||||||
|
{
|
||||||
|
psfPara->picSendCount++;//Failed to register, counted as sending once.
|
||||||
|
printf("picSendCount=%d\n", psfPara->picSendCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
if((PowerOnMode == PWR_ON_TIMELAPSE) || (PowerOnMode == PWR_ON_PIR))
|
||||||
|
{
|
||||||
|
psfPara->TirgNum++;
|
||||||
|
psfPara->NewFlieCount+=(puiPara->Multishot+1);
|
||||||
|
printf("TirgNum=%d NewFlieCount=%d\n", psfPara->TirgNum, psfPara->NewFlieCount);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************
|
/*************************************************
|
||||||
Function: sf_power_off_check_camera_restart
|
Function: sf_power_off_check_camera_restart
|
||||||
|
|
|
@ -157,8 +157,14 @@ int main(int argc, char *argv[])
|
||||||
#if SF_IQ_TEST != ENABLE
|
#if SF_IQ_TEST != ENABLE
|
||||||
if(SF_MCU_STARTUP_ONKEY == startup)
|
if(SF_MCU_STARTUP_ONKEY == startup)
|
||||||
{
|
{
|
||||||
sf_set_wifi_en(1);
|
if(puiPara->WifiSwitch)
|
||||||
sf_set_bt_en(1);
|
{
|
||||||
|
sf_set_wifi_en(1);
|
||||||
|
}
|
||||||
|
if(puiPara->BluSwitch)
|
||||||
|
{
|
||||||
|
sf_set_bt_en(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if((0 == isUpdate) && (puiPara->GprsSwitch))
|
if((0 == isUpdate) && (puiPara->GprsSwitch))
|
||||||
{
|
{
|
||||||
|
|
|
@ -593,7 +593,7 @@ static SINT32 sf_app_process_cmd_SD(SF_MESSAGE_BUF_S *pMessageBuf)
|
||||||
break;
|
break;
|
||||||
case CMD_SD_STRG_CB_INSERTED:
|
case CMD_SD_STRG_CB_INSERTED:
|
||||||
sf_set_card(1);
|
sf_set_card(1);
|
||||||
sf_sd_status_set(SF_SD_OK);
|
// sf_sd_status_set(SF_SD_OK);
|
||||||
break;
|
break;
|
||||||
case CMD_SD_STRG_CB_REMOVED:
|
case CMD_SD_STRG_CB_REMOVED:
|
||||||
sf_set_card(0);
|
sf_set_card(0);
|
||||||
|
|
|
@ -1157,6 +1157,7 @@ static SINT32 app_file_transfer(SF_FN_PARAM_S *pfnParam) {
|
||||||
pCustomerParam->GpsSendFlag = 0;
|
pCustomerParam->GpsSendFlag = 0;
|
||||||
if(pCustomerParam->PicUpDailyReport){
|
if(pCustomerParam->PicUpDailyReport){
|
||||||
sf_sms_set_pic(1);
|
sf_sms_set_pic(1);
|
||||||
|
sf_sleep_ms(200);
|
||||||
SLOGD("GpsSendFlag:%d\n", pCustomerParam->GpsSendFlag);
|
SLOGD("GpsSendFlag:%d\n", pCustomerParam->GpsSendFlag);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1306,6 +1307,7 @@ static SINT32 app_Register_Net_Error_return_init(SF_FN_PARAM_S *pfnParam) {
|
||||||
}
|
}
|
||||||
|
|
||||||
RegisterNetTskParam.IsRun = 0;
|
RegisterNetTskParam.IsRun = 0;
|
||||||
|
sf_4G_status_set(SF_4G_FREE);
|
||||||
return SF_SUCCESS;
|
return SF_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1559,7 +1561,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
|
||||||
|
|
||||||
|
|
||||||
s32ret = sf_file_send_auto();
|
s32ret = sf_file_send_auto();
|
||||||
SF_APPCOMM_CHECK_RETURN(s32ret, SF_APP_ERROR_REQUEST);
|
SF_APPCOMM_CHECK_RETURN(s32ret, SF_APP_ERROR_FILE_SEND);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case SF_MCU_STARTUP_WARNING:
|
case SF_MCU_STARTUP_WARNING:
|
||||||
|
@ -1797,7 +1799,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
|
||||||
pCustomerParam->NeedTimeSyncStartUp = 0;
|
pCustomerParam->NeedTimeSyncStartUp = 0;
|
||||||
|
|
||||||
s32ret = sf_file_send_auto();
|
s32ret = sf_file_send_auto();
|
||||||
SF_APPCOMM_CHECK_RETURN(s32ret, SF_APP_ERROR_REQUEST);
|
SF_APPCOMM_CHECK_RETURN(s32ret, SF_APP_ERROR_FILE_SEND);
|
||||||
|
|
||||||
if (sf_get_pic())
|
if (sf_get_pic())
|
||||||
{
|
{
|
||||||
|
@ -2154,22 +2156,55 @@ void serach_gps_onkey_start(void)
|
||||||
}
|
}
|
||||||
pthread_attr_destroy(&attr);
|
pthread_attr_destroy(&attr);
|
||||||
}
|
}
|
||||||
|
static int sf_is_sdc_mounted(void)
|
||||||
|
{
|
||||||
|
char line[256];
|
||||||
|
printf("%s:%d is_mounted:%d", __FUNCTION__, __LINE__);
|
||||||
|
|
||||||
|
|
||||||
|
FILE *file = fopen("/proc/mounts", "r");
|
||||||
|
if (file == NULL) {
|
||||||
|
perror("Error opening /proc/mounts");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (fgets(line, sizeof(line), file)) {
|
||||||
|
if (strstr(line, "/dev/mmcblk0p1") != NULL) {
|
||||||
|
fclose(file);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose(file);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
int sf_check_sd(void)
|
int sf_check_sd(void)
|
||||||
{
|
{
|
||||||
UINT8 i = 0;
|
UINT8 i = 0;
|
||||||
int ret = SF_SUCCESS;
|
int ret = SF_SUCCESS;
|
||||||
if (sf_sd_status_get() != SF_SD_OK) {
|
if (sf_sd_status_get() != SF_SD_OK) {
|
||||||
ret = SF_FAILURE;
|
ret = SF_FAILURE;
|
||||||
for (i = 0; i < 20; i++) {
|
for (i = 0; i < 20; i++)
|
||||||
|
{
|
||||||
ret = sf_sd_status_get();
|
ret = sf_sd_status_get();
|
||||||
if (SF_SD_OK == ret) {
|
if (SF_SD_OK == ret)
|
||||||
|
{
|
||||||
ret = SF_SUCCESS;
|
ret = SF_SUCCESS;
|
||||||
MLOGI("SD\r\n");
|
MLOGI("SD\r\n");
|
||||||
sf_statistics_param_load(sf_statistics_param_get());
|
sf_statistics_param_load(sf_statistics_param_get());
|
||||||
break;
|
break;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (1 == sf_is_sdc_mounted())
|
||||||
|
{
|
||||||
|
ret = SF_SUCCESS;
|
||||||
|
MLOGI("mounted SD\r\n");
|
||||||
|
sf_statistics_param_load(sf_statistics_param_get());
|
||||||
|
break;
|
||||||
|
}
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -894,21 +894,15 @@ UINT8 *sf_versionGet(UINT8 ver[],UINT8 fea[])
|
||||||
*************************************************/
|
*************************************************/
|
||||||
void sf_power_off(void)
|
void sf_power_off(void)
|
||||||
{
|
{
|
||||||
UINT8 PowerOnMode = sf_poweron_type_get();
|
// UINT8 PowerOnMode = sf_poweron_type_get();
|
||||||
printf("[%s:%d] s\n", __FUNCTION__, __LINE__);
|
printf("[%s:%d] s\n", __FUNCTION__, __LINE__);
|
||||||
if(SF_FAILURE == sf_check_sd())
|
if(SF_FAILURE == sf_check_sd())
|
||||||
{
|
{
|
||||||
MLOGE("ERROR sf_check_sd\n");
|
MLOGE("ERROR sf_check_sd\n");
|
||||||
}
|
}
|
||||||
//UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
|
|
||||||
SF_PDT_PARAM_STATISTICS_S *psfPara = sf_statistics_param_get();
|
|
||||||
|
|
||||||
if((PowerOnMode == PWR_ON_TIMELAPSE) || (PowerOnMode == PWR_ON_PIR))
|
|
||||||
{
|
|
||||||
psfPara->TirgNum++;
|
|
||||||
printf("TirgNum=%d\n", psfPara->TirgNum);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
sf_power_off_statistics();
|
||||||
|
|
||||||
sf_power_off_check_sms();
|
sf_power_off_check_sms();
|
||||||
|
|
||||||
sf_power_off_module_ota();
|
sf_power_off_module_ota();
|
||||||
|
@ -932,7 +926,7 @@ void sf_power_off(void)
|
||||||
sf_power_off_check_camera_restart();
|
sf_power_off_check_camera_restart();
|
||||||
|
|
||||||
sf_power_off_check_ui_para_sava();
|
sf_power_off_check_ui_para_sava();
|
||||||
sf_statistics_param_save(psfPara);
|
sf_statistics_param_save(sf_statistics_param_get());
|
||||||
|
|
||||||
sf_power_off_msg_to_cardv();
|
sf_power_off_msg_to_cardv();
|
||||||
printf("[%s:%d] e\n", __FUNCTION__, __LINE__);
|
printf("[%s:%d] e\n", __FUNCTION__, __LINE__);
|
||||||
|
|
|
@ -106,7 +106,8 @@ UINT32 sf_battery_voltage_convert(UINT32 resistanceGnd, UINT32 resistanceVin, UI
|
||||||
//volt = 27 * adcVal * (resistanceGnd + resistanceVin) / resistanceGnd / 2696;
|
//volt = 27 * adcVal * (resistanceGnd + resistanceVin) / resistanceGnd / 2696;
|
||||||
if(adcVal)
|
if(adcVal)
|
||||||
{
|
{
|
||||||
volt = (27 * adcVal + 554) / 539;
|
//volt = (27 * adcVal + 554) / 539;
|
||||||
|
volt = 27 * adcVal * (resistanceGnd + resistanceVin) / resistanceGnd / 2696;
|
||||||
}
|
}
|
||||||
return volt;
|
return volt;
|
||||||
}
|
}
|
||||||
|
@ -131,7 +132,8 @@ UINT32 sf_aa_battery_voltage_convert(UINT32 resistanceGnd, UINT32 resistanceVin,
|
||||||
//volt = 27 * adcVal * (resistanceGnd + resistanceVin) / resistanceGnd / 511;
|
//volt = 27 * adcVal * (resistanceGnd + resistanceVin) / resistanceGnd / 511;
|
||||||
if(adcVal)
|
if(adcVal)
|
||||||
{
|
{
|
||||||
volt = (27 * adcVal + 3097) / 531;
|
volt = 27 * adcVal * (resistanceGnd + resistanceVin) / resistanceGnd / 2696;
|
||||||
|
//volt = (27 * adcVal + 3097) / 531;
|
||||||
}
|
}
|
||||||
return volt;
|
return volt;
|
||||||
}
|
}
|
||||||
|
@ -144,7 +146,8 @@ UINT32 sf_battery_convert_to_adc(UINT32 resistanceGnd, UINT32 resistanceVin, UIN
|
||||||
//adcVal = volt * resistanceGnd * 2696 / 27 / (resistanceGnd + resistanceVin);
|
//adcVal = volt * resistanceGnd * 2696 / 27 / (resistanceGnd + resistanceVin);
|
||||||
if(volt)
|
if(volt)
|
||||||
{
|
{
|
||||||
adcVal = (volt * 539 - 554) / 27;
|
//adcVal = (volt * 539 - 554) / 27;
|
||||||
|
adcVal = volt * resistanceGnd * 2696 / 27 / (resistanceGnd + resistanceVin);
|
||||||
}
|
}
|
||||||
return adcVal;
|
return adcVal;
|
||||||
}
|
}
|
||||||
|
@ -157,7 +160,8 @@ UINT32 sf_aa_battery_convert_to_adc(UINT32 resistanceGnd, UINT32 resistanceVin,
|
||||||
//adcVal = volt * resistanceGnd * 2696 / 27 / (resistanceGnd + resistanceVin);
|
//adcVal = volt * resistanceGnd * 2696 / 27 / (resistanceGnd + resistanceVin);
|
||||||
if(volt)
|
if(volt)
|
||||||
{
|
{
|
||||||
adcVal = (volt * 531 - 3097) / 27;
|
//adcVal = (volt * 531 - 3097) / 27;
|
||||||
|
adcVal = volt * resistanceGnd * 2696 / 27 / (resistanceGnd + resistanceVin);
|
||||||
}
|
}
|
||||||
return adcVal;
|
return adcVal;
|
||||||
}
|
}
|
||||||
|
@ -208,6 +212,7 @@ UINT32 sf_adc_value_get(UINT32 mux, UINT32 *pval)
|
||||||
{
|
{
|
||||||
static UINT8 getAdcFlg = 0;
|
static UINT8 getAdcFlg = 0;
|
||||||
//static UINT8 outputflag = 1;
|
//static UINT8 outputflag = 1;
|
||||||
|
UINT32 adc_device_delay_time_ms = 100;
|
||||||
*pval = 0;
|
*pval = 0;
|
||||||
|
|
||||||
if(getAdcFlg)
|
if(getAdcFlg)
|
||||||
|
@ -222,6 +227,8 @@ UINT32 sf_adc_value_get(UINT32 mux, UINT32 *pval)
|
||||||
//B:0 A:0
|
//B:0 A:0
|
||||||
gpio_set_value(SF_ADC_MUXA, 0);//adc_muxa
|
gpio_set_value(SF_ADC_MUXA, 0);//adc_muxa
|
||||||
gpio_set_value(SF_ADC_MUXB, 0);//adc_muxb
|
gpio_set_value(SF_ADC_MUXB, 0);//adc_muxb
|
||||||
|
vos_util_delay_ms(1);
|
||||||
|
*pval = adc_readVoltage_channel0_avg(0, adc_device_delay_time_ms);
|
||||||
}
|
}
|
||||||
else if(SF_ADC_LI == mux)//v-li_det
|
else if(SF_ADC_LI == mux)//v-li_det
|
||||||
{
|
{
|
||||||
|
@ -229,23 +236,28 @@ UINT32 sf_adc_value_get(UINT32 mux, UINT32 *pval)
|
||||||
gpio_set_value(SF_ADC_MUXA, 1);//adc_muxa
|
gpio_set_value(SF_ADC_MUXA, 1);//adc_muxa
|
||||||
gpio_set_value(SF_ADC_MUXB, 0);//adc_muxb
|
gpio_set_value(SF_ADC_MUXB, 0);//adc_muxb
|
||||||
|
|
||||||
|
vos_util_delay_ms(1);
|
||||||
|
*pval = adc_readVoltage_channel0_avg(1, adc_device_delay_time_ms);
|
||||||
}
|
}
|
||||||
else if(SF_ADC_DC == mux)//dc12_det
|
else if(SF_ADC_DC == mux)//dc12_det
|
||||||
{
|
{
|
||||||
//B:1 A:0
|
//B:1 A:0
|
||||||
gpio_set_value(SF_ADC_MUXA, 0);//adc_muxa
|
gpio_set_value(SF_ADC_MUXA, 0);//adc_muxa
|
||||||
gpio_set_value(SF_ADC_MUXB, 1);//adc_muxb
|
gpio_set_value(SF_ADC_MUXB, 1);//adc_muxb
|
||||||
|
adc_readVoltage_channel0_avg(2, adc_device_delay_time_ms);
|
||||||
|
|
||||||
|
vos_util_delay_ms(1);
|
||||||
|
*pval = adc_readVoltage(0);
|
||||||
}
|
}
|
||||||
else if(SF_ADC_TEMP == mux)//temp_det
|
else if(SF_ADC_TEMP == mux)//temp_det
|
||||||
{
|
{
|
||||||
//B:1 A:1
|
//B:1 A:1
|
||||||
gpio_set_value(SF_ADC_MUXA, 1);//adc_muxa
|
gpio_set_value(SF_ADC_MUXA, 1);//adc_muxa
|
||||||
gpio_set_value(SF_ADC_MUXB, 1);//adc_muxb
|
gpio_set_value(SF_ADC_MUXB, 1);//adc_muxb
|
||||||
|
vos_util_delay_ms(1);
|
||||||
|
*pval = adc_readVoltage_channel0_avg(3, adc_device_delay_time_ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
vos_util_delay_ms(1);
|
|
||||||
|
|
||||||
*pval = adc_readVoltage(0);
|
|
||||||
//*pval = adc_readData(0);
|
//*pval = adc_readData(0);
|
||||||
//printf("[%s:%d] *pval:%d\n", __FUNCTION__, __LINE__,*pval);
|
//printf("[%s:%d] *pval:%d\n", __FUNCTION__, __LINE__,*pval);
|
||||||
getAdcFlg = 0;
|
getAdcFlg = 0;
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#define MSG_BLE_END_FIX 0xFFEE
|
#define MSG_BLE_END_FIX 0xFFEE
|
||||||
#define MSG_APP_2_BLE 0
|
#define MSG_APP_2_BLE 0
|
||||||
#define MSG_BLE_2_APP 1
|
#define MSG_BLE_2_APP 1
|
||||||
#define SF_HW_TYPE "REVEAL-X3.0"
|
#define SF_HW_TYPE "reveal-x-pro3.0"
|
||||||
#define SF_WIFI_AP_PWD_LEN 16
|
#define SF_WIFI_AP_PWD_LEN 16
|
||||||
#define SF_WIFI_AP_SSID_LEN 16
|
#define SF_WIFI_AP_SSID_LEN 16
|
||||||
|
|
||||||
|
@ -195,14 +195,18 @@ static void sf_blue_command_get_camera_para(MSG_DEV_BLE_Param_Get_Rsp_T *CamPara
|
||||||
{
|
{
|
||||||
CamPara->imageSize = 2;
|
CamPara->imageSize = 2;
|
||||||
}
|
}
|
||||||
/*else if(PHOTO_SIZE_16M == puiPara->ImgSize)
|
else if(PHOTO_SIZE_24M == puiPara->ImgSize)
|
||||||
{
|
{
|
||||||
CamPara->imageSize = 3;
|
CamPara->imageSize = 3;
|
||||||
}
|
}
|
||||||
else if(PHOTO_SIZE_32M == puiPara->ImgSize)
|
else if(PHOTO_SIZE_32M == puiPara->ImgSize)
|
||||||
{
|
{
|
||||||
CamPara->imageSize = 2;
|
CamPara->imageSize = 4;
|
||||||
}*/
|
}
|
||||||
|
else if(PHOTO_SIZE_40M == puiPara->ImgSize)
|
||||||
|
{
|
||||||
|
CamPara->imageSize = 5;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CamPara->imageSize = 2;
|
CamPara->imageSize = 2;
|
||||||
|
@ -516,15 +520,18 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8
|
||||||
{
|
{
|
||||||
puiPara->ImgSize = PHOTO_SIZE_8M;
|
puiPara->ImgSize = PHOTO_SIZE_8M;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
else if(tmpValue == 3)
|
else if(tmpValue == 3)
|
||||||
{
|
{
|
||||||
puiPara->ImgSize = PHOTO_SIZE_16M;
|
puiPara->ImgSize = PHOTO_SIZE_24M;
|
||||||
}
|
}
|
||||||
else if(tmpValue == 2)
|
else if(tmpValue == 4)
|
||||||
{
|
{
|
||||||
puiPara->ImgSize = PHOTO_SIZE_32M;
|
puiPara->ImgSize = PHOTO_SIZE_32M;
|
||||||
}*/
|
}
|
||||||
|
else if(tmpValue == 5)
|
||||||
|
{
|
||||||
|
puiPara->ImgSize = PHOTO_SIZE_40M;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
puiPara->ImgSize = PHOTO_SIZE_8M;
|
puiPara->ImgSize = PHOTO_SIZE_8M;
|
||||||
|
@ -662,27 +669,44 @@ static signed int sf_blue_command_request_process(U8 *val, unsigned int nval, U8
|
||||||
puiPara->TimeSend1.Min = pMsgStruct->msgBuf.setSendType.sendFirstTimeM % 60;
|
puiPara->TimeSend1.Min = pMsgStruct->msgBuf.setSendType.sendFirstTimeM % 60;
|
||||||
puiPara->TimeSend2.Hour = pMsgStruct->msgBuf.setSendType.sendSecondTimeH % 24;
|
puiPara->TimeSend2.Hour = pMsgStruct->msgBuf.setSendType.sendSecondTimeH % 24;
|
||||||
puiPara->TimeSend2.Min = pMsgStruct->msgBuf.setSendType.sendSecondTimeM % 60;
|
puiPara->TimeSend2.Min = pMsgStruct->msgBuf.setSendType.sendSecondTimeM % 60;
|
||||||
|
puiPara->TimeSend3.Hour = pMsgStruct->msgBuf.setSendType.sendThirdTimeH % 24;
|
||||||
|
puiPara->TimeSend3.Min = pMsgStruct->msgBuf.setSendType.sendThirdTimeM % 60;
|
||||||
|
puiPara->TimeSend4.Hour = pMsgStruct->msgBuf.setSendType.sendFourthTimeH % 24;
|
||||||
|
puiPara->TimeSend4.Min = pMsgStruct->msgBuf.setSendType.sendFourthTimeM % 60;
|
||||||
if(puiPara->SendType == 0)
|
if(puiPara->SendType == 0)
|
||||||
{
|
{
|
||||||
puiPara->TimeSend1Switch = 0;
|
puiPara->TimeSend1Switch = 0;
|
||||||
puiPara->TimeSend2Switch = 0;
|
puiPara->TimeSend2Switch = 0;
|
||||||
//puiPara->TimeSend3 = 0;
|
puiPara->TimeSend3Switch = 0;
|
||||||
//puiPara->TimeSend4 = 0;
|
puiPara->TimeSend4Switch = 0;
|
||||||
}
|
}
|
||||||
else if(puiPara->SendType == 1)
|
else if(puiPara->SendType == 1)
|
||||||
{
|
{
|
||||||
puiPara->TimeSend1Switch = 1;
|
puiPara->TimeSend1Switch = 1;
|
||||||
puiPara->TimeSend2Switch = 0;
|
puiPara->TimeSend2Switch = 0;
|
||||||
//puiPara->TimeSend3 = 0;
|
puiPara->TimeSend3Switch = 0;
|
||||||
//puiPara->TimeSend4 = 0;
|
puiPara->TimeSend4Switch = 0;
|
||||||
}
|
}
|
||||||
else // if(puiPara->SendType == 2)
|
else if(puiPara->SendType == 2)
|
||||||
{
|
{
|
||||||
puiPara->TimeSend1Switch = 1;
|
puiPara->TimeSend1Switch = 1;
|
||||||
puiPara->TimeSend2Switch = 1;
|
puiPara->TimeSend2Switch = 1;
|
||||||
|
puiPara->TimeSend3Switch = 0;
|
||||||
|
puiPara->TimeSend4Switch = 0;
|
||||||
}
|
}
|
||||||
MLOGI("SendType:%d TimeSend1Switch:%d %02d:%02d TimeSend2Switch:%d %02d:%02d\n",puiPara->SendType,puiPara->TimeSend1Switch,puiPara->TimeSend1.Hour,puiPara->TimeSend1.Min,puiPara->TimeSend2Switch, puiPara->TimeSend2.Hour,puiPara->TimeSend2.Min);
|
else if(puiPara->SendType == 4)
|
||||||
|
{
|
||||||
|
puiPara->TimeSend1Switch = 1;
|
||||||
|
puiPara->TimeSend2Switch = 1;
|
||||||
|
puiPara->TimeSend3Switch = 1;
|
||||||
|
puiPara->TimeSend4Switch = 1;
|
||||||
|
}
|
||||||
|
MLOGI("SendType:%d TimeSend1Switch:%d %02d:%02d TimeSend2Switch:%d %02d:%02d TimeSend3Switch:%d %02d:%02d TimeSend4Switch:%d %02d:%02d\n",
|
||||||
|
puiPara->SendType,
|
||||||
|
puiPara->TimeSend1Switch, puiPara->TimeSend1.Hour,puiPara->TimeSend1.Min,
|
||||||
|
puiPara->TimeSend2Switch, puiPara->TimeSend2.Hour,puiPara->TimeSend2.Min,
|
||||||
|
puiPara->TimeSend3Switch, puiPara->TimeSend3.Hour,puiPara->TimeSend3.Min,
|
||||||
|
puiPara->TimeSend4Switch, puiPara->TimeSend4.Hour,puiPara->TimeSend4.Min);
|
||||||
|
|
||||||
}
|
}
|
||||||
respFlag = 2;
|
respFlag = 2;
|
||||||
|
|
|
@ -278,6 +278,10 @@ typedef struct
|
||||||
UINT8 sendFirstTimeM; /* 0~59 (12小时和 24小时共用) */
|
UINT8 sendFirstTimeM; /* 0~59 (12小时和 24小时共用) */
|
||||||
UINT8 sendSecondTimeH; /* 0~23 */
|
UINT8 sendSecondTimeH; /* 0~23 */
|
||||||
UINT8 sendSecondTimeM; /* 0~59 */
|
UINT8 sendSecondTimeM; /* 0~59 */
|
||||||
|
UINT8 sendThirdTimeH; /* 0~23 */
|
||||||
|
UINT8 sendThirdTimeM; /* 0~59 */
|
||||||
|
UINT8 sendFourthTimeH; /* 0~23 */
|
||||||
|
UINT8 sendFourthTimeM; /* 0~59 */
|
||||||
UINT16 suffix; /* 0xFFEE */
|
UINT16 suffix; /* 0xFFEE */
|
||||||
} __attribute__((packed)) MSG_DEV_BLE_SendType_Set_T;
|
} __attribute__((packed)) MSG_DEV_BLE_SendType_Set_T;
|
||||||
|
|
||||||
|
|
|
@ -789,7 +789,7 @@ int sf_app_sd_loop(void)
|
||||||
remove(cFileTmp);
|
remove(cFileTmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(iFileCount % 30 == 0)
|
if(iFileCount % 20 == 0)
|
||||||
{
|
{
|
||||||
//sf_get_sd_info(&sdStatus, &sdFree, &sdTotal);
|
//sf_get_sd_info(&sdStatus, &sdFree, &sdTotal);
|
||||||
sf_sd_info_get(&storeattrs);
|
sf_sd_info_get(&storeattrs);
|
||||||
|
|
|
@ -209,7 +209,7 @@ SINT32 sf_sys_rtc_time_check(SF_PARA_TIME_S *pstDateTime)
|
||||||
{
|
{
|
||||||
SF_COMM_CHECK_POINTER(pstDateTime,SF_FALSE);
|
SF_COMM_CHECK_POINTER(pstDateTime,SF_FALSE);
|
||||||
SLOGI("%d-%d-%d %d:%d:%d\n",pstDateTime->Year,pstDateTime->Mon,pstDateTime->Day,pstDateTime->Hour,pstDateTime->Min,pstDateTime->Sec);
|
SLOGI("%d-%d-%d %d:%d:%d\n",pstDateTime->Year,pstDateTime->Mon,pstDateTime->Day,pstDateTime->Hour,pstDateTime->Min,pstDateTime->Sec);
|
||||||
if((pstDateTime->Year >= 2021) && \
|
if((pstDateTime->Year >= 2023) && \
|
||||||
(pstDateTime->Year <= 2050) && \
|
(pstDateTime->Year <= 2050) && \
|
||||||
(pstDateTime->Mon <= 12) && \
|
(pstDateTime->Mon <= 12) && \
|
||||||
(pstDateTime->Day <= 31) && \
|
(pstDateTime->Day <= 31) && \
|
||||||
|
@ -235,12 +235,13 @@ SINT32 sf_sys_rtc_time_reset(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct rtc_time rtctm;
|
struct rtc_time rtctm;
|
||||||
rtctm.tm_year = 2022 - 1900;
|
rtctm.tm_year = 2023 - 1900;
|
||||||
rtctm.tm_mon = 0;
|
rtctm.tm_mon = 1;
|
||||||
rtctm.tm_mday = 1;
|
rtctm.tm_mday = 1;
|
||||||
rtctm.tm_hour = 8;
|
rtctm.tm_hour = 8;
|
||||||
rtctm.tm_min = 0;
|
rtctm.tm_min = 0;
|
||||||
rtctm.tm_sec = 0;
|
rtctm.tm_sec = 0;
|
||||||
|
SLOGI("%d-%d-%d %d:%d:%d\n",rtctm.tm_year+1900,rtctm.tm_mon,rtctm.tm_mday,rtctm.tm_hour,rtctm.tm_min,rtctm.tm_sec);
|
||||||
|
|
||||||
ret=ioctl(fdRtc,RTC_SET_TIME, &rtctm);
|
ret=ioctl(fdRtc,RTC_SET_TIME, &rtctm);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
@ -371,7 +372,7 @@ SINT32 sf_sys_rtoscmd_set(SINT8 cmd, SINT8 *para)
|
||||||
if(SF_TRUE != sf_sys_rtc_time_check(&date))
|
if(SF_TRUE != sf_sys_rtc_time_check(&date))
|
||||||
{
|
{
|
||||||
ret = sf_sys_rtc_time_reset();
|
ret = sf_sys_rtc_time_reset();
|
||||||
date.Year = 2022;
|
date.Year = 2023;
|
||||||
date.Mon = 1;
|
date.Mon = 1;
|
||||||
date.Day = 1;
|
date.Day = 1;
|
||||||
date.Hour = 8;
|
date.Hour = 8;
|
||||||
|
|
|
@ -823,7 +823,7 @@ void sf_app_Get_Camera_Info(MSG_DEV_INFO_Get_Rsp_T *camInfo)
|
||||||
//camInfo->GpsLongitude = htonl(0);
|
//camInfo->GpsLongitude = htonl(0);
|
||||||
//camInfo->GpsLatitude = htonl(0);
|
//camInfo->GpsLatitude = htonl(0);
|
||||||
#endif
|
#endif
|
||||||
strcpy((char *)camInfo->hwType, "reveal-x");
|
strcpy((char *)camInfo->hwType, "reveal-x-pro3.0");
|
||||||
//S8 strTemp[16]= {0};
|
//S8 strTemp[16]= {0};
|
||||||
//sf_get_sys_version(strTemp);
|
//sf_get_sys_version(strTemp);
|
||||||
|
|
||||||
|
@ -895,14 +895,18 @@ void sf_app_Get_Camera_Para(MSG_DEV_Param_Get_Rsp_T *CamPara)
|
||||||
{
|
{
|
||||||
CamPara->imageSize = 2;
|
CamPara->imageSize = 2;
|
||||||
}
|
}
|
||||||
/*else if(PHOTO_SIZE_16M == puiPara->ImgSize)
|
else if(PHOTO_SIZE_24M == puiPara->ImgSize)
|
||||||
{
|
{
|
||||||
CamPara->imageSize = 3;
|
CamPara->imageSize = 3;
|
||||||
}
|
}
|
||||||
else if(PHOTO_SIZE_32M == puiPara->ImgSize)
|
else if(PHOTO_SIZE_32M == puiPara->ImgSize)
|
||||||
{
|
{
|
||||||
CamPara->imageSize = 2;
|
CamPara->imageSize = 4;
|
||||||
}*/
|
}
|
||||||
|
else if(PHOTO_SIZE_40M == puiPara->ImgSize)
|
||||||
|
{
|
||||||
|
CamPara->imageSize = 5;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CamPara->imageSize = 2;
|
CamPara->imageSize = 2;
|
||||||
|
@ -1399,31 +1403,34 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
MLOGI("[WIFI_SET_CAMERA_ImageSize],ImgSize:%d\n",puiPara->ImgSize);
|
MLOGI("[WIFI_SET_CAMERA_ImageSize],ImgSize:%d\n",puiPara->ImgSize);
|
||||||
tmpValue = pMsgStruct->msgBuf.setImageSize.imageSize;
|
tmpValue = pMsgStruct->msgBuf.setImageSize.imageSize;
|
||||||
|
|
||||||
if(tmpValue == 0)
|
if(tmpValue == 0)
|
||||||
{
|
{
|
||||||
puiPara->ImgSize = PHOTO_SIZE_16M;
|
puiPara->ImgSize = PHOTO_SIZE_16M;
|
||||||
}
|
}
|
||||||
else if(tmpValue == 1)
|
else if(tmpValue == 1)
|
||||||
{
|
{
|
||||||
puiPara->ImgSize = PHOTO_SIZE_12M;
|
puiPara->ImgSize = PHOTO_SIZE_12M;
|
||||||
}
|
}
|
||||||
else if(tmpValue == 2)
|
else if(tmpValue == 2)
|
||||||
{
|
{
|
||||||
puiPara->ImgSize = PHOTO_SIZE_8M;
|
puiPara->ImgSize = PHOTO_SIZE_8M;
|
||||||
}
|
}
|
||||||
/*
|
else if(tmpValue == 3)
|
||||||
else if(tmpValue == 3)
|
{
|
||||||
{
|
puiPara->ImgSize = PHOTO_SIZE_24M;
|
||||||
puiPara->ImgSize = PHOTO_SIZE_16M;
|
}
|
||||||
}
|
else if(tmpValue == 4)
|
||||||
else if(tmpValue == 2)
|
{
|
||||||
{
|
puiPara->ImgSize = PHOTO_SIZE_32M;
|
||||||
puiPara->ImgSize = PHOTO_SIZE_32M;
|
}
|
||||||
}*/
|
else if(tmpValue == 5)
|
||||||
else
|
{
|
||||||
{
|
puiPara->ImgSize = PHOTO_SIZE_40M;
|
||||||
puiPara->ImgSize = PHOTO_SIZE_8M;
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
puiPara->ImgSize = PHOTO_SIZE_8M;
|
||||||
|
}
|
||||||
SysSetFlag(FL_PHOTO_SIZE, puiPara->ImgSize);
|
SysSetFlag(FL_PHOTO_SIZE, puiPara->ImgSize);
|
||||||
Photo_SetUserIndex(PHOTO_USR_SIZE, puiPara->ImgSize);
|
Photo_SetUserIndex(PHOTO_USR_SIZE, puiPara->ImgSize);
|
||||||
//sf_set_img_size(puiPara->ImgSize);
|
//sf_set_img_size(puiPara->ImgSize);
|
||||||
|
@ -1554,32 +1561,49 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
MLOGI("[WIFI_SET_CAMERA_SendType],sendType:%d\n",pMsgStruct->msgBuf.setSendType.sendType);
|
MLOGI("[WIFI_SET_CAMERA_SendType],sendType:%d\n",pMsgStruct->msgBuf.setSendType.sendType);
|
||||||
if(puiPara->GprsMode == 0)
|
if(puiPara->GprsMode == 0)
|
||||||
{
|
{
|
||||||
puiPara->SendType = pMsgStruct->msgBuf.setSendType.sendType % 3;
|
puiPara->SendType = pMsgStruct->msgBuf.setSendType.sendType % 3;
|
||||||
puiPara->TimeSend1.Hour = pMsgStruct->msgBuf.setSendType.sendFirstTimeH % 24;
|
puiPara->TimeSend1.Hour = pMsgStruct->msgBuf.setSendType.sendFirstTimeH % 24;
|
||||||
puiPara->TimeSend1.Min = pMsgStruct->msgBuf.setSendType.sendFirstTimeM % 60;
|
puiPara->TimeSend1.Min = pMsgStruct->msgBuf.setSendType.sendFirstTimeM % 60;
|
||||||
puiPara->TimeSend2.Hour = pMsgStruct->msgBuf.setSendType.sendSecondTimeH % 24;
|
puiPara->TimeSend2.Hour = pMsgStruct->msgBuf.setSendType.sendSecondTimeH % 24;
|
||||||
puiPara->TimeSend2.Min = pMsgStruct->msgBuf.setSendType.sendSecondTimeM % 60;
|
puiPara->TimeSend2.Min = pMsgStruct->msgBuf.setSendType.sendSecondTimeM % 60;
|
||||||
|
puiPara->TimeSend3.Hour = pMsgStruct->msgBuf.setSendType.sendThirdTimeH % 24;
|
||||||
if(puiPara->SendType == 0)
|
puiPara->TimeSend3.Min = pMsgStruct->msgBuf.setSendType.sendThirdTimeM % 60;
|
||||||
{
|
puiPara->TimeSend4.Hour = pMsgStruct->msgBuf.setSendType.sendFourthTimeH % 24;
|
||||||
puiPara->TimeSend1Switch = 0;
|
puiPara->TimeSend4.Min = pMsgStruct->msgBuf.setSendType.sendFourthTimeM % 60;
|
||||||
puiPara->TimeSend2Switch = 0;
|
if(puiPara->SendType == 0)
|
||||||
//puiPara->TimeSend3 = 0;
|
{
|
||||||
//puiPara->TimeSend4 = 0;
|
puiPara->TimeSend1Switch = 0;
|
||||||
}
|
puiPara->TimeSend2Switch = 0;
|
||||||
else if(puiPara->SendType == 1)
|
puiPara->TimeSend3Switch = 0;
|
||||||
{
|
puiPara->TimeSend4Switch = 0;
|
||||||
puiPara->TimeSend1Switch = 1;
|
}
|
||||||
puiPara->TimeSend2Switch = 0;
|
else if(puiPara->SendType == 1)
|
||||||
//puiPara->TimeSend3 = 0;
|
{
|
||||||
//puiPara->TimeSend4 = 0;
|
puiPara->TimeSend1Switch = 1;
|
||||||
}
|
puiPara->TimeSend2Switch = 0;
|
||||||
else // if(puiPara->SendType == 2)
|
puiPara->TimeSend3Switch = 0;
|
||||||
{
|
puiPara->TimeSend4Switch = 0;
|
||||||
puiPara->TimeSend1Switch = 1;
|
}
|
||||||
puiPara->TimeSend2Switch = 1;
|
else if(puiPara->SendType == 2)
|
||||||
}
|
{
|
||||||
MLOGI("SendType:%d TimeSend1Switch:%d %02d:%02d TimeSend2Switch:%d %02d:%02d\n",puiPara->SendType,puiPara->TimeSend1Switch,puiPara->TimeSend1.Hour,puiPara->TimeSend1.Min,puiPara->TimeSend2Switch, puiPara->TimeSend2.Hour,puiPara->TimeSend2.Min);
|
puiPara->TimeSend1Switch = 1;
|
||||||
|
puiPara->TimeSend2Switch = 1;
|
||||||
|
puiPara->TimeSend3Switch = 0;
|
||||||
|
puiPara->TimeSend4Switch = 0;
|
||||||
|
}
|
||||||
|
else if(puiPara->SendType == 4)
|
||||||
|
{
|
||||||
|
puiPara->TimeSend1Switch = 1;
|
||||||
|
puiPara->TimeSend2Switch = 1;
|
||||||
|
puiPara->TimeSend3Switch = 1;
|
||||||
|
puiPara->TimeSend4Switch = 1;
|
||||||
|
}
|
||||||
|
MLOGI("SendType:%d TimeSend1Switch:%d %02d:%02d TimeSend2Switch:%d %02d:%02d TimeSend3Switch:%d %02d:%02d TimeSend4Switch:%d %02d:%02d\n",
|
||||||
|
puiPara->SendType,
|
||||||
|
puiPara->TimeSend1Switch, puiPara->TimeSend1.Hour,puiPara->TimeSend1.Min,
|
||||||
|
puiPara->TimeSend2Switch, puiPara->TimeSend2.Hour,puiPara->TimeSend2.Min,
|
||||||
|
puiPara->TimeSend3Switch, puiPara->TimeSend3.Hour,puiPara->TimeSend3.Min,
|
||||||
|
puiPara->TimeSend4Switch, puiPara->TimeSend4.Hour,puiPara->TimeSend4.Min);
|
||||||
|
|
||||||
}
|
}
|
||||||
respFlag = 2;
|
respFlag = 2;
|
||||||
|
@ -1930,7 +1954,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
case WIFI_CONTROL_CAMERA_SHOOT:
|
case WIFI_CONTROL_CAMERA_SHOOT:
|
||||||
MLOGI("[WIFI_SET_CAMERA_SHOOT] shoot:%d\n",pMsgStruct->msgBuf.ctrlShoot.shoot);
|
MLOGI("[WIFI_SET_CAMERA_SHOOT] shoot:%d\n",pMsgStruct->msgBuf.ctrlShoot.shoot);
|
||||||
|
|
||||||
if((TRUE == sf_is_preview()) && (pMsgStruct->msgBuf.ctrlShoot.shoot <= 3))
|
if((System_GetState(SYS_STATE_CARD) == CARD_INSERTED) && (TRUE == sf_is_preview()) && (pMsgStruct->msgBuf.ctrlShoot.shoot <= 3))
|
||||||
{
|
{
|
||||||
if((puiPara->CamMode != 1) && (pMsgStruct->msgBuf.ctrlShoot.shoot < 3))
|
if((puiPara->CamMode != 1) && (pMsgStruct->msgBuf.ctrlShoot.shoot < 3))
|
||||||
{
|
{
|
||||||
|
|
|
@ -379,6 +379,7 @@ extern UINT32 adc_readData(ADC_CHANNEL Channel);
|
||||||
extern BOOL adc_isDataReady(ADC_CHANNEL Channel);
|
extern BOOL adc_isDataReady(ADC_CHANNEL Channel);
|
||||||
extern void adc_clearDataReady(ADC_CHANNEL Channel);
|
extern void adc_clearDataReady(ADC_CHANNEL Channel);
|
||||||
extern UINT32 adc_readVoltage(ADC_CHANNEL Channel);
|
extern UINT32 adc_readVoltage(ADC_CHANNEL Channel);
|
||||||
|
extern UINT32 adc_readVoltage_channel0_avg(UINT32 device_id, UINT32 delay_time_ms);
|
||||||
|
|
||||||
extern UINT32 adc_thermal_read_data(void);
|
extern UINT32 adc_thermal_read_data(void);
|
||||||
extern UINT32 adc_thermal_read_voltage(void);
|
extern UINT32 adc_thermal_read_voltage(void);
|
||||||
|
|
BIN
code/lib/source/io/libio.a
Normal file → Executable file
BIN
code/lib/source/io/libio.a
Normal file → Executable file
Binary file not shown.
Binary file not shown.
|
@ -156,5 +156,7 @@ BOOL sf_ota_trigger(void);
|
||||||
BOOL sf_ota_result(void);
|
BOOL sf_ota_result(void);
|
||||||
SF_BLE_STATUS_E sf_get_ble_status(void);
|
SF_BLE_STATUS_E sf_get_ble_status(void);
|
||||||
void sf_set_ble_status(SF_BLE_STATUS_E enStatus);
|
void sf_set_ble_status(SF_BLE_STATUS_E enStatus);
|
||||||
|
BOOL cmd_wifi_switch(unsigned char argc, char **argv);
|
||||||
|
void sf_set_msdc_clk(void);
|
||||||
void sf_send_message_to_create_qrcode(void);
|
void sf_send_message_to_create_qrcode(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -95,7 +95,7 @@ static pthread_mutex_t Param_mutexLock;
|
||||||
static int shared_condition = 1;
|
static int shared_condition = 1;
|
||||||
static SINT32 WifiSocket = 0;
|
static SINT32 WifiSocket = 0;
|
||||||
static UINT8 UiparaFlag = 0;
|
static UINT8 UiparaFlag = 0;
|
||||||
static SF_BLE_STATUS_E BleStatus = SF_BLE_BUTT;
|
static SF_BLE_STATUS_E BleStatus = SF_BLE_OK;
|
||||||
|
|
||||||
static SF_THREAD_S UpgradeTskParam =
|
static SF_THREAD_S UpgradeTskParam =
|
||||||
{
|
{
|
||||||
|
@ -1601,7 +1601,7 @@ static const SF_CHAR* sf_process_message_getstatusstring(SF_MESSAGE_TYPE_E enTyp
|
||||||
}
|
}
|
||||||
static SINT32 sf_cardv_proccess_cmd_mcu(SF_MESSAGE_BUF_S *pMessageBuf)
|
static SINT32 sf_cardv_proccess_cmd_mcu(SF_MESSAGE_BUF_S *pMessageBuf)
|
||||||
{
|
{
|
||||||
static UINT8 wifistart = 0;
|
// static UINT8 wifistart = 0;
|
||||||
UINT8 powerOnMode = 0;
|
UINT8 powerOnMode = 0;
|
||||||
|
|
||||||
//printf("[%s:%d] ID = %#x\n", __FUNCTION__, __LINE__,pMessageBuf->arg1);
|
//printf("[%s:%d] ID = %#x\n", __FUNCTION__, __LINE__,pMessageBuf->arg1);
|
||||||
|
@ -1624,19 +1624,19 @@ static SINT32 sf_cardv_proccess_cmd_mcu(SF_MESSAGE_BUF_S *pMessageBuf)
|
||||||
sf_set_mcu_ver(pMessageBuf->arg3);
|
sf_set_mcu_ver(pMessageBuf->arg3);
|
||||||
MLOGI("%d.%d.%d\n",(pMessageBuf->arg3>>4)&0x0F, pMessageBuf->arg3 & 0x0F, pMessageBuf->arg2);
|
MLOGI("%d.%d.%d\n",(pMessageBuf->arg3>>4)&0x0F, pMessageBuf->arg3 & 0x0F, pMessageBuf->arg2);
|
||||||
|
|
||||||
if((0 == sf_get_fw_update()) && (sf_get_mode_flag()) && (0 == wifistart))
|
// if((0 == sf_get_fw_update()) && (sf_get_mode_flag()) && (0 == wifistart))
|
||||||
{
|
// {
|
||||||
wifistart = 1;
|
// wifistart = 1;
|
||||||
GOIO_Turn_Onoff_IRCUT(1);
|
// GOIO_Turn_Onoff_IRCUT(1);
|
||||||
/*wifi init*/
|
// /*wifi init*/
|
||||||
//stMessageBuf.arg1 = SF_WIFI_CMD_START;
|
// //stMessageBuf.arg1 = SF_WIFI_CMD_START;
|
||||||
//stMessageBuf.cmdId = CMD_WIFI;
|
// //stMessageBuf.cmdId = CMD_WIFI;
|
||||||
//sf_com_message_send_to_cardv(&stMessageBuf);
|
// //sf_com_message_send_to_cardv(&stMessageBuf);
|
||||||
sf_cardv_wifi_start();
|
// sf_cardv_wifi_start();
|
||||||
//Ux_SendEvent(0, NVTEVT_EXE_WIFI_START, 0);
|
// //Ux_SendEvent(0, NVTEVT_EXE_WIFI_START, 0);
|
||||||
//sleep(2);
|
// //sleep(2);
|
||||||
//sf_apinfo_thread_init();
|
// //sf_apinfo_thread_init();
|
||||||
}
|
// }
|
||||||
break;
|
break;
|
||||||
case SF_MCU_CMD_MCU_RTC:
|
case SF_MCU_CMD_MCU_RTC:
|
||||||
|
|
||||||
|
@ -1708,7 +1708,6 @@ static SINT32 sf_cardv_proccess_cmd_para_update(SF_MESSAGE_BUF_S *pMessageBuf)
|
||||||
case SF_PARA_CMD_BLE:
|
case SF_PARA_CMD_BLE:
|
||||||
sf_set_ble_status(pMessageBuf->arg2);
|
sf_set_ble_status(pMessageBuf->arg2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SF_PARA_CMD_SIMISINSERT:
|
case SF_PARA_CMD_SIMISINSERT:
|
||||||
sf_cardv_set_sim_insert(pMessageBuf->arg2);
|
sf_cardv_set_sim_insert(pMessageBuf->arg2);
|
||||||
break;
|
break;
|
||||||
|
@ -1796,14 +1795,17 @@ static SINT32 sf_cardv_proccess_cmd_file(SF_MESSAGE_BUF_S *pMessageBuf)
|
||||||
static SINT32 sf_cardv_proccess_cmd_dev(SF_MESSAGE_BUF_S *pMessageBuf)
|
static SINT32 sf_cardv_proccess_cmd_dev(SF_MESSAGE_BUF_S *pMessageBuf)
|
||||||
{
|
{
|
||||||
//printf("[%s:%d] ID = %#x\n", __FUNCTION__, __LINE__,pMessageBuf->arg1);
|
//printf("[%s:%d] ID = %#x\n", __FUNCTION__, __LINE__,pMessageBuf->arg1);
|
||||||
MLOGI("ID = %#x\n",pMessageBuf->arg1);
|
if(pMessageBuf->arg1 != SF_DEV_CMD_TEMPER)
|
||||||
|
{
|
||||||
|
MLOGI("ID = %#x\n",pMessageBuf->arg1);
|
||||||
|
}
|
||||||
//SF_MESSAGE_BUF_S stMessageBuf = {0};
|
//SF_MESSAGE_BUF_S stMessageBuf = {0};
|
||||||
switch(pMessageBuf->arg1)
|
switch(pMessageBuf->arg1)
|
||||||
{
|
{
|
||||||
case SF_DEV_CMD_TEMPER:
|
case SF_DEV_CMD_TEMPER:
|
||||||
cTemper = pMessageBuf->arg2;
|
cTemper = pMessageBuf->arg2;
|
||||||
fTemper = pMessageBuf->arg3;
|
fTemper = pMessageBuf->arg3;
|
||||||
MLOGI("cTemper:%d fTemper:%d\n",cTemper,fTemper);
|
//MLOGI("cTemper:%d fTemper:%d\n",cTemper,fTemper);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case SF_DEV_CMD_BAT:
|
case SF_DEV_CMD_BAT:
|
||||||
|
@ -1874,7 +1876,7 @@ void* sf_cardv_message_thread(void *argv)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(CMD_MCU != stMessagebuf.cmdId)
|
if((CMD_DEV != stMessagebuf.cmdId) && (CMD_MCU != stMessagebuf.cmdId))
|
||||||
{
|
{
|
||||||
MLOGI("cmdId:[%#x,%s]\n",stMessagebuf.cmdId,sf_process_message_getstatusstring(stMessagebuf.cmdId));
|
MLOGI("cmdId:[%#x,%s]\n",stMessagebuf.cmdId,sf_process_message_getstatusstring(stMessagebuf.cmdId));
|
||||||
}
|
}
|
||||||
|
@ -2614,20 +2616,26 @@ void* sf_cardv_wifi_thread(void *arg)
|
||||||
UINT32 sf_cardv_wifi_start(void)
|
UINT32 sf_cardv_wifi_start(void)
|
||||||
{
|
{
|
||||||
SINT32 ret = 1;
|
SINT32 ret = 1;
|
||||||
if(WifiTskCfg.IsRun)
|
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
||||||
{
|
|
||||||
SLOGE("thread has already run !!!\n");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
ret = pthread_create(&WifiTskCfg.TskId, NULL, sf_cardv_wifi_thread, NULL);
|
|
||||||
if(ret != SF_SUCCESS)
|
|
||||||
{
|
|
||||||
MLOGD("thread creat fail!\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
WifiTskCfg.IsRun = 1;
|
|
||||||
return SF_SUCCESS;
|
|
||||||
|
|
||||||
|
if((0 == sf_get_fw_update()) && (sf_get_mode_flag()) && (puiPara->WifiSwitch))
|
||||||
|
{
|
||||||
|
if(WifiTskCfg.IsRun)
|
||||||
|
{
|
||||||
|
SLOGE("thread has already run !!!\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
ret = pthread_create(&WifiTskCfg.TskId, NULL, sf_cardv_wifi_thread, NULL);
|
||||||
|
if(ret != SF_SUCCESS)
|
||||||
|
{
|
||||||
|
MLOGD("thread creat fail!\n");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
WifiTskCfg.IsRun = 1;
|
||||||
|
return SF_SUCCESS;
|
||||||
|
}
|
||||||
|
SLOGE("WifiSwitch OFF\n");
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL sf_cmd_disp_para_set(unsigned char argc, char **argv)
|
BOOL sf_cmd_disp_para_set(unsigned char argc, char **argv)
|
||||||
|
@ -3140,9 +3148,13 @@ BOOL sf_cmd_para_printf(unsigned char argc, char **argv)
|
||||||
printf("BatteryLogSwitch:%d\n", puiPara->BatteryLogSwitch);
|
printf("BatteryLogSwitch:%d\n", puiPara->BatteryLogSwitch);
|
||||||
printf("GpsNumber:%d\n", puiPara->GpsNumber);
|
printf("GpsNumber:%d\n", puiPara->GpsNumber);
|
||||||
printf("TimeSend1Switch:%d\n", puiPara->TimeSend1Switch);
|
printf("TimeSend1Switch:%d\n", puiPara->TimeSend1Switch);
|
||||||
|
printf("TimeSend1:%d:%d:%d\n", puiPara->TimeSend1.Hour,puiPara->TimeSend1.Min,puiPara->TimeSend1.Sec);
|
||||||
printf("TimeSend2Switch:%d\n", puiPara->TimeSend2Switch);
|
printf("TimeSend2Switch:%d\n", puiPara->TimeSend2Switch);
|
||||||
|
printf("TimeSend2:%d:%d:%d\n", puiPara->TimeSend2.Hour,puiPara->TimeSend2.Min,puiPara->TimeSend2.Sec);
|
||||||
printf("TimeSend3Switch:%d\n", puiPara->TimeSend3Switch);
|
printf("TimeSend3Switch:%d\n", puiPara->TimeSend3Switch);
|
||||||
|
printf("TimeSend3:%d:%d:%d\n", puiPara->TimeSend3.Hour,puiPara->TimeSend3.Min,puiPara->TimeSend3.Sec);
|
||||||
printf("TimeSend4Switch:%d\n", puiPara->TimeSend4Switch);
|
printf("TimeSend4Switch:%d\n", puiPara->TimeSend4Switch);
|
||||||
|
printf("TimeSend4:%d:%d:%d\n", puiPara->TimeSend4.Hour,puiPara->TimeSend4.Min,puiPara->TimeSend4.Sec);
|
||||||
printf("SendType:%d\n", puiPara->SendType);
|
printf("SendType:%d\n", puiPara->SendType);
|
||||||
printf("PicUpDailyReport:%d\n", puiPara->PicUpDailyReport);
|
printf("PicUpDailyReport:%d\n", puiPara->PicUpDailyReport);
|
||||||
printf("ProfileSwitchFlg:%d\n", puiPara->ProfileSwitchFlg);
|
printf("ProfileSwitchFlg:%d\n", puiPara->ProfileSwitchFlg);
|
||||||
|
@ -3212,6 +3224,19 @@ BOOL cmd_blu_switch(unsigned char argc, char **argv)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL cmd_wifi_switch(unsigned char argc, char **argv)
|
||||||
|
{
|
||||||
|
UINT32 value;
|
||||||
|
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
||||||
|
sscanf_s(argv[0],"%d", &value);
|
||||||
|
if(value < SF_ON_OFF_MAX){
|
||||||
|
puiPara->WifiSwitch = value;
|
||||||
|
|
||||||
|
Save_MenuInfo();
|
||||||
|
}
|
||||||
|
printf("[%s:%d] WifiSwitch:%d\n", __FUNCTION__, __LINE__,puiPara->WifiSwitch);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
SF_BLE_STATUS_E sf_get_ble_status(void)
|
SF_BLE_STATUS_E sf_get_ble_status(void)
|
||||||
{
|
{
|
||||||
|
@ -3231,6 +3256,12 @@ void sf_set_ble_status(SF_BLE_STATUS_E enStatus)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sf_set_msdc_clk(void)
|
||||||
|
{
|
||||||
|
printf("[%s:%d] s\n", __FUNCTION__, __LINE__);
|
||||||
|
system("echo 24000000 > /sys/kernel/debug/mmc0/clock");
|
||||||
|
printf("[%s:%d] e \n", __FUNCTION__, __LINE__);
|
||||||
|
}
|
||||||
void sf_send_message_to_create_qrcode(void)
|
void sf_send_message_to_create_qrcode(void)
|
||||||
{
|
{
|
||||||
SF_MESSAGE_BUF_S stMessageBuf = {0};
|
SF_MESSAGE_BUF_S stMessageBuf = {0};
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
/* lcd_standby = <gpio level>; ==> optional for the circuit design*/
|
/* lcd_standby = <gpio level>; ==> optional for the circuit design*/
|
||||||
|
|
||||||
/ {
|
/ {
|
||||||
display { type = "lcd"; lcd_ctrl = <1>; sif_channel = <4>; gpio_cs = <P_GPIO(7)>; gpio_clk = <P_GPIO(8)>; gpio_data = <P_GPIO(9)>; };
|
display { type = "lcd"; lcd_ctrl = <1>; sif_channel = <4>; gpio_cs = <P_GPIO(6)>; gpio_clk = <P_GPIO(8)>; gpio_data = <P_GPIO(9)>; };
|
||||||
logo { enable = <1>; lcd_type = <PINMUX_LCD_SEL_SERIAL_RGB_6BITS>; lcd_rotate = <270>; lcd_reset = <L_GPIO(1)>; lcd_bl_gpio = <S_GPIO(3) 1>; lcd_power = <P_GPIO(8) 1>;};
|
logo { enable = <1>; lcd_type = <PINMUX_LCD_SEL_SERIAL_RGB_6BITS>; lcd_rotate = <270>; lcd_reset = <L_GPIO(1)>; lcd_bl_gpio = <S_GPIO(3) 1>; lcd_power = <P_GPIO(8) 1>;};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,7 @@ static BOOL prj_isSpecialKeyPressed(UINT32 ota_flag)
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else if(!(gpio_getPin(GPIO_SPECIAL_KEY2)) || prj_is_WDT_OTA() || prj_is_Flash_OTA(ota_flag))
|
else if((!(gpio_getPin(GPIO_SPECIAL_KEY2)) && (gpio_getPin(GPIO_SPECIAL_USB))) || prj_is_WDT_OTA() || prj_is_Flash_OTA(ota_flag))
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}else {
|
}else {
|
||||||
|
|
|
@ -77,7 +77,7 @@ extern void vio_setpin(UINT32 id, UINT32 v);
|
||||||
#define LCD_COMM_CTRL LCD_COMM_BY_GPIO
|
#define LCD_COMM_CTRL LCD_COMM_BY_GPIO
|
||||||
|
|
||||||
#if (LCD_COMM_CTRL == LCD_COMM_BY_GPIO)
|
#if (LCD_COMM_CTRL == LCD_COMM_BY_GPIO)
|
||||||
#define GPIO_LCD_SIF_SEN P_GPIO_7//S_GPIO_4 //FPGA
|
#define GPIO_LCD_SIF_SEN P_GPIO_6//S_GPIO_4 //FPGA
|
||||||
#define GPIO_LCD_SIF_SCK P_GPIO_8//S_GPIO_5 //FPGA
|
#define GPIO_LCD_SIF_SCK P_GPIO_8//S_GPIO_5 //FPGA
|
||||||
#define GPIO_LCD_SIF_SDA P_GPIO_9//S_GPIO_6 //FPGA
|
#define GPIO_LCD_SIF_SDA P_GPIO_9//S_GPIO_6 //FPGA
|
||||||
#endif
|
#endif
|
||||||
|
@ -183,8 +183,8 @@ extern void vio_setpin(UINT32 id, UINT32 v);
|
||||||
#define GPIO_CARD_DETECT C_GPIO_9
|
#define GPIO_CARD_DETECT C_GPIO_9
|
||||||
#define PAD_CARD_DETECT PAD_PIN_CGPIO9
|
#define PAD_CARD_DETECT PAD_PIN_CGPIO9
|
||||||
// SD card write protect
|
// SD card write protect
|
||||||
#define GPIO_CARD_WP 0//P_GPIO_11
|
#define GPIO_CARD_WP C_GPIO_5//P_GPIO_11
|
||||||
#define PAD_CARD_WP 0//PAD_PIN_PGPIO11
|
#define PAD_CARD_WP PAD_PIN_CGPIO5//PAD_PIN_PGPIO11
|
||||||
|
|
||||||
extern BOOL SDIOCardUser_CheckCardInserted(void);
|
extern BOOL SDIOCardUser_CheckCardInserted(void);
|
||||||
extern BOOL SDIOCardUser_CheckCardWP(void);
|
extern BOOL SDIOCardUser_CheckCardWP(void);
|
||||||
|
|
|
@ -109,6 +109,8 @@ extern void DrvGOIO_Turn_Onoff_IRCUT(UINT8 onoff);
|
||||||
|
|
||||||
extern int NvtMain(void);
|
extern int NvtMain(void);
|
||||||
extern void System_OnVideoFastbootInit(void);
|
extern void System_OnVideoFastbootInit(void);
|
||||||
|
extern void eac_set_ad_config(EAC_CONFIG_AD config_id, UINT32 config_value);
|
||||||
|
extern void eac_set_phypower(BOOL b_en);
|
||||||
#if (defined(_NVT_ETHREARCAM_TX_)) && (ETHCAM_EIS == ENABLE)
|
#if (defined(_NVT_ETHREARCAM_TX_)) && (ETHCAM_EIS == ENABLE)
|
||||||
extern int gyro_init(void);
|
extern int gyro_init(void);
|
||||||
#endif
|
#endif
|
||||||
|
@ -529,6 +531,19 @@ static void insmod_capture(void)
|
||||||
nvt_gfx_init(); // gfx
|
nvt_gfx_init(); // gfx
|
||||||
nvt_vds_init(); // video srpite
|
nvt_vds_init(); // video srpite
|
||||||
kdrv_builtin_set_sie_vd_cb(sie_vd_cb);
|
kdrv_builtin_set_sie_vd_cb(sie_vd_cb);
|
||||||
|
#if FIX_RECORD_NOISE == ENABLE
|
||||||
|
eac_set_ad_config(EAC_CONFIG_AD_MICBIAS_EN, ENABLE);
|
||||||
|
eac_set_ad_config(EAC_CONFIG_AD_MICBIAS_LVL, TRUE);
|
||||||
|
|
||||||
|
eac_set_ad_config(EAC_CONFIG_AD_POWER_EN_L, TRUE);
|
||||||
|
eac_set_ad_config(EAC_CONFIG_AD_POWER_EN_R, TRUE);
|
||||||
|
|
||||||
|
eac_set_ad_config(EAC_CONFIG_AD_PDREF_BUF, FALSE);
|
||||||
|
eac_set_ad_config(EAC_CONFIG_AD_PDREF_BIAS, FALSE);
|
||||||
|
eac_set_ad_config(EAC_CONFIG_AD_PD_VCMBIAS, FALSE);
|
||||||
|
|
||||||
|
eac_set_phypower(ENABLE);
|
||||||
|
#endif
|
||||||
vos_perf_list_mark("b_cap", __LINE__, 1);
|
vos_perf_list_mark("b_cap", __LINE__, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -648,6 +663,9 @@ static void insmod_encoder(void)
|
||||||
kdrv_audio_init();
|
kdrv_audio_init();
|
||||||
kdrv_audlib_aac_init();
|
kdrv_audlib_aac_init();
|
||||||
#endif
|
#endif
|
||||||
|
#if (ANR_FUNC == ENABLE)
|
||||||
|
kdrv_audlib_anr_init(); // anr
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
fastboot_set_done(BOOT_INIT_MEIDA_ENCODER);
|
fastboot_set_done(BOOT_INIT_MEIDA_ENCODER);
|
||||||
|
|
|
@ -12,6 +12,9 @@
|
||||||
#include "sys_fastboot.h"
|
#include "sys_fastboot.h"
|
||||||
#include "PrjCfg.h"
|
#include "PrjCfg.h"
|
||||||
#include "DxHunting.h"
|
#include "DxHunting.h"
|
||||||
|
#if HUNTING_CAMERA_MCU == ENABLE
|
||||||
|
#include <sf_mcu.h>
|
||||||
|
#endif
|
||||||
#if (HUNTING_CAMERA_MODEL == ENABLE)
|
#if (HUNTING_CAMERA_MODEL == ENABLE)
|
||||||
|
|
||||||
#include "IOCfg.h"
|
#include "IOCfg.h"
|
||||||
|
@ -56,6 +59,13 @@ static void card_insert_job(void)
|
||||||
// call the function to wait init finish
|
// call the function to wait init finish
|
||||||
FileSys_WaitFinishEx('A');
|
FileSys_WaitFinishEx('A');
|
||||||
FileSys_SetParamEx('A', FST_PARM_UPDATE_FSINFO , TRUE);
|
FileSys_SetParamEx('A', FST_PARM_UPDATE_FSINFO , TRUE);
|
||||||
|
#if HUNTING_CAMERA_MCU == ENABLE
|
||||||
|
if(TRUE == sf_check_card_full())
|
||||||
|
{
|
||||||
|
printf("ERR card full\r\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
fastboot_set_done(BOOT_INIT_FILESYSOK);
|
fastboot_set_done(BOOT_INIT_FILESYSOK);
|
||||||
printf("filesys_init e\r\n");
|
printf("filesys_init e\r\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -871,7 +871,11 @@ static void MovieFast_WriteFile_Task(void* arg)
|
||||||
MOVIEFAST_WRITE_QUEUE_PARAM* param;
|
MOVIEFAST_WRITE_QUEUE_PARAM* param;
|
||||||
|
|
||||||
fastboot_wait_done(BOOT_INIT_FILESYSOK);
|
fastboot_wait_done(BOOT_INIT_FILESYSOK);
|
||||||
|
if(TRUE == sf_is_card_full())
|
||||||
|
{
|
||||||
|
DBG_ERR("ERR card full\r\n");
|
||||||
|
return ;
|
||||||
|
}
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
param = (MOVIEFAST_WRITE_QUEUE_PARAM*) lfqueue_deq(queue);
|
param = (MOVIEFAST_WRITE_QUEUE_PARAM*) lfqueue_deq(queue);
|
||||||
|
@ -1220,6 +1224,10 @@ THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg)
|
||||||
|
|
||||||
ImageApp_MovieMulti_SetParam(_CFG_REC_ID_1, MOVIEMULTI_PARAM_FILE_USE_FILEDB, FALSE);
|
ImageApp_MovieMulti_SetParam(_CFG_REC_ID_1, MOVIEMULTI_PARAM_FILE_USE_FILEDB, FALSE);
|
||||||
ImageApp_MovieMulti_SetParam(_CFG_REC_ID_1, MOVIEMULTI_PARAM_FILE_CB_CLOSED_FILE_INFO, TRUE);
|
ImageApp_MovieMulti_SetParam(_CFG_REC_ID_1, MOVIEMULTI_PARAM_FILE_CB_CLOSED_FILE_INFO, TRUE);
|
||||||
|
#if FIX_RECORD_NOISE == ENABLE
|
||||||
|
ImageApp_MovieMulti_SetParam(0, MOVIEMULTI_PARAM_AUD_MUTE_ENC_FUNC_EN, TRUE);
|
||||||
|
ImageApp_MovieMulti_SetParam(0, MOVIEMULTI_PARAM_AUD_MUTE_ENC, TRUE);
|
||||||
|
#endif
|
||||||
ImageApp_MovieMulti_Open();
|
ImageApp_MovieMulti_Open();
|
||||||
|
|
||||||
for (i = 0; i < SENSOR_CAPS_COUNT; i++) {
|
for (i = 0; i < SENSOR_CAPS_COUNT; i++) {
|
||||||
|
@ -1379,7 +1387,10 @@ THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
vos_flag_set(MOVIEFAST_FLG_ID, FLGMOVIEFAST_RECSTART);
|
vos_flag_set(MOVIEFAST_FLG_ID, FLGMOVIEFAST_RECSTART);
|
||||||
|
#if FIX_RECORD_NOISE == ENABLE
|
||||||
|
vos_util_delay_ms(300);
|
||||||
|
ImageApp_MovieMulti_SetParam(0, MOVIEMULTI_PARAM_AUD_MUTE_ENC, FALSE);
|
||||||
|
#endif
|
||||||
THREAD_RETURN(0);
|
THREAD_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,112 @@
|
||||||
|
|
||||||
|
|
||||||
#define FLGMOVIEFAST_MASK FLGPTN_BIT_ALL
|
#define FLGMOVIEFAST_MASK FLGPTN_BIT_ALL
|
||||||
|
#define FIX_RECORD_NOISE ENABLE
|
||||||
|
|
||||||
extern THREAD_RETTYPE MovieFast_InitFileNamingThread(void *arg);
|
extern THREAD_RETTYPE MovieFast_InitFileNamingThread(void *arg);
|
||||||
extern THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg);
|
extern THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg);
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
EAC_CONFIG_AD_DMIC_EN, ///< Configure AD(Record) Digital Microphone Enable/Disable.
|
||||||
|
EAC_CONFIG_AD_DMIC_CLK_EN, ///< Configure AD(Record) Digital Microphone Clock Output Enable/Disable.
|
||||||
|
EAC_CONFIG_AD_DMIC_LRSWAP, ///< Configure AD(Record) Digital Microphone Left/Right Channel Swap.
|
||||||
|
EAC_CONFIG_AD_DMIC2_LRSWAP, ///< Configure AD(Record) Digital Microphone2 Left/Right Channel Swap.
|
||||||
|
EAC_CONFIG_AD_ALC_MODE_DGAIN, ///< Configure AD(Record) Auto Level Control Using Ditial Gain only.
|
||||||
|
EAC_CONFIG_AD_DMIC_PATH_MUX, ///< Configure AD(Record) Digital Microphone decimation filter mux.
|
||||||
|
EAC_CONFIG_AD_DMIC_CHANNEL, ///< Configure AD(Record) Digital Microphone channel number 0x0/0x1 for 2/4ch.
|
||||||
|
///< This is used for the Digital Microphone.
|
||||||
|
|
||||||
|
EAC_CONFIG_AD_DCCAN_EN, ///< Configure AD(Record) DC Cancellation Enable/Disable.
|
||||||
|
EAC_CONFIG_AD_DCCAN_TYPE, ///< Configure AD(Record) DC Cancellation Selection Options. Please use EAC_DCCAN_TYPE as input parameter.
|
||||||
|
EAC_CONFIG_AD_DCCAN_RESO, ///< Configure AD(Record) DC Cancellation Resolution. Please use EAC_DCCAN_RESO as input parameter.
|
||||||
|
EAC_CONFIG_AD_DCINIT_L, ///< Configure AD(Record) DC Cancellation Left Channel Inital Value. This value is used by EAC_CONFIG_AD_DCCAN_TYPE.
|
||||||
|
EAC_CONFIG_AD_DCINIT_R, ///< Configure AD(Record) DC Cancellation Right Channel Inital Value. This value is used by EAC_CONFIG_AD_DCCAN_TYPE.
|
||||||
|
EAC_CONFIG_AD_DMIC2_DCINIT_L, ///< Configure AD(Record) DC Cancellation Left Channel Inital Value. This value is used by EAC_CONFIG_AD_DCCAN_TYPE.(dmic2)
|
||||||
|
EAC_CONFIG_AD_DMIC2_DCINIT_R, ///< Configure AD(Record) DC Cancellation Right Channel Inital Value. This value is used by EAC_CONFIG_AD_DCCAN_TYPE.(dmic2)
|
||||||
|
EAC_CONFIG_AD_DGAIN1_L, ///< Configure AD(Record) Digital Gain 1 for Left channel. Value range 0x1~0xFF which mapping to -57.0dB ~ +70.0dB(+0.5dB each step). Value 0x0 is mute.
|
||||||
|
EAC_CONFIG_AD_DGAIN1_R, ///< Configure AD(Record) Digital Gain 1 for Right channel. Value range 0x1~0xFF which mapping to -57.0dB ~ +70.0dB(+0.5dB each step). Value 0x0 is mute.
|
||||||
|
EAC_CONFIG_AD_DGAIN2_L, ///< Configure AD(Record) Digital Gain 2 for Left channel. Value range 0x1~0xFF which mapping to -97.0dB ~ +30.0dB(+0.5dB each step). Value 0x0 is mute.
|
||||||
|
EAC_CONFIG_AD_DGAIN2_R, ///< Configure AD(Record) Digital Gain 2 for Right channel. Value range 0x1~0xFF which mapping to -97.0dB ~ +30.0dB(+0.5dB each step). Value 0x0 is mute.
|
||||||
|
EAC_CONFIG_AD_DMIC2_DGAIN_L, ///< Configure AD(Record) Digital Gain 1 for dmic2 Left channel. Value range 0x1~0xFF which mapping to -57.0dB ~ +70.0dB(+0.5dB each step). Value 0x0 is mute.
|
||||||
|
EAC_CONFIG_AD_DMIC2_DGAIN_R, ///< Configure AD(Record) Digital Gain 1 for dmic2 Right channel. Value range 0x1~0xFF which mapping to -57.0dB ~ +70.0dB(+0.5dB each step). Value 0x0 is mute.
|
||||||
|
|
||||||
|
|
||||||
|
EAC_CONFIG_AD_ALC_EN, ///< Configure AD(Record) Auto Level Control (ALC) Enable/Disable.
|
||||||
|
EAC_CONFIG_AD_ALC_TARGET_L, ///< Configure AD(Record) Auto Level Control (ALC) Target Level for Left Channel. Use the enumeration "EAC_ALC_TARGET" as input parameter.
|
||||||
|
EAC_CONFIG_AD_ALC_TARGET_R, ///< Configure AD(Record) Auto Level Control (ALC) Target Level for Right Channel. Use the enumeration "EAC_ALC_TARGET" as input parameter.
|
||||||
|
|
||||||
|
EAC_CONFIG_AD_ALC_MAXGAIN_L, ///< Configure AD(Record) Auto Level Control (ALC) PGA Max Gain for Left Channel. Use the enumeration "EAC_ALC_MAXGAIN" as input parameter.
|
||||||
|
EAC_CONFIG_AD_ALC_MAXGAIN_R, ///< Configure AD(Record) Auto Level Control (ALC) PGA Max Gain for Right Channel. Use the enumeration "EAC_ALC_MAXGAIN" as input parameter.
|
||||||
|
|
||||||
|
EAC_CONFIG_AD_ALC_MINGAIN_L, ///< Configure AD(Record) Auto Level Control (ALC) PGA Max Gain for Left Channel. Use the enumeration "EAC_ALC_MINGAIN" as input parameter.
|
||||||
|
EAC_CONFIG_AD_ALC_MINGAIN_R, ///< Configure AD(Record) Auto Level Control (ALC) PGA Max Gain for Right Channel. Use the enumeration "EAC_ALC_MINGAIN" as input parameter.
|
||||||
|
|
||||||
|
EAC_CONFIG_AD_ALC_ATTACK_TIME, ///< Configure AD(Record) Auto Level Control (ALC) Attack Time. Time length would be "(2 ^ uiCfgValue) x ALC_Time_Resolution_Basis". Default value is 0x2.
|
||||||
|
///< This setting is also valid in the noise gate state. If the user want to keep the same attack time above noise gate threshold but larger the attack time below noise gate threshold,
|
||||||
|
///< the user must increase time resolution of NoiseGate and shorten the time resolution of ALC.
|
||||||
|
EAC_CONFIG_AD_ALC_DECAY_TIME, ///< Configure AD(Record) Auto Level Control (ALC) Decay Time. Time length would be "(2 ^ uiCfgValue) x ALC_Time_Resolution_Basis". Default value is 0x3.
|
||||||
|
///< This setting is also valid in the noise gate state. If the user want to keep the same decay time above noise gate threshold but larger the decay time below noise gate threshold,
|
||||||
|
///< the user must increase time resolution of NoiseGate and shorten the time resolution of ALC.
|
||||||
|
EAC_CONFIG_AD_ALC_HOLD_TIME, ///< Configure AD(Record) Auto Level Control (ALC) HOLD Time. Time length would be "(2 ^ (uiCfgValue-1)) x 117" samples. uiCfgValue 0x0 is 1 sample. Default value is 0x0.
|
||||||
|
///< This setting is also valid in the noise gate state. If the user want to keep the same hold time above noise gate threshold but larger the hold time below noise gate threshold,
|
||||||
|
///< the user must increase time resolution of NoiseGate and shorten the time resolution of ALC.
|
||||||
|
|
||||||
|
EAC_CONFIG_AD_NG_ATTACK_TIME, ///< Configure AD(Record) Auto Level Control (ALC) Attack Time. Time length would be "(2 ^ uiCfgValue) x ALC_Time_Resolution_Basis". Default value is 0x2.
|
||||||
|
///< This setting is also valid in the noise gate state. If the user want to keep the same attack time above noise gate threshold but larger the attack time below noise gate threshold,
|
||||||
|
///< the user must increase time resolution of NoiseGate and shorten the time resolution of ALC.
|
||||||
|
EAC_CONFIG_AD_NG_DECAY_TIME, ///< Configure AD(Record) Auto Level Control (ALC) Decay Time. Time length would be "(2 ^ uiCfgValue) x ALC_Time_Resolution_Basis". Default value is 0x3.
|
||||||
|
///< This setting is also valid in the noise gate state. If the user want to keep the same decay time above noise gate threshold but larger the decay time below noise gate threshold,
|
||||||
|
///< the user must increase time resolution of NoiseGate and shorten the time resolution of ALC.
|
||||||
|
EAC_CONFIG_AD_NG_HOLD_TIME, ///< Configure AD(Record) Auto Level Control (ALC) HOLD Time. Time length would be "(2 ^ (uiCfgValue-1)) x 117" samples. uiCfgValue 0x0 is 1 sample. Default value is 0x0.
|
||||||
|
///< This setting is also valid in the noise gate state. If the user want to keep the same hold time above noise gate threshold but larger the hold time below noise gate threshold,
|
||||||
|
///< the user must increase time resolution of NoiseGate and shorten the time resolution of ALC.
|
||||||
|
|
||||||
|
EAC_CONFIG_AD_ALC_STEP, ///< Configure AD(Record) Auto Level Control (ALC) Step value. This value would constraint the ALC controllable PGA gain changement max value in eack zero crossing. value is "0.5+(1.5 x uiCfgValue)" dB.
|
||||||
|
EAC_CONFIG_AD_ALC_TRESO, ///< Configure AD(Record) Auto Level Control (ALC) Time Resolution Basis during Attack/Decay time calculation.
|
||||||
|
///< Please use "EAC_ALC_TRESO_BASIS" as input parameter. The default value is 15ms.
|
||||||
|
EAC_CONFIG_AD_ALC_NG_EN, ///< Configure AD(Record) Auto Level Control (ALC) Noise Gate Enable/Disable.
|
||||||
|
|
||||||
|
EAC_CONFIG_AD_ALC_NG_THD_L, ///< Configure AD(Record) Auto Level Control (ALC) Noise Gate Threshold value for left channel. Please use the enumeration "EAC_NG_THRESHOLD" as input parameter.
|
||||||
|
EAC_CONFIG_AD_ALC_NG_THD_R, ///< Configure AD(Record) Auto Level Control (ALC) Noise Gate Threshold value for right channel. Please use the enumeration "EAC_NG_THRESHOLD" as input parameter.
|
||||||
|
|
||||||
|
EAC_CONFIG_AD_ALC_NG_TARGET_L, ///< Configure AD(Record) Auto Level Control (ALC) Noise Gate Target Level for left channel. Value range 0~15 which the Noise Gate target dB would be (ALC_TARGET - (NG_THD - INPUT_SIGNAL_LEVEL)*uiCfgValue).
|
||||||
|
EAC_CONFIG_AD_ALC_NG_TARGET_R, ///< Configure AD(Record) Auto Level Control (ALC) Noise Gate Target Level for right channel. Value range 0~15 which the Noise Gate target dB would be (ALC_TARGET - (NG_THD - INPUT_SIGNAL_LEVEL)*uiCfgValue).
|
||||||
|
|
||||||
|
EAC_CONFIG_AD_ALC_NG_TRESO, ///< Configure AD(Record) Auto Level Control (ALC) Noise Gate Time Resolution Basis during Attack/Decay time calculation inside Noise Gate state.
|
||||||
|
///< Please use "EAC_ALC_TRESO_BASIS" as input parameter. The default value is 15ms.
|
||||||
|
EAC_CONFIG_AD_BOOST_COMPEN_L, ///< Configure AD(Record) Boost Gain Digital Compensation for left channel in ALC loop. please use EAC_ALC_BOOST_COMPEN as input parameter.
|
||||||
|
EAC_CONFIG_AD_BOOST_COMPEN_R, ///< Configure AD(Record) Boost Gain Digital Compensation for right channel in ALC loop. please use EAC_ALC_BOOST_COMPEN as input parameter.
|
||||||
|
EAC_CONFIG_AD_IIR_ALC_L, ///< Configure AD(Record) Enable/Disable the IIR function to the Auto Level Control (ALC) Left Channel Input.
|
||||||
|
EAC_CONFIG_AD_IIR_ALC_R, ///< Configure AD(Record) Enable/Disable the IIR function to the Auto Level Control (ALC) Right Channel Input.
|
||||||
|
EAC_CONFIG_AD_IIR_OUT_L, ///< Configure AD(Record) Enable/Disable the IIR function to the Recorded Left Channel output Samples.
|
||||||
|
EAC_CONFIG_AD_IIR_OUT_R, ///< Configure AD(Record) Enable/Disable the IIR function to the Recorded Right Channel output Samples.
|
||||||
|
EAC_CONFIG_AD_IIR2_OUT_L, ///< Configure AD(Record) Enable/Disable the IIR function to the Recorded Left Channel output Samples.(dmic2)
|
||||||
|
EAC_CONFIG_AD_IIR2_OUT_R, ///< Configure AD(Record) Enable/Disable the IIR function to the Recorded Right Channel output Samples.(dmic2)
|
||||||
|
|
||||||
|
EAC_CONFIG_AD_PGAGAIN_L, ///< Configure AD(Record) Analog PGA Gain for Left channel if ALC disabled. Please use the enumeration "EAC_AD_PGAGAIN" as input parameter.
|
||||||
|
EAC_CONFIG_AD_PGAGAIN_R, ///< Configure AD(Record) Analog PGA Gain for Right channel if ALC disabled. Please use the enumeration "EAC_AD_PGAGAIN" as input parameter.
|
||||||
|
|
||||||
|
EAC_CONFIG_AD_PGABOOST_L, ///< Configure AD(Record) Analog Boost Gain for left channel. Please use EAC_PGABOOST_SEL as input parameter.
|
||||||
|
EAC_CONFIG_AD_PGABOOST_R, ///< Configure AD(Record) Analog Boost Gain for right channel. Please use EAC_PGABOOST_SEL as input parameter.
|
||||||
|
|
||||||
|
EAC_CONFIG_AD_POWER_EN_L, ///< Configure AD(Record) Analog Power Enable of the Left channel. Use TRUE/FALSE as input parameter to set Enable/Disable power.
|
||||||
|
EAC_CONFIG_AD_POWER_EN_R, ///< Configure AD(Record) Analog Power Enable of the Right channel. Use TRUE/FALSE as input parameter to set Enable/Disable power.
|
||||||
|
EAC_CONFIG_AD_RESET, ///< Configure AD(Record) Analog Block Reset. Set TRUE/FALSE to Enable/Disable the analog block reset operation.
|
||||||
|
EAC_CONFIG_AD_PDREF_BUF, ///< Configure AD(Record) Analog Block Reference Buffer Power Down.
|
||||||
|
EAC_CONFIG_AD_PDREF_BIAS, ///< Configure AD(Record) Analog Block Reference Bias Power Down.
|
||||||
|
EAC_CONFIG_AD_PD_VCMBIAS, ///< Configure AD(Record) Analog Block Vcm Power Down.
|
||||||
|
|
||||||
|
EAC_CONFIG_AD_MICBIAS_EN, ///< Configure AD(Record) Analog Block MIC Bias Enable/Disable.
|
||||||
|
EAC_CONFIG_AD_MICBIAS_LVL, ///< Configure AD(Record) Analog Block MIC Bias Level 2V/2.4V.
|
||||||
|
EAC_CONFIG_AD_DCOFS_L, ///< Get AD(Record) DC Cancellation Left Channel Offset Value.
|
||||||
|
EAC_CONFIG_AD_DCOFS_R, ///< Get AD(Record) DC Cancellation Right Channel Offset Value.
|
||||||
|
EAC_CONFIG_AD_DMIC2_DCOFS_L, ///< Get AD(Record) DC Cancellation Left Channel Offset Value.(dmic2)
|
||||||
|
EAC_CONFIG_AD_DMIC2_DCOFS_R, ///< Get AD(Record) DC Cancellation Right Channel Offset Value.(dmic2)
|
||||||
|
EAC_CONFIG_AD_ZC_EN, ///< Get AD(Record) Zero Crossing Function Enable/Disable.
|
||||||
|
EAC_CONFIG_AD_ZC_TIMEOUT, ///< Get AD(Record) Zero Crossing Function Timeout Value.
|
||||||
|
|
||||||
|
ENUM_DUMMY4WORD(EAC_CONFIG_AD)
|
||||||
|
} EAC_CONFIG_AD;
|
||||||
|
|
||||||
#endif //_UIAPP_PHOTO_H_
|
#endif //_UIAPP_PHOTO_H_
|
||||||
|
|
2
rtos/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto.h
Executable file → Normal file
2
rtos/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto.h
Executable file → Normal file
|
@ -72,7 +72,7 @@
|
||||||
#else
|
#else
|
||||||
#if PHOTO_PREVIEW_SLICE_ENC_FUNC || POWERON_FAST_SLICE_ENC
|
#if PHOTO_PREVIEW_SLICE_ENC_FUNC || POWERON_FAST_SLICE_ENC
|
||||||
#define PHOTO_MAX_CAP_SIZE UIAPP_PHOTO_SIZE_40M /* Max slice encode size */
|
#define PHOTO_MAX_CAP_SIZE UIAPP_PHOTO_SIZE_40M /* Max slice encode size */
|
||||||
#define PHOTO_MIN_CAP_SIZE UIAPP_PHOTO_SIZE_2M /* UI Menu only display options which size is larger than PHOTO_SLICE_ENC_MIN_CAP_SIZE */
|
#define PHOTO_MIN_CAP_SIZE UIAPP_PHOTO_SIZE_2M /* UI Menu only display options which size is larger than PHOTO_SLICE_ENC_MIN_CAP_SIZE */
|
||||||
#else
|
#else
|
||||||
#define PHOTO_MAX_CAP_SIZE UIAPP_PHOTO_SIZE_12M
|
#define PHOTO_MAX_CAP_SIZE UIAPP_PHOTO_SIZE_12M
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -890,6 +890,13 @@ INT32 PhotoFast_WriteFile(UINT32 Addr, UINT32 Size, UINT32 Fmt, UINT32 uiPathId,
|
||||||
//sprintf(tmp, "W%03ld%04ld.JPG", nextFolderID, nextFileID);
|
//sprintf(tmp, "W%03ld%04ld.JPG", nextFolderID, nextFileID);
|
||||||
strncpy(g_photo_fast_write_file_Path, tmp, sizeof(g_photo_fast_write_file_Path) - 1);
|
strncpy(g_photo_fast_write_file_Path, tmp, sizeof(g_photo_fast_write_file_Path) - 1);
|
||||||
DBG_IND("last send file:%s\r\n", tmp);
|
DBG_IND("last send file:%s\r\n", tmp);
|
||||||
|
if(TRUE == sf_is_card_full())
|
||||||
|
{
|
||||||
|
DBG_ERR("ERR Addr=0x%x,Size=0x%x,Fmt=%d card full\r\n", Addr, Size, Fmt);
|
||||||
|
rt =FST_STA_ERROR;
|
||||||
|
return rt;
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
strncpy(g_photo_fast_write_file_Path, FilePath, sizeof(g_photo_fast_write_file_Path) - 1);
|
strncpy(g_photo_fast_write_file_Path, FilePath, sizeof(g_photo_fast_write_file_Path) - 1);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1149,7 +1156,7 @@ static void PhotoFast_CaptureStop(void)
|
||||||
PhotoFast_Sliceencode2_Stop();
|
PhotoFast_Sliceencode2_Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PhotoFast_CaptureStart(HD_VIDEO_FRAME *p_video_frame)
|
static INT32 PhotoFast_CaptureStart(HD_VIDEO_FRAME *p_video_frame)
|
||||||
{
|
{
|
||||||
HD_PATH_ID vprc_path;
|
HD_PATH_ID vprc_path;
|
||||||
|
|
||||||
|
@ -1177,7 +1184,7 @@ static void PhotoFast_CaptureStart(HD_VIDEO_FRAME *p_video_frame)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if POWERON_FAST_SLICE_ENC_VER2 == ENABLE
|
#if POWERON_FAST_SLICE_ENC_VER2 == ENABLE
|
||||||
PhotoFast_Sliceencode2_Enq_Frame(p_video_frame);
|
return PhotoFast_Sliceencode2_Enq_Frame(p_video_frame);
|
||||||
#else
|
#else
|
||||||
PhotoFast_SliceEncode(vprc_path, p_video_frame);
|
PhotoFast_SliceEncode(vprc_path, p_video_frame);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1712,15 +1719,21 @@ THREAD_RETTYPE PhotoFast_FlowPreviewThread(void *arg)
|
||||||
case DX_HUNTING_MODE_PHOTO_MOVIE:
|
case DX_HUNTING_MODE_PHOTO_MOVIE:
|
||||||
|
|
||||||
if (start_cap == TRUE) {
|
if (start_cap == TRUE) {
|
||||||
g_u32PrvCapCnt++;
|
// g_u32PrvCapCnt++;
|
||||||
#if HUNTING_CAMERA_MCU == ENABLE
|
#if HUNTING_CAMERA_MCU == ENABLE
|
||||||
if(sf_is_night_mode(0) ==TRUE){
|
if(sf_is_night_mode(0) ==TRUE){
|
||||||
//DrvGPIO_IRLed_Turn_Onoff(0);
|
//DrvGPIO_IRLed_Turn_Onoff(0);
|
||||||
sf_ir_led_set(0, 0, 0, 0);
|
sf_ir_led_set(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PhotoFast_CaptureStart(&video_frame);
|
if(PhotoFast_CaptureStart(&video_frame) == E_OK){
|
||||||
|
g_u32PrvCapCnt++;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
DBG_WRN("enq frame failed...\n");
|
||||||
|
}
|
||||||
|
|
||||||
if (g_u32PrvCapCnt >= max_cnt) {
|
if (g_u32PrvCapCnt >= max_cnt) {
|
||||||
g_bPreViewPullFlag = FALSE;
|
g_bPreViewPullFlag = FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1793,7 +1806,7 @@ exit:
|
||||||
#if SF_TRIGGER_TIME_TEST == ENABLE
|
#if SF_TRIGGER_TIME_TEST == ENABLE
|
||||||
sf_trigger_time_led_cb(0);
|
sf_trigger_time_led_cb(0);
|
||||||
#endif
|
#endif
|
||||||
if(sf_get_power_off_flag())
|
if((sf_get_power_off_flag()) || (TRUE == sf_is_card_full()))
|
||||||
{
|
{
|
||||||
vos_flag_set(PHOTOFAST_FLG_ID, FLGPHOTOFAST_SHUTDOWN);
|
vos_flag_set(PHOTOFAST_FLG_ID, FLGPHOTOFAST_SHUTDOWN);
|
||||||
}
|
}
|
||||||
|
|
126
rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFastSliceEncode.c
Executable file → Normal file
126
rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFastSliceEncode.c
Executable file → Normal file
|
@ -80,6 +80,25 @@ static UINT32 PhotoFast_SliceEncode_Get_Encode_Max_Bitrate(HD_VIDEO_PXLFMT vproc
|
||||||
static INT32 PhotoFast_SliceEncode_Get_Comm_Buffer(PhotoFast_MEM_Info* mem_info);
|
static INT32 PhotoFast_SliceEncode_Get_Comm_Buffer(PhotoFast_MEM_Info* mem_info);
|
||||||
static INT32 PhotoFast_SliceEncode_Release_Comm_Buffer(PhotoFast_MEM_Info mem_info);
|
static INT32 PhotoFast_SliceEncode_Release_Comm_Buffer(PhotoFast_MEM_Info mem_info);
|
||||||
static INT32 PhotoFast_SliceEncode_Encode_Screennail(HD_VIDEO_FRAME* video_frame_in);
|
static INT32 PhotoFast_SliceEncode_Encode_Screennail(HD_VIDEO_FRAME* video_frame_in);
|
||||||
|
#if PHOTOFAST_FAST_STAMP == ENABLE
|
||||||
|
INT32 PhotoFastCapDateImprint_Src_GenYuvData(
|
||||||
|
HD_VIDEO_FRAME *video_frame,
|
||||||
|
PhotoFast_SliceSize_Info* src_slice_info,
|
||||||
|
PhotoFast_SliceSize_Info* dst_slice_info)
|
||||||
|
{
|
||||||
|
HD_VIDEO_FRAME video_frame_src_stamp = *video_frame;
|
||||||
|
UINT32 dst_last_slice_scale_height = (src_slice_info->last_slice_height * dst_slice_info->slice_height) / src_slice_info->slice_height;
|
||||||
|
|
||||||
|
if(dst_last_slice_scale_height > dst_slice_info->last_slice_height)
|
||||||
|
{
|
||||||
|
video_frame_src_stamp.dim.h = video_frame_src_stamp.dim.h - ((src_slice_info->last_slice_height * (dst_last_slice_scale_height - dst_slice_info->last_slice_height)) / dst_last_slice_scale_height);
|
||||||
|
video_frame_src_stamp.ph[0] = video_frame_src_stamp.dim.h;
|
||||||
|
video_frame_src_stamp.ph[1] = video_frame_src_stamp.dim.h;
|
||||||
|
}
|
||||||
|
|
||||||
|
return PhotoFastCapDateImprint_GenYuvData(&video_frame_src_stamp);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static UINT32 PhotoFast_PHY2VIRT(UINT32 pa_pos, UINT32 pa_start, UINT32 va)
|
static UINT32 PhotoFast_PHY2VIRT(UINT32 pa_pos, UINT32 pa_start, UINT32 va)
|
||||||
{
|
{
|
||||||
|
@ -187,7 +206,8 @@ INT32 PhotoFast_SliceEncode_Get_Curr_Dst_Slice_Info(PhotoFast_SliceSize_Info *in
|
||||||
PHOTOFAST_SLICE_ENC_DUMP("cap_size = %lu buf_size = %lu\n", cap_size, buf_size);
|
PHOTOFAST_SLICE_ENC_DUMP("cap_size = %lu buf_size = %lu\n", cap_size, buf_size);
|
||||||
|
|
||||||
UINT32 lines = (buf_size / cap_size_w);
|
UINT32 lines = (buf_size / cap_size_w);
|
||||||
max_slice_num = cap_size_h / lines + (cap_size_h % lines ? 1 : 0);
|
UINT32 slice_height = ALIGN_CEIL(lines, 16);
|
||||||
|
max_slice_num = (cap_size_h / slice_height) + (cap_size_h % slice_height ? 1 : 0);
|
||||||
|
|
||||||
UINT32 tmp_src_h = src_frame.dim.h / 2;
|
UINT32 tmp_src_h = src_frame.dim.h / 2;
|
||||||
UINT32 tmp_dst_h = cap_size_h / 16;
|
UINT32 tmp_dst_h = cap_size_h / 16;
|
||||||
|
@ -249,7 +269,8 @@ static UINT32 PhotoFast_SliceEncode_Get_Max_Dst_Slice_Info(PhotoFast_SliceSize_I
|
||||||
PHOTOFAST_SLICE_ENC_DUMP("cap_size = %lu buf_size = %lu\n", tmp_cap_size.w * tmp_cap_size.h, buf_size);
|
PHOTOFAST_SLICE_ENC_DUMP("cap_size = %lu buf_size = %lu\n", tmp_cap_size.w * tmp_cap_size.h, buf_size);
|
||||||
|
|
||||||
UINT32 lines = (buf_size / tmp_cap_size.w);
|
UINT32 lines = (buf_size / tmp_cap_size.w);
|
||||||
max_slice_num = tmp_cap_size.h / lines + (tmp_cap_size.h % lines ? 1 : 0);
|
UINT32 slice_height = ALIGN_CEIL(lines, 16);
|
||||||
|
max_slice_num = (tmp_cap_size.h / slice_height) + (tmp_cap_size.h % slice_height ? 1 : 0);
|
||||||
|
|
||||||
UINT32 tmp_src_h = sensor_info->sSize.h / 2;
|
UINT32 tmp_src_h = sensor_info->sSize.h / 2;
|
||||||
UINT32 tmp_dst_h = tmp_cap_size.h / 16;
|
UINT32 tmp_dst_h = tmp_cap_size.h / 16;
|
||||||
|
@ -708,7 +729,8 @@ static INT32 PhotoFast_SliceEncode_Init_VF_GFX_Slice(
|
||||||
UINT32 offset;
|
UINT32 offset;
|
||||||
UINT32 scr_slice_height = (slice_idx == (src_slice_info.slice_num - 1)) ? src_slice_info.last_slice_height : src_slice_info.slice_height;
|
UINT32 scr_slice_height = (slice_idx == (src_slice_info.slice_num - 1)) ? src_slice_info.last_slice_height : src_slice_info.slice_height;
|
||||||
UINT32 dst_slice_height = (slice_idx == (dst_slice_info.slice_num - 1)) ? dst_slice_info.last_slice_height : dst_slice_info.slice_height;
|
UINT32 dst_slice_height = (slice_idx == (dst_slice_info.slice_num - 1)) ? dst_slice_info.last_slice_height : dst_slice_info.slice_height;
|
||||||
UINT32 dst_scale_slice_height = (slice_idx == (dst_slice_info.slice_num - 1)) ? (src_slice_info.last_slice_height * dst_slice_info.slice_height / src_slice_info.slice_height) : dst_slice_info.slice_height;
|
|
||||||
|
UINT32 dst_scale_slice_height = (slice_idx == (dst_slice_info.slice_num - 1)) ? (src_slice_info.last_slice_height * dst_slice_info.slice_height / src_slice_info.slice_height) : dst_slice_info.slice_height;
|
||||||
|
|
||||||
/* dst img */
|
/* dst img */
|
||||||
addr_dst[0] = dst_buffer_info.pa;
|
addr_dst[0] = dst_buffer_info.pa;
|
||||||
|
@ -1900,28 +1922,20 @@ static lfqueue_t queue23 = {0};
|
||||||
|
|
||||||
INT32 PhotoFast_Sliceencode2_Enq_Frame(const HD_VIDEO_FRAME* video_frame)
|
INT32 PhotoFast_Sliceencode2_Enq_Frame(const HD_VIDEO_FRAME* video_frame)
|
||||||
{
|
{
|
||||||
|
if(lfqueue_size(&queue12) >= PHOTOFAST_SLICE_ENC_QUEUE12_MAX_SIZE){
|
||||||
|
return E_SYS;
|
||||||
|
}
|
||||||
|
|
||||||
PhotoFast_SliceEncode_Queue12_Param* queue_ele_out = NULL;
|
PhotoFast_SliceEncode_Queue12_Param* queue_ele_out = NULL;
|
||||||
queue_ele_out = (PhotoFast_SliceEncode_Queue12_Param*) malloc(sizeof(PhotoFast_SliceEncode_Queue12_Param));
|
queue_ele_out = (PhotoFast_SliceEncode_Queue12_Param*) malloc(sizeof(PhotoFast_SliceEncode_Queue12_Param));
|
||||||
memset(queue_ele_out, 0, sizeof(PhotoFast_SliceEncode_Queue12_Param));
|
memset(queue_ele_out, 0, sizeof(PhotoFast_SliceEncode_Queue12_Param));
|
||||||
queue_ele_out->frame = *video_frame;
|
queue_ele_out->frame = *video_frame;
|
||||||
|
|
||||||
while(1)
|
while (lfqueue_enq(&queue12, (void*) queue_ele_out) == -1)
|
||||||
{
|
{
|
||||||
if(lfqueue_size(&queue12) >= PHOTOFAST_SLICE_ENC_QUEUE12_MAX_SIZE)
|
vos_util_delay_ms(1);
|
||||||
{
|
DBG_ERR("ENQ Full ?\r\n");
|
||||||
vos_util_delay_ms(1);
|
}
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
while(lfqueue_enq(&queue12, (void*)queue_ele_out) == -1)
|
|
||||||
{
|
|
||||||
vos_util_delay_ms(1);
|
|
||||||
DBG_ERR("ENQ Full ?\r\n");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return E_OK;
|
return E_OK;
|
||||||
}
|
}
|
||||||
|
@ -1949,7 +1963,6 @@ INT32 PhotoFast_SliceEncode_CB2(void* user_data)
|
||||||
PhotoFast_SliceEncode_Queue12_Param* queue_ele_in = NULL;
|
PhotoFast_SliceEncode_Queue12_Param* queue_ele_in = NULL;
|
||||||
PhotoFast_SliceEncode_Queue23_Param* queue_ele_out = NULL;
|
PhotoFast_SliceEncode_Queue23_Param* queue_ele_out = NULL;
|
||||||
HD_RESULT hd_ret = HD_OK;
|
HD_RESULT hd_ret = HD_OK;
|
||||||
// PHOTO_VID_IN vid_in = PHOTO_VID_IN_1;
|
|
||||||
PhotoFast_SliceEncode_Info* slice_encode_primary_info = PhotoFast_SliceEncode_Get_Info(PHOTO_ENC_JPG_PRIMARY);
|
PhotoFast_SliceEncode_Info* slice_encode_primary_info = PhotoFast_SliceEncode_Get_Info(PHOTO_ENC_JPG_PRIMARY);
|
||||||
PhotoFast_SliceEncode_Info* slice_encode_screennail_info = PhotoFast_SliceEncode_Get_Info(PHOTO_ENC_JPG_SCREENNAIL);
|
PhotoFast_SliceEncode_Info* slice_encode_screennail_info = PhotoFast_SliceEncode_Get_Info(PHOTO_ENC_JPG_SCREENNAIL);
|
||||||
PhotoFast_SliceEncode_Info* slice_encode_thumbnail_info = PhotoFast_SliceEncode_Get_Info(PHOTO_ENC_JPG_THUMBNAIL);
|
PhotoFast_SliceEncode_Info* slice_encode_thumbnail_info = PhotoFast_SliceEncode_Get_Info(PHOTO_ENC_JPG_THUMBNAIL);
|
||||||
|
@ -1963,7 +1976,6 @@ INT32 PhotoFast_SliceEncode_CB2(void* user_data)
|
||||||
UINT32 enc_accum_size = 0;
|
UINT32 enc_accum_size = 0;
|
||||||
static UINT8 primary_quality = CFG_PHOTOFAST_SLICE_ENC_INIT_QUALITY_PRIMARY;
|
static UINT8 primary_quality = CFG_PHOTOFAST_SLICE_ENC_INIT_QUALITY_PRIMARY;
|
||||||
static UINT8 screennail_quality = CFG_PHOTOFAST_SLICE_ENC_INIT_QUALITY_SCREENNAIL;
|
static UINT8 screennail_quality = CFG_PHOTOFAST_SLICE_ENC_INIT_QUALITY_SCREENNAIL;
|
||||||
// PHOTO_CAP_CBMSG_FP PhotoCapMsgCb = (PHOTO_CAP_CBMSG_FP)Photo_CaptureCB;
|
|
||||||
|
|
||||||
if(!user_data){
|
if(!user_data){
|
||||||
DBG_ERR("user_data can't be null!\n");
|
DBG_ERR("user_data can't be null!\n");
|
||||||
|
@ -2035,14 +2047,7 @@ INT32 PhotoFast_SliceEncode_CB2(void* user_data)
|
||||||
goto EXIT;
|
goto EXIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
DBG_DUMP("process frame %lu\n", param->cnt);
|
DBG_IND("process frame %lu\n", param->cnt);
|
||||||
|
|
||||||
/*******************************************************************
|
|
||||||
* Fast Stamp (higher speed, lower quality)
|
|
||||||
******************************************************************/
|
|
||||||
#if PHOTOFAST_FAST_STAMP
|
|
||||||
PhotoFastCapDateImprint_GenYuvData(&queue_ele_in->frame);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
* Calculate dst slice info
|
* Calculate dst slice info
|
||||||
|
@ -2056,6 +2061,15 @@ INT32 PhotoFast_SliceEncode_CB2(void* user_data)
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
PhotoFast_SliceEncode_Get_Src_Slice_Info(&dst_slice_info, &src_slice_info, queue_ele_in->frame);
|
PhotoFast_SliceEncode_Get_Src_Slice_Info(&dst_slice_info, &src_slice_info, queue_ele_in->frame);
|
||||||
|
|
||||||
|
#if PHOTOFAST_FAST_STAMP == ENABLE
|
||||||
|
/*******************************************************************
|
||||||
|
* Stamp on the src frame
|
||||||
|
******************************************************************/
|
||||||
|
if(PhotoFastCapDateImprint_Src_GenYuvData(&queue_ele_in->frame, &src_slice_info, &dst_slice_info) != E_OK){
|
||||||
|
goto EXIT;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
slice_encode_primary_info->bs_buf_mem_info.blk_size = (VDO_YUV_BUFSIZE(dst_slice_info.width, dst_slice_info.height, queue_ele_in->frame.pxlfmt) / (CFG_PHOTOFAST_SLICE_ENC_BS_BUF_RATIO)) + CFG_JPG_HEADER_SIZE + PhotoFast_GetScreenNailSize() ;
|
slice_encode_primary_info->bs_buf_mem_info.blk_size = (VDO_YUV_BUFSIZE(dst_slice_info.width, dst_slice_info.height, queue_ele_in->frame.pxlfmt) / (CFG_PHOTOFAST_SLICE_ENC_BS_BUF_RATIO)) + CFG_JPG_HEADER_SIZE + PhotoFast_GetScreenNailSize() ;
|
||||||
if(PhotoFast_SliceEncode_Alloc_Buffer_Retry(
|
if(PhotoFast_SliceEncode_Alloc_Buffer_Retry(
|
||||||
&slice_encode_primary_info->bs_buf_mem_info,
|
&slice_encode_primary_info->bs_buf_mem_info,
|
||||||
|
@ -2201,17 +2215,16 @@ INT32 PhotoFast_SliceEncode_CB2(void* user_data)
|
||||||
|
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
if(lfqueue_size(param->queue23) >= PHOTOFAST_SLICE_ENC_QUEUE23_MAX_SIZE)
|
if(lfqueue_size(param->queue23) >= PHOTOFAST_SLICE_ENC_QUEUE23_MAX_SIZE){
|
||||||
{
|
|
||||||
vos_util_delay_ms(1);
|
vos_util_delay_ms(1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else{
|
||||||
{
|
while (lfqueue_enq(param->queue23, (void*) queue_ele_out) == -1)
|
||||||
while(lfqueue_enq(param->queue23, (void*)queue_ele_out) == -1)
|
|
||||||
{
|
{
|
||||||
DBG_ERR("ENQ Full ?\r\n");
|
DBG_ERR("ENQ Full ?\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2267,6 +2280,7 @@ INT32 PhotoFast_SliceEncode_CB3(void* user_data)
|
||||||
INT32 ret = E_OK;
|
INT32 ret = E_OK;
|
||||||
PhotoFast_SliceEncode_CB3_Param* param = NULL;
|
PhotoFast_SliceEncode_CB3_Param* param = NULL;
|
||||||
PhotoFast_SliceEncode_Queue23_Param* queue_ele_in = NULL;
|
PhotoFast_SliceEncode_Queue23_Param* queue_ele_in = NULL;
|
||||||
|
VOS_TICK t1, t2, t3, t4;
|
||||||
|
|
||||||
if(!user_data){
|
if(!user_data){
|
||||||
DBG_ERR("user_data can't be null!\n");
|
DBG_ERR("user_data can't be null!\n");
|
||||||
|
@ -2305,6 +2319,8 @@ INT32 PhotoFast_SliceEncode_CB3(void* user_data)
|
||||||
goto EXIT;
|
goto EXIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vos_perf_mark(&t1);
|
||||||
|
|
||||||
#if !PHOTOFAST_FAST_CLOSE
|
#if !PHOTOFAST_FAST_CLOSE
|
||||||
PhotoFast_WriteFile(
|
PhotoFast_WriteFile(
|
||||||
(UINT32)queue_ele_in->jpg_combined_addr,
|
(UINT32)queue_ele_in->jpg_combined_addr,
|
||||||
|
@ -2321,6 +2337,8 @@ INT32 PhotoFast_SliceEncode_CB3(void* user_data)
|
||||||
queue_ele_in->file_path);
|
queue_ele_in->file_path);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
vos_perf_mark(&t2);
|
||||||
|
|
||||||
{
|
{
|
||||||
char tmp[NMC_TOTALFILEPATH_MAX_LEN] = {'\0'};
|
char tmp[NMC_TOTALFILEPATH_MAX_LEN] = {'\0'};
|
||||||
|
|
||||||
|
@ -2352,22 +2370,34 @@ INT32 PhotoFast_SliceEncode_CB3(void* user_data)
|
||||||
#endif
|
#endif
|
||||||
DBG_IND("PHOTO THUMB %s\n", tmp);
|
DBG_IND("PHOTO THUMB %s\n", tmp);
|
||||||
|
|
||||||
FST_FILE fp = FileSys_OpenFile(tmp, FST_CREATE_ALWAYS | FST_OPEN_WRITE);
|
vos_perf_mark(&t3);
|
||||||
|
if(FALSE == sf_is_card_full())
|
||||||
|
{
|
||||||
|
FST_FILE fp = FileSys_OpenFile(tmp, FST_CREATE_ALWAYS | FST_OPEN_WRITE);
|
||||||
|
|
||||||
|
FileSys_WriteFile(fp, (UINT8*)queue_ele_in->jpg_thumb_addr, &queue_ele_in->jpg_thumb_size, 0, NULL);
|
||||||
|
FileSys_FlushFile(fp);
|
||||||
|
FileSys_CloseFile(fp);
|
||||||
|
#if HUNTING_CAMERA_MCU == ENABLE
|
||||||
|
memset(tmp, '\0', sizeof(tmp));
|
||||||
|
snprintf(tmp, sizeof(tmp), "%s/%s", SF_SEND_LIST_DIR, file_path); /* DCF 8.3 naming rule */
|
||||||
|
snprintf(tmp2, sizeof(tmp2), "%s", file_path); /* DCF 8.3 naming rule */
|
||||||
|
sf_file_thumb_cfg_fill(tmp, tmp2, queue_ele_in->jpg_thumb_size, SF_FILE_TYPE_PIC_SMALL);
|
||||||
|
DBG_IND("PHOTO THUMB %s \n %s\n %s\n", tmp, tmp2,file_path);
|
||||||
|
DBG_IND("%s:%d thumbfileSize:%d thumbfileName:%s thumbfilePath:%s\n", __FUNCTION__, __LINE__,queue_ele_in->jpg_thumb_size,tmp2,tmp);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
FileSys_WriteFile(fp, (UINT8*)queue_ele_in->jpg_thumb_addr, &queue_ele_in->jpg_thumb_size, 0, NULL);
|
|
||||||
FileSys_FlushFile(fp);
|
|
||||||
FileSys_CloseFile(fp);
|
|
||||||
|
|
||||||
#if HUNTING_CAMERA_MCU == ENABLE
|
|
||||||
memset(tmp, '\0', sizeof(tmp));
|
|
||||||
snprintf(tmp, sizeof(tmp), "%s/%s", SF_SEND_LIST_DIR, file_path); /* DCF 8.3 naming rule */
|
|
||||||
snprintf(tmp2, sizeof(tmp2), "%s", file_path); /* DCF 8.3 naming rule */
|
|
||||||
sf_file_thumb_cfg_fill(tmp, tmp2, queue_ele_in->jpg_thumb_size, SF_FILE_TYPE_PIC_SMALL);
|
|
||||||
DBG_IND("PHOTO THUMB %s \n %s\n %s\n", tmp, tmp2,file_path);
|
|
||||||
DBG_IND("%s:%d thumbfileSize:%d thumbfileName:%s thumbfilePath:%s\n", __FUNCTION__, __LINE__,queue_ele_in->jpg_thumb_size,tmp2,tmp);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vos_perf_mark(&t4);
|
||||||
|
|
||||||
|
DBG_DUMP("CB3 cost %lu ms(%lu , %lu , %lu)\n",
|
||||||
|
vos_perf_duration(t1, t4) / 1000,
|
||||||
|
vos_perf_duration(t1, t2) / 1000,
|
||||||
|
vos_perf_duration(t2, t3) / 1000,
|
||||||
|
vos_perf_duration(t3, t4) / 1000
|
||||||
|
);
|
||||||
|
|
||||||
/* check user bs buffer is freed */
|
/* check user bs buffer is freed */
|
||||||
if(queue_ele_in->mem_info_combined.va){
|
if(queue_ele_in->mem_info_combined.va){
|
||||||
|
|
|
@ -263,7 +263,7 @@
|
||||||
#define DEFAULT_MULTISHOT_INTEVEL SF_MULTISHOT_INTEVEL_1S
|
#define DEFAULT_MULTISHOT_INTEVEL SF_MULTISHOT_INTEVEL_1S
|
||||||
#define DEFAULT_PIC_UP_DAILY_REPORT SF_OFF
|
#define DEFAULT_PIC_UP_DAILY_REPORT SF_OFF
|
||||||
#define DEFAULT_BLU_SWITCH SF_ON
|
#define DEFAULT_BLU_SWITCH SF_ON
|
||||||
|
#define DEFAULT_WIFI_SWITCH SF_ON
|
||||||
#define SIFAR_FTP_IP "119.23.174.139"
|
#define SIFAR_FTP_IP "119.23.174.139"
|
||||||
#define SIFAR_FTP_PORT "21"
|
#define SIFAR_FTP_PORT "21"
|
||||||
#define SIFAR_FTP_USERNAME "cameraftp"
|
#define SIFAR_FTP_USERNAME "cameraftp"
|
||||||
|
|
|
@ -1092,8 +1092,12 @@ void SysResetFlag(void)
|
||||||
puiPara->VideoLenth = DEFAULT_VIDEO_LENTH;
|
puiPara->VideoLenth = DEFAULT_VIDEO_LENTH;
|
||||||
puiPara->PirSwitch = DEFAULT_PIR_SWITCH;
|
puiPara->PirSwitch = DEFAULT_PIR_SWITCH;
|
||||||
puiPara->PirSensitivity = DEFAULT_PIR_SENSITIVITY;
|
puiPara->PirSensitivity = DEFAULT_PIR_SENSITIVITY;
|
||||||
|
|
||||||
puiPara->PirDelaySwitch = DEFAULT_PIR_DELAY_SWITCH;
|
puiPara->PirDelaySwitch = DEFAULT_PIR_DELAY_SWITCH;
|
||||||
|
puiPara->PirDelayTime.Hour = 0;
|
||||||
|
puiPara->PirDelayTime.Min = 0;
|
||||||
|
puiPara->PirDelayTime.Sec = 15;
|
||||||
|
|
||||||
puiPara->TimelapseSwitch = DEFAULT_TIMELAPSE_SWITCH;
|
puiPara->TimelapseSwitch = DEFAULT_TIMELAPSE_SWITCH;
|
||||||
if(puiPara->TimelapseSwitch)
|
if(puiPara->TimelapseSwitch)
|
||||||
{
|
{
|
||||||
|
@ -1177,6 +1181,7 @@ void SysResetFlag(void)
|
||||||
puiPara->MultiShotIntevel = DEFAULT_MULTISHOT_INTEVEL;
|
puiPara->MultiShotIntevel = DEFAULT_MULTISHOT_INTEVEL;
|
||||||
puiPara->PicUpDailyReport = DEFAULT_PIC_UP_DAILY_REPORT;
|
puiPara->PicUpDailyReport = DEFAULT_PIC_UP_DAILY_REPORT;
|
||||||
puiPara->BluSwitch = DEFAULT_BLU_SWITCH;
|
puiPara->BluSwitch = DEFAULT_BLU_SWITCH;
|
||||||
|
puiPara->WifiSwitch = DEFAULT_WIFI_SWITCH;
|
||||||
|
|
||||||
if(puiPara->ModuleImei[0] != '\0')
|
if(puiPara->ModuleImei[0] != '\0')
|
||||||
{
|
{
|
||||||
|
|
|
@ -513,3 +513,5 @@ EXTERN("dai_disableclk")
|
||||||
EXTERN("aud_open")
|
EXTERN("aud_open")
|
||||||
EXTERN("h264Enc_queryMemSize")
|
EXTERN("h264Enc_queryMemSize")
|
||||||
EXTERN("aud_set_default_setting")
|
EXTERN("aud_set_default_setting")
|
||||||
|
EXTERN("eac_set_ad_config")
|
||||||
|
EXTERN("eac_set_phypower")
|
||||||
|
|
|
@ -55,38 +55,39 @@ BOOL sf_is_card_full(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
UINT32 sf_check_card_full(void)
|
UINT32 sf_check_card_full(void)
|
||||||
{
|
{
|
||||||
UINT64 diskFree = 0;
|
int diskFree = 0;
|
||||||
UINT32 ret = 0;
|
UINT32 ret = 0;
|
||||||
|
|
||||||
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
//UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
||||||
if(!sf_in_card_exist())
|
if(!sf_in_card_exist())
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
/*check disk free size*/
|
|
||||||
diskFree = FileSys_GetDiskInfo(FST_INFO_FREE_SPACE);
|
|
||||||
diskFree = diskFree/1024;
|
|
||||||
|
|
||||||
if(diskFree < 30) /* 30MB */
|
|
||||||
{
|
|
||||||
ret = TRUE;
|
|
||||||
if(0 == puiPara->SdLoopSwitch)
|
|
||||||
{
|
|
||||||
IsCardFull = TRUE;
|
|
||||||
}
|
|
||||||
//printf("%s:%d sd card is full diskFree=%lu",__FUNCTION__,__LINE__,diskFree);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ret = FALSE;
|
|
||||||
//printf("%s:%d sd card no full diskFree=%lu",__FUNCTION__,__LINE__,diskFree);
|
|
||||||
}
|
|
||||||
//printf("%s:%d sd card diskFree(%lu)",__FUNCTION__,__LINE__,diskFree);
|
|
||||||
|
|
||||||
return ret;
|
/*check disk free size*/
|
||||||
|
diskFree = FileSys_GetDiskInfo(FST_INFO_FREE_SPACE);
|
||||||
|
diskFree = diskFree/1024/1024;
|
||||||
|
|
||||||
|
if(diskFree < 30) /* 30MB */
|
||||||
|
{
|
||||||
|
ret = TRUE;
|
||||||
|
//if(0 == puiPara->SdLoopSwitch)
|
||||||
|
{
|
||||||
|
IsCardFull = TRUE;
|
||||||
|
}
|
||||||
|
//printf("%s:%d sd card is full diskFree=%lu",__FUNCTION__,__LINE__,diskFree);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ret = FALSE;
|
||||||
|
//printf("%s:%d sd card no full diskFree=%lu",__FUNCTION__,__LINE__,diskFree);
|
||||||
|
}
|
||||||
|
|
||||||
|
//printf("[%s:%d]sd card diskFree=%dM\n", __FUNCTION__, __LINE__, diskFree);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sf_sd_exist_reg_cb(SF_CALLBACK_SD_CMD fpCB)
|
void sf_sd_exist_reg_cb(SF_CALLBACK_SD_CMD fpCB)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user