本文整理汇总了C++中GYRO_LOG函数的典型用法代码示例。如果您正苦于以下问题:C++ GYRO_LOG函数的具体用法?C++ GYRO_LOG怎么用?C++ GYRO_LOG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GYRO_LOG函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: gyro_probe
static int gyro_probe(struct platform_device *pdev)
{
int err;
GYRO_LOG("+++++++++++++gyro_probe!!\n");
gyro_context_obj = gyro_context_alloc_object();
if (!gyro_context_obj)
{
err = -ENOMEM;
GYRO_ERR("unable to allocate devobj!\n");
goto exit_alloc_data_failed;
}
//init real gyroeleration driver
err = gyro_real_driver_init();
if(err)
{
GYRO_ERR("gyro real driver init fail\n");
goto real_driver_init_fail;
}
//init input dev
err = gyro_input_init(gyro_context_obj);
if(err)
{
GYRO_ERR("unable to register gyro input device!\n");
goto exit_alloc_input_dev_failed;
}
atomic_set(&(gyro_context_obj->early_suspend), 0);
gyro_context_obj->early_drv.level = EARLY_SUSPEND_LEVEL_STOP_DRAWING - 1,
gyro_context_obj->early_drv.suspend = gyro_early_suspend,
gyro_context_obj->early_drv.resume = gyro_late_resume,
register_early_suspend(&gyro_context_obj->early_drv);
GYRO_LOG("----gyro_probe OK !!\n");
return 0;
//exit_hwmsen_create_attr_failed:
//exit_misc_register_failed:
//exit_err_sysfs:
if (err)
{
GYRO_ERR("sysfs node creation error \n");
gyro_input_destroy(gyro_context_obj);
}
real_driver_init_fail:
exit_alloc_input_dev_failed:
kfree(gyro_context_obj);
exit_alloc_data_failed:
GYRO_LOG("----gyro_probe fail !!!\n");
return err;
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:60,代码来源:gyroscope.c
示例2: gyro_real_driver_init
static int gyro_real_driver_init(void)
{
int i =0;
int err=0;
GYRO_LOG(" gyro_real_driver_init +\n");
for(i = 0; i < MAX_CHOOSE_GYRO_NUM; i++)
{
GYRO_LOG(" i=%d\n",i);
if(0 != gyroscope_init_list[i])
{
GYRO_LOG(" gyro try to init driver %s\n", gyroscope_init_list[i]->name);
err = gyroscope_init_list[i]->init();
if(0 == err)
{
GYRO_LOG(" gyro real driver %s probe ok\n", gyroscope_init_list[i]->name);
break;
}
}
}
if(i == MAX_CHOOSE_GYRO_NUM)
{
GYRO_LOG(" gyro_real_driver_init fail\n");
err=-1;
}
return err;
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:27,代码来源:gyroscope.c
示例3: gyro_store_delay
static ssize_t gyro_store_delay(struct device* dev, struct device_attribute *attr,
const char *buf, size_t count)
{
// struct gyro_context *devobj = (struct gyro_context*)dev_get_drvdata(dev);
int delay;
int mdelay=0;
struct gyro_context *cxt = NULL;
//int err =0;
mutex_lock(&gyro_context_obj->gyro_op_mutex);
cxt = gyro_context_obj;
if(NULL == cxt->gyro_ctl.set_delay)
{
GYRO_LOG("gyro_ctl set_delay NULL\n");
mutex_unlock(&gyro_context_obj->gyro_op_mutex);
return count;
}
if (1 != sscanf(buf, "%d", &delay)) {
GYRO_ERR("invalid format!!\n");
mutex_unlock(&gyro_context_obj->gyro_op_mutex);
return count;
}
if(false == cxt->gyro_ctl.is_report_input_direct)
{
mdelay = (int)delay/1000/1000;
atomic_set(&gyro_context_obj->delay, mdelay);
}
cxt->gyro_ctl.set_delay(delay);
GYRO_LOG(" gyro_delay %d ns\n",delay);
mutex_unlock(&gyro_context_obj->gyro_op_mutex);
return count;
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:33,代码来源:gyroscope.c
示例4: gyro_store_enable_nodata
static ssize_t gyro_store_enable_nodata(struct device* dev, struct device_attribute *attr,
const char *buf, size_t count)
{
GYRO_LOG("gyro_store_enable nodata buf=%s\n",buf);
mutex_lock(&gyro_context_obj->gyro_op_mutex);
struct gyro_context *cxt = NULL;
int err =0;
cxt = gyro_context_obj;
if(NULL == cxt->gyro_ctl.enable_nodata)
{
GYRO_LOG("gyro_ctl enable nodata NULL\n");
mutex_unlock(&gyro_context_obj->gyro_op_mutex);
return count;
}
if (!strncmp(buf, "1", 1))
{
gyro_enable_nodata(1);
}
else if (!strncmp(buf, "0", 1))
{
gyro_enable_nodata(0);
}
else
{
GYRO_ERR(" gyro_store enable nodata cmd error !!\n");
}
mutex_unlock(&gyro_context_obj->gyro_op_mutex);
}
开发者ID:4Fwolf,项目名称:motorola-hawk-kernel-3.4.67,代码行数:28,代码来源:gyroscope.c
示例5: kzalloc
static struct gyro_context *gyro_context_alloc_object(void)
{
struct gyro_context *obj = kzalloc(sizeof(*obj), GFP_KERNEL);
GYRO_LOG("gyro_context_alloc_object++++\n");
if(!obj)
{
GYRO_ERR("Alloc gyro object error!\n");
return NULL;
}
atomic_set(&obj->delay, 200); /*5Hz*/// set work queue delay time 200ms
atomic_set(&obj->wake, 0);
INIT_WORK(&obj->report, gyro_work_func);
init_timer(&obj->timer);
obj->timer.expires = jiffies + atomic_read(&obj->delay)/(1000/HZ);
obj->timer.function = gyro_poll;
obj->timer.data = (unsigned long)obj;
obj->is_first_data_after_enable = false;
obj->is_polling_run = false;
obj->is_batch_enable = false;
obj->cali_sw[GYRO_AXIS_X]=0;
obj->cali_sw[GYRO_AXIS_Y]=0;
obj->cali_sw[GYRO_AXIS_Z]=0;
mutex_init(&obj->gyro_op_mutex);
GYRO_LOG("gyro_context_alloc_object----\n");
return obj;
}
开发者ID:Jlsmily,项目名称:android_kernel_meilan2,代码行数:27,代码来源:gyroscope.c
示例6: gyro_store_delay
static ssize_t gyro_store_delay(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
int64_t delay;
int64_t mdelay = 0;
int ret = 0;
struct gyro_context *cxt = NULL;
mutex_lock(&gyro_context_obj->gyro_op_mutex);
cxt = gyro_context_obj;
if (NULL == cxt->gyro_ctl.set_delay) {
GYRO_LOG("gyro_ctl set_delay NULL\n");
mutex_unlock(&gyro_context_obj->gyro_op_mutex);
return count;
}
ret = kstrtoll(buf, 10, &delay);
if (ret != 0) {
GYRO_ERR("invalid format!!\n");
mutex_unlock(&gyro_context_obj->gyro_op_mutex);
return count;
}
if (false == cxt->gyro_ctl.is_report_input_direct) {
mdelay = delay;
do_div(mdelay, 1000000);
atomic_set(&gyro_context_obj->delay, mdelay);
}
cxt->gyro_ctl.set_delay(delay);
GYRO_LOG(" gyro_delay %lld ns\n", delay);
mutex_unlock(&gyro_context_obj->gyro_op_mutex);
return count;
}
开发者ID:P-D-A,项目名称:android_kernel_lge_mt6753,代码行数:33,代码来源:gyroscope.c
示例7: gyro_store_batch
static ssize_t gyro_store_batch(struct device* dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct gyro_context *cxt = NULL;
//int err =0;
GYRO_LOG("gyro_store_batch buf=%s\n",buf);
mutex_lock(&gyro_context_obj->gyro_op_mutex);
cxt = gyro_context_obj;
if(cxt->gyro_ctl.is_support_batch){
if (!strncmp(buf, "1", 1))
{
cxt->is_batch_enable = true;
}
else if (!strncmp(buf, "0", 1))
{
cxt->is_batch_enable = false;
}
else
{
GYRO_ERR(" gyro_store_batch error !!\n");
}
}else{
GYRO_LOG(" gyro_store_batch not support\n");
}
mutex_unlock(&gyro_context_obj->gyro_op_mutex);
GYRO_LOG(" gyro_store_batch done: %d\n", cxt->is_batch_enable);
return count;
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:30,代码来源:gyroscope.c
示例8: gyro_store_active
static ssize_t gyro_store_active(struct device* dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct gyro_context *cxt = NULL;
//int err =0;
GYRO_LOG("gyro_store_active buf=%s\n",buf);
mutex_lock(&gyro_context_obj->gyro_op_mutex);
cxt = gyro_context_obj;
if(NULL == cxt->gyro_ctl.open_report_data)
{
GYRO_LOG("gyro_ctl enable NULL\n");
mutex_unlock(&gyro_context_obj->gyro_op_mutex);
return count;
}
if (!strncmp(buf, "1", 1))
{
// cxt->gyro_ctl.enable(1);
gyro_enable_data(1);
}
else if (!strncmp(buf, "0", 1))
{
//cxt->gyro_ctl.enable(0);
gyro_enable_data(0);
}
else
{
GYRO_ERR(" gyro_store_active error !!\n");
}
mutex_unlock(&gyro_context_obj->gyro_op_mutex);
GYRO_LOG(" gyro_store_active done\n");
return count;
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:34,代码来源:gyroscope.c
示例9: gyro_real_enable
static int gyro_real_enable(int enable)
{
int err = 0;
struct gyro_context *cxt = NULL;
cxt = gyro_context_obj;
if (1 == enable) {
if (true == cxt->is_active_data || true == cxt->is_active_nodata) {
err = cxt->gyro_ctl.enable_nodata(1);
if (err) {
err = cxt->gyro_ctl.enable_nodata(1);
if (err) {
err = cxt->gyro_ctl.enable_nodata(1);
if (err)
GYRO_ERR("gyro enable(%d) err 3 timers = %d\n", enable, err);
}
}
GYRO_LOG("gyro real enable\n");
}
}
if (0 == enable) {
if (false == cxt->is_active_data && false == cxt->is_active_nodata) {
err = cxt->gyro_ctl.enable_nodata(0);
if (err)
GYRO_ERR("gyro enable(%d) err = %d\n", enable, err);
GYRO_LOG("gyro real disable\n");
}
}
return err;
}
开发者ID:P-D-A,项目名称:android_kernel_lge_mt6753,代码行数:34,代码来源:gyroscope.c
示例10: kzalloc
static struct gyro_context *gyro_context_alloc_object(void)
{
struct gyro_context *obj = kzalloc(sizeof(*obj), GFP_KERNEL);
GYRO_LOG("gyro_context_alloc_object++++\n");
if (!obj) {
GYRO_ERR("Alloc gyro object error!\n");
return NULL;
}
atomic_set(&obj->delay, 200); /*5Hz, set work queue delay time 200ms */
atomic_set(&obj->wake, 0);
INIT_WORK(&obj->report, gyro_work_func);
obj->gyro_workqueue = NULL;
obj->gyro_workqueue = create_workqueue("gyro_polling");
if (!obj->gyro_workqueue) {
kfree(obj);
return NULL;
}
initTimer(&obj->hrTimer, gyro_poll);
obj->is_first_data_after_enable = false;
obj->is_polling_run = false;
obj->is_batch_enable = false;
obj->cali_sw[GYRO_AXIS_X] = 0;
obj->cali_sw[GYRO_AXIS_Y] = 0;
obj->cali_sw[GYRO_AXIS_Z] = 0;
mutex_init(&obj->gyro_op_mutex);
GYRO_LOG("gyro_context_alloc_object----\n");
return obj;
}
开发者ID:P-D-A,项目名称:android_kernel_lge_mt6753,代码行数:30,代码来源:gyroscope.c
示例11: gyro_set_cali
static int gyro_set_cali(int data[GYRO_AXES_NUM])
{
struct gyro_context *cxt = gyro_context_obj;
GYRO_LOG(" factory gyro cali %d,%d,%d \n",data[GYRO_AXIS_X],data[GYRO_AXIS_Y],data[GYRO_AXIS_Z] );
GYRO_LOG(" original gyro cali %d,%d,%d \n",cxt->cali_sw[GYRO_AXIS_X],cxt->cali_sw[GYRO_AXIS_Y],cxt->cali_sw[GYRO_AXIS_Z]);
cxt->cali_sw[GYRO_AXIS_X] += data[GYRO_AXIS_X];
cxt->cali_sw[GYRO_AXIS_Y] += data[GYRO_AXIS_Y];
cxt->cali_sw[GYRO_AXIS_Z] += data[GYRO_AXIS_Z];
GYRO_LOG(" GYRO new cali %d,%d,%d \n",cxt->cali_sw[GYRO_AXIS_X],cxt->cali_sw[GYRO_AXIS_Y],cxt->cali_sw[GYRO_AXIS_Z]);
return 0;
}
开发者ID:AudioGod,项目名称:MediaTek-HelioX10-Kernel,代码行数:12,代码来源:gyro_factory.c
示例12: gyro_show_active
/*----------------------------------------------------------------------------*/
static ssize_t gyro_show_active(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct gyro_context *cxt = NULL;
int div = 0;
cxt = gyro_context_obj;
GYRO_LOG("gyro show active not support now\n");
div = cxt->gyro_data.vender_div;
GYRO_LOG("gyro vender_div value: %d\n", div);
return snprintf(buf, PAGE_SIZE, "%d\n", div);
}
开发者ID:P-D-A,项目名称:android_kernel_lge_mt6753,代码行数:14,代码来源:gyroscope.c
示例13: gyro_enable_data
static int gyro_enable_data(int enable)
{
struct gyro_context *cxt = NULL;
//int err =0;
cxt = gyro_context_obj;
if(NULL == cxt->gyro_ctl.open_report_data)
{
GYRO_ERR("no gyro control path\n");
return -1;
}
if(1 == enable)
{
GYRO_LOG("gyro enable data\n");
cxt->is_active_data =true;
cxt->is_first_data_after_enable = true;
cxt->gyro_ctl.open_report_data(1);
gyro_real_enable(enable);
if(false == cxt->is_polling_run && cxt->is_batch_enable == false)
{
if(false == cxt->gyro_ctl.is_report_input_direct)
{
mod_timer(&cxt->timer, jiffies + atomic_read(&cxt->delay)/(1000/HZ));
cxt->is_polling_run = true;
}
}
}
if(0 == enable)
{
GYRO_LOG("gyro disable \n");
cxt->is_active_data =false;
cxt->gyro_ctl.open_report_data(0);
if(true == cxt->is_polling_run)
{
if(false == cxt->gyro_ctl.is_report_input_direct)
{
cxt->is_polling_run = false;
smp_mb();
del_timer_sync(&cxt->timer);
smp_mb();
cancel_work_sync(&cxt->report);
cxt->drv_data.gyro_data.values[0] = GYRO_INVALID_VALUE;
cxt->drv_data.gyro_data.values[1] = GYRO_INVALID_VALUE;
cxt->drv_data.gyro_data.values[2] = GYRO_INVALID_VALUE;
}
}
gyro_real_enable(enable);
}
return 0;
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:51,代码来源:gyroscope.c
示例14: gyro_register_data_path
int gyro_register_data_path(struct gyro_data_path *data)
{
struct gyro_context *cxt = NULL;
//int err =0;
cxt = gyro_context_obj;
cxt->gyro_data.get_data = data->get_data;
cxt->gyro_data.vender_div = data->vender_div;
GYRO_LOG("gyro register data path vender_div: %d\n", cxt->gyro_data.vender_div);
if(NULL == cxt->gyro_data.get_data)
{
GYRO_LOG("gyro register data path fail \n");
return -1;
}
return 0;
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:15,代码来源:gyroscope.c
示例15: gyro_probe
static int gyro_probe(void)
{
int err;
GYRO_LOG("+++++++++++++gyro_probe!!\n");
gyro_context_obj = gyro_context_alloc_object();
if (!gyro_context_obj) {
err = -ENOMEM;
GYRO_ERR("unable to allocate devobj!\n");
goto exit_alloc_data_failed;
}
/* init real gyroeleration driver */
err = gyro_real_driver_init(pltfm_dev);
if (err) {
GYRO_ERR("gyro real driver init fail\n");
goto real_driver_init_fail;
}
err = gyro_factory_device_init();
if (err)
GYRO_ERR("gyro_factory_device_init fail\n");
/* init input dev */
err = gyro_input_init(gyro_context_obj);
if (err) {
GYRO_ERR("unable to register gyro input device!\n");
goto exit_alloc_input_dev_failed;
}
GYRO_LOG("----gyro_probe OK !!\n");
return 0;
if (err) {
GYRO_ERR("sysfs node creation error\n");
gyro_input_destroy(gyro_context_obj);
}
real_driver_init_fail:
exit_alloc_input_dev_failed:
kfree(gyro_context_obj);
exit_alloc_data_failed:
GYRO_ERR("----gyro_probe fail !!!\n");
return err;
}
开发者ID:P-D-A,项目名称:android_kernel_lge_mt6753,代码行数:48,代码来源:gyroscope.c
示例16: gyro_show_delay
static ssize_t gyro_show_delay(struct device* dev,
struct device_attribute *attr, char *buf)
{
int len = 0;
GYRO_LOG(" not support now\n");
return len;
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:7,代码来源:gyroscope.c
示例17: gyro_factory_device_init
int gyro_factory_device_init()
{
int error = 0;
struct gyro_context *cxt = gyro_context_obj;
if (!cxt->gyro_ctl.is_use_common_factory) {
GYRO_LOG("Node of '/dev/gyroscope' has already existed!\n");
return -1;
}
if ((error = misc_register(&gyro_factory_device)))
{
GYRO_LOG("gyro_factory_device register failed\n");
error = -1;
}
return error;
}
开发者ID:AudioGod,项目名称:MediaTek-HelioX10-Kernel,代码行数:16,代码来源:gyro_factory.c
示例18: gyro_driver_add
int gyro_driver_add(struct gyro_init_info* obj)
{
int err=0;
int i =0;
GYRO_FUN(f);
for(i =0; i < MAX_CHOOSE_GYRO_NUM; i++ )
{
if((i == 0) && (NULL == gyroscope_init_list[0])){
GYRO_LOG("register gyro driver for the first time\n");
if(platform_driver_register(&gyroscope_driver))
{
GYRO_ERR("failed to register gyro driver already exist\n");
}
}
if(NULL == gyroscope_init_list[i])
{
obj->platform_diver_addr = &gyroscope_driver;
gyroscope_init_list[i] = obj;
break;
}
}
if(NULL==gyroscope_init_list[i])
{
GYRO_ERR("gyro driver add err \n");
err=-1;
}
return err;
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:32,代码来源:gyroscope.c
示例19: gyro_store_batch
static ssize_t gyro_store_batch(struct device* dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct gyro_context *cxt = NULL;
//int err =0;
GYRO_LOG("gyro_store_batch buf=%s\n",buf);
mutex_lock(&gyro_context_obj->gyro_op_mutex);
cxt = gyro_context_obj;
if(cxt->gyro_ctl.is_support_batch){
if (!strncmp(buf, "1", 1))
{
cxt->is_batch_enable = true;
if(true == cxt->is_polling_run)
{
cxt->is_polling_run = false;
del_timer_sync(&cxt->timer);
cancel_work_sync(&cxt->report);
cxt->drv_data.gyro_data.values[0] = GYRO_INVALID_VALUE;
cxt->drv_data.gyro_data.values[1] = GYRO_INVALID_VALUE;
cxt->drv_data.gyro_data.values[2] = GYRO_INVALID_VALUE;
}
}
else if (!strncmp(buf, "0", 1))
{
cxt->is_batch_enable = false;
if(false == cxt->is_polling_run)
{
if(false == cxt->gyro_ctl.is_report_input_direct)
{
mod_timer(&cxt->timer, jiffies + atomic_read(&cxt->delay)/(1000/HZ));
cxt->is_polling_run = true;
}
}
}
else
{
GYRO_ERR(" gyro_store_batch error !!\n");
}
}else{
GYRO_LOG(" gyro_store_batch not support\n");
}
mutex_unlock(&gyro_context_obj->gyro_op_mutex);
GYRO_LOG(" gyro_store_batch done: %d\n", cxt->is_batch_enable);
return count;
}
开发者ID:Jlsmily,项目名称:android_kernel_meilan2,代码行数:47,代码来源:gyroscope.c
示例20: gyro_clear_cali
static int gyro_clear_cali(void)
{
struct gyro_context *cxt = gyro_context_obj;
cxt->cali_sw[GYRO_AXIS_X] = 0;
cxt->cali_sw[GYRO_AXIS_Y] = 0;
cxt->cali_sw[GYRO_AXIS_Z] = 0;
GYRO_LOG(" GYRO after clear cali %d,%d,%d \n",cxt->cali_sw[GYRO_AXIS_X],cxt->cali_sw[GYRO_AXIS_Y],cxt->cali_sw[GYRO_AXIS_Z] );
return 0;
}
开发者ID:AudioGod,项目名称:MediaTek-HelioX10-Kernel,代码行数:9,代码来源:gyro_factory.c
注:本文中的GYRO_LOG函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论