启动阈值调整
This commit is contained in:
@ -211,6 +211,12 @@ void write_gsensor_data_handle(void)
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
char w_log_buffer_1[100];
|
||||
char w_log_buffer_2[100];
|
||||
char w_log_buffer_3[100];
|
||||
char w_log_buffer_4[100];
|
||||
char w_log_buffer_5[100];
|
||||
u8 gravity_sensor_command(u8 w_chip_id, u8 register_address, u8 function_command)
|
||||
{
|
||||
// spin_lock(&sensor_iic);
|
||||
@ -220,6 +226,7 @@ u8 gravity_sensor_command(u8 w_chip_id, u8 register_address, u8 function_command
|
||||
if (0 == iic_tx_byte(gSensor_info->iic_hdl, w_chip_id)) {
|
||||
ret = 0;
|
||||
xlog("\n gsen iic wr err 0\n");
|
||||
// strcpy(&w_log_buffer_1, "gsen iic wr err 0\n");
|
||||
goto __gcend;
|
||||
}
|
||||
|
||||
@ -228,6 +235,7 @@ u8 gravity_sensor_command(u8 w_chip_id, u8 register_address, u8 function_command
|
||||
if (0 == iic_tx_byte(gSensor_info->iic_hdl, register_address)) {
|
||||
ret = 0;
|
||||
xlog("\n gsen iic wr err 1\n");
|
||||
// strcpy(&w_log_buffer_2, "gsen iic wr err 1\n");
|
||||
goto __gcend;
|
||||
}
|
||||
|
||||
@ -236,16 +244,24 @@ u8 gravity_sensor_command(u8 w_chip_id, u8 register_address, u8 function_command
|
||||
if (0 == iic_tx_byte(gSensor_info->iic_hdl, function_command)) {
|
||||
ret = 0;
|
||||
xlog("\n gsen iic wr err 2\n");
|
||||
// strcpy(&w_log_buffer_3, "gsen iic wr err 3\n");
|
||||
goto __gcend;
|
||||
}
|
||||
|
||||
// strcpy(&w_log_buffer_4, "gsen iic wr sucess\n");
|
||||
|
||||
__gcend:
|
||||
iic_stop(gSensor_info->iic_hdl);
|
||||
// spin_unlock(&sensor_iic);
|
||||
/* os_mutex_post(&SENSOR_IIC_MUTEX); */
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
char sen_log_buffer_1[100];
|
||||
char sen_log_buffer_2[100];
|
||||
char sen_log_buffer_3[100];
|
||||
char sen_log_buffer_4[100];
|
||||
char sen_log_buffer_5[100];
|
||||
u8 _gravity_sensor_get_ndata(u8 r_chip_id, u8 register_address, u8 *buf, u8 data_len)
|
||||
{
|
||||
// xlog("%s",__func__);
|
||||
@ -257,6 +273,7 @@ u8 _gravity_sensor_get_ndata(u8 r_chip_id, u8 register_address, u8 *buf, u8 data
|
||||
if (0 == iic_tx_byte(gSensor_info->iic_hdl, r_chip_id - 1)) {
|
||||
xlog("\n gsen iic rd err 0\n");
|
||||
read_len = 0;
|
||||
// strcpy(&sen_log_buffer_1, "gsen iic rd err 0\n");
|
||||
goto __gdend;
|
||||
}
|
||||
|
||||
@ -265,6 +282,7 @@ u8 _gravity_sensor_get_ndata(u8 r_chip_id, u8 register_address, u8 *buf, u8 data
|
||||
if (0 == iic_tx_byte(gSensor_info->iic_hdl, register_address)) {
|
||||
xlog("\n gsen iic rd err 1\n");
|
||||
read_len = 0;
|
||||
// strcpy(&sen_log_buffer_2, "gsen iic rd err 1\n");
|
||||
goto __gdend;
|
||||
}
|
||||
|
||||
@ -272,6 +290,7 @@ u8 _gravity_sensor_get_ndata(u8 r_chip_id, u8 register_address, u8 *buf, u8 data
|
||||
if (0 == iic_tx_byte(gSensor_info->iic_hdl, r_chip_id)) {
|
||||
xlog("\n gsen iic rd err 2\n");
|
||||
read_len = 0;
|
||||
// strcpy(&sen_log_buffer_3, "gsen iic rd err 2\n" );
|
||||
goto __gdend;
|
||||
}
|
||||
|
||||
@ -284,14 +303,15 @@ u8 _gravity_sensor_get_ndata(u8 r_chip_id, u8 register_address, u8 *buf, u8 data
|
||||
|
||||
*buf = iic_rx_byte(gSensor_info->iic_hdl, 0);
|
||||
read_len ++;
|
||||
// strcpy(&sen_log_buffer_4, "gsen iic rd success\n");
|
||||
|
||||
__gdend:
|
||||
|
||||
iic_stop(gSensor_info->iic_hdl);
|
||||
delay(gSensor_info->iic_delay);
|
||||
// spin_unlock(&sensor_iic);
|
||||
|
||||
/* os_mutex_post(&SENSOR_IIC_MUTEX); */
|
||||
// strcpy(&sen_log_buffer_5, "gsen iic rd err\n");
|
||||
return read_len;
|
||||
}
|
||||
void gsensor_io_ctl(u8 cmd, void *arg)
|
||||
|
||||
@ -1425,9 +1425,25 @@ void ble_module_enable(u8 en)
|
||||
#if(TCFG_CHARGE_BOX_ENABLE)
|
||||
extern u8 get_chgbox_lid_status(void);
|
||||
#endif
|
||||
|
||||
void user_ble_gap_device_set(char* name){ //xtell-set
|
||||
|
||||
if(strlen(name) < BT_NAME_LEN_MAX){
|
||||
strcpy(gap_device_name,name);
|
||||
|
||||
//刷新广播
|
||||
bt_ble_adv_enable(0);
|
||||
make_set_adv_data();
|
||||
make_set_rsp_data();
|
||||
bt_ble_adv_enable(1);
|
||||
}
|
||||
}
|
||||
void bt_ble_init(void)
|
||||
{
|
||||
log_info("***** ble_init******\n");
|
||||
//xtell-set
|
||||
// extern char xt_ble_new_name[9];
|
||||
// user_ble_gap_device_set(xt_ble_new_name);
|
||||
|
||||
gap_device_name = bt_get_local_name();
|
||||
gap_device_name_len = strlen(gap_device_name);
|
||||
|
||||
Reference in New Issue
Block a user