• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ FMR_ASSERT函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中FMR_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ FMR_ASSERT函数的具体用法?C++ FMR_ASSERT怎么用?C++ FMR_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了FMR_ASSERT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: bt_host_rfkill_path_get

static int bt_host_rfkill_path_get(int *bt_id, char **state_path) 
{
    char path[128];
    char buf[32];
    int fd, id;
    ssize_t sz;

    FMR_ASSERT(bt_id);
    FMR_ASSERT(state_path);
    
    for(id = 0; id < 10 ; id++){
        snprintf(path, sizeof(path), "/sys/class/rfkill/rfkill%d/type", id);
        fd = open(path, O_RDONLY);
        if(fd < 0){
            LOGE("open(%s) failed\n", path);
            return -1;
        }
        sz = read(fd, &buf, sizeof(buf));
        close(fd);
        if(sz >= 9 && (memcmp(buf, "bluetooth", 9) == 0)){
            *bt_id = id;
            break;
        }
    }

    if (id == 10)
        return -1;

    asprintf(state_path, "/sys/class/rfkill/rfkill%d/state", *bt_id);
    return 0;
}
开发者ID:Bebooo43,项目名称:android_hardware_mediatek,代码行数:31,代码来源:bt_ctrl.cpp


示例2: fm_workthread_add_work

static fm_s32 fm_workthread_add_work(struct fm_workthread *thiz, struct fm_work *work)
{
	FMR_ASSERT(thiz);
	FMR_ASSERT(work);

	queue_work((struct workqueue_struct *)thiz->priv, (struct work_struct *)work->priv);
	return 0;
}
开发者ID:Elnter,项目名称:j608_kernel,代码行数:8,代码来源:fm_utils.c


示例3: fm_spin_lock_unlock

static fm_s32 fm_spin_lock_unlock(struct fm_lock *thiz)
{
	struct task_struct *task = current;
	FMR_ASSERT(thiz);
	FMR_ASSERT(thiz->priv);

	FM_LOG_DBG(MAIN, "%s <---unlock, pid=%d\n", thiz->name, task->pid);
	spin_unlock_bh((spinlock_t *) thiz->priv);
	return 0;
}
开发者ID:Elnter,项目名称:j608_kernel,代码行数:10,代码来源:fm_utils.c


示例4: fm_lock_unlock

static fm_s32 fm_lock_unlock(struct fm_lock *thiz)
{
	struct semaphore *sem;
	struct task_struct *task = current;
	FMR_ASSERT(thiz);
	FMR_ASSERT(thiz->priv);
	sem = (struct semaphore *)thiz->priv;
	FM_LOG_DBG(MAIN, "%s <---unlock, cnt=%d, pid=%d\n", thiz->name, (int)sem->count + 1, task->pid);
	up((struct semaphore *)thiz->priv);
	return 0;
}
开发者ID:Elnter,项目名称:j608_kernel,代码行数:11,代码来源:fm_utils.c


示例5: fm_lock_lock

/* fm try lock methods */
static fm_s32 fm_lock_lock(struct fm_lock *thiz)
{
	struct semaphore *sem;
	struct task_struct *task = current;
	FMR_ASSERT(thiz);
	FMR_ASSERT(thiz->priv);

	if (down_interruptible((struct semaphore *)thiz->priv)) {
		WCN_DBG(FM_CRT | MAIN, "get mutex failed\n");
		return -FM_ELOCK;
	}

	sem = (struct semaphore *)thiz->priv;
	FM_LOG_DBG(MAIN, "%s --->lock, cnt=%d, pid=%d\n", thiz->name, (int)sem->count, task->pid);
	return 0;
}
开发者ID:Elnter,项目名称:j608_kernel,代码行数:17,代码来源:fm_utils.c


示例6: fm_cust_config_default

static fm_s32 fm_cust_config_default(fm_cust_cfg *cfg)
{
	FMR_ASSERT(cfg);
#if (!defined(MT6628_FM) && !defined(MT6620_FM) && !defined(MT6627_FM) && !defined(MT6580_FM) && !defined(MT6630_FM))

	cfg->rx_cfg.long_ana_rssi_th = FM_RX_RSSI_TH_LONG;
	cfg->rx_cfg.short_ana_rssi_th = FM_RX_RSSI_TH_SHORT;
	cfg->rx_cfg.cqi_th = FM_RX_CQI_TH;
	cfg->rx_cfg.mr_th = FM_RX_MR_TH;
	cfg->rx_cfg.smg_th = FM_RX_SMG_TH;
	cfg->rx_cfg.scan_ch_size = FM_RX_SCAN_CH_SIZE;
	cfg->rx_cfg.seek_space = FM_RX_SEEK_SPACE;
	cfg->rx_cfg.band = FM_RX_BAND;
	cfg->rx_cfg.band_freq_l = FM_RX_BAND_FREQ_L;
	cfg->rx_cfg.band_freq_h = FM_RX_BAND_FREQ_H;
	cfg->rx_cfg.scan_sort = FM_RX_SCAN_SORT_SELECT;
	cfg->rx_cfg.fake_ch_num = FM_RX_FAKE_CH_NUM;
	cfg->rx_cfg.fake_ch_rssi_th = FM_RX_FAKE_CH_RSSI;
	cfg->rx_cfg.fake_ch[0] = FM_RX_FAKE_CH_1;
	cfg->rx_cfg.fake_ch[1] = FM_RX_FAKE_CH_2;
	cfg->rx_cfg.fake_ch[2] = FM_RX_FAKE_CH_3;
	cfg->rx_cfg.fake_ch[3] = FM_RX_FAKE_CH_4;
	cfg->rx_cfg.fake_ch[4] = FM_RX_FAKE_CH_5;
	cfg->rx_cfg.deemphasis = FM_RX_DEEMPHASIS;

	cfg->tx_cfg.scan_hole_low = FM_TX_SCAN_HOLE_LOW;
	cfg->tx_cfg.scan_hole_high = FM_TX_SCAN_HOLE_HIGH;
	cfg->tx_cfg.power_level = FM_TX_PWR_LEVEL_MAX;
#endif
	return 0;
}
开发者ID:Elnter,项目名称:j608_kernel,代码行数:31,代码来源:fm_config.c


示例7: fm_cdev_destroy

static fm_s32  fm_cdev_destroy(struct fm *fm)
{
    FMR_ASSERT(fm);

    device_destroy(fm->platform.cls, fm->platform.dev_t);
    class_destroy(fm->platform.cls);
    cdev_del(&fm->platform.cdev);
    unregister_chrdev_region(fm->platform.dev_t, 1);

    return 0;
}
开发者ID:Dee-UK,项目名称:RK3188_KK_4.4.02_Beta,代码行数:11,代码来源:fm_module.c


示例8: fm_mod_destroy

static fm_s32 fm_mod_destroy(struct fm *fm)
{
    fm_s32 ret = 0;

    FMR_ASSERT(fm);

    WCN_DBG(FM_NTC | MAIN, "%s\n", __func__);
    remove_proc_entry(FM_PROC_FILE, NULL);
    fm_cdev_destroy(fm);
    fm_dev_destroy(fm);

    return ret;
}
开发者ID:Dee-UK,项目名称:RK3188_KK_4.4.02_Beta,代码行数:13,代码来源:fm_module.c


示例9: fmtx_open_dev

static int fmtx_open_dev(char *pname, int *fd)
{
    int ret = 0;
	int flag = 0;
	int tmp = -1;

	FMR_ASSERT(pname);
	FMR_ASSERT(fd);
	
    tmp = open(pname, O_RDWR);
    if (tmp < 0) {
        LOGE("Open %s failed, %s\n", pname, strerror(errno));
		ret = -ERR_INVALID_FD;
	}
	*fd = tmp;

	flag = fcntl(*fd, F_GETFL, tmp);
	ret = fcntl(*fd, F_SETFD, flag|FD_CLOEXEC);
	if(ret < 0){
		LOGE("fcntl %s failed, %s\n", pname, strerror(errno));
	}
	LOGI("%s, [fd=%d] [ret=%d]\n", __func__, *fd, ret);
    return ret;
}
开发者ID:LuckJC,项目名称:pro-mk,代码行数:24,代码来源:ftm_fmtx.c


示例10: fm_workthread_put

fm_s32 fm_workthread_put(struct fm_workthread *thiz)
{
	FMR_ASSERT(thiz);
	thiz->ref--;

	if (thiz->ref == 0) {
		destroy_workqueue((struct workqueue_struct *)thiz->priv);
		fm_free(thiz);
		return 0;
	} else if (thiz->ref > 0) {
		return -FM_EINUSE;
	} else {
		return -FM_EPARA;
	}
}
开发者ID:Elnter,项目名称:j608_kernel,代码行数:15,代码来源:fm_utils.c


示例11: fm_work_put

fm_s32 fm_work_put(struct fm_work *thiz)
{
	FMR_ASSERT(thiz);
	thiz->ref--;

	if (thiz->ref == 0) {
		fm_free(thiz->priv);
		fm_free(thiz);
		return 0;
	} else if (thiz->ref > 0) {
		return -FM_EINUSE;
	} else {
		return -FM_EPARA;
	}
}
开发者ID:Elnter,项目名称:j608_kernel,代码行数:15,代码来源:fm_utils.c


示例12: fm_fifo_in

fm_s32 fm_fifo_in(struct fm_fifo *thiz, void *item)
{
	FMR_ASSERT(item);

	if (thiz->len < thiz->size) {
		fm_memcpy((thiz->obj.priv + (thiz->item_size * thiz->in)), item, thiz->item_size);
		thiz->in = (thiz->in + 1) % thiz->size;
		thiz->len++;
		/* WCN_DBG(FM_DBG | MAIN, "add a new item[len=%d]\n", thiz->len); */
	} else {
		WCN_DBG(FM_WAR | MAIN, "%s fifo is full\n", thiz->obj.name);
		return -FM_ENOMEM;
	}

	return 0;
}
开发者ID:Elnter,项目名称:j608_kernel,代码行数:16,代码来源:fm_utils.c


示例13: bt_host_pwr_state_get

static int bt_host_pwr_state_get(int *state) 
{
    int sz;
    int fd = -1;
    int ret = 0;
    char sta;
    int bt_rfkill_id = -1;
    char *bt_rfkill_state_path = NULL;

    FMR_ASSERT(state);
    
    if(bt_rfkill_id == -1){
        ret = bt_host_rfkill_path_get(&bt_rfkill_id, &bt_rfkill_state_path);
        if(ret){
            LOGE("get bt rfkill sate path failed\n");
            return ret;
        }
    }

    fd = open(bt_rfkill_state_path, O_RDONLY);
    if(fd < 0){
        LOGE("open(%s) failed\n", bt_rfkill_state_path);
        return fd;
    }
    sz = read(fd, &sta, 1);
    if(sz != 1){
        LOGE("read(%s) failed", bt_rfkill_state_path);
        close(fd);
        return -1;
    }

    switch(sta){
    case '1':
        *state = BT_PWR_ON;
        break;
    case '0':
        *state = BT_PWR_OFF;
        break;
    default:
        LOGE("unknown bt pwr state\n");
        ret = -1;
    }

    free(bt_rfkill_state_path);
	close(fd);
    return ret;
}
开发者ID:Bebooo43,项目名称:android_hardware_mediatek,代码行数:47,代码来源:bt_ctrl.cpp


示例14: MT6630fm_cust_config_default

static fm_s32 MT6630fm_cust_config_default(fm_cust_cfg *cfg)
{
	FMR_ASSERT(cfg);

	cfg->rx_cfg.long_ana_rssi_th = FM_RX_RSSI_TH_LONG_MT6630;
	cfg->rx_cfg.short_ana_rssi_th = FM_RX_RSSI_TH_SHORT_MT6630;
	cfg->rx_cfg.desene_rssi_th = FM_RX_DESENSE_RSSI_MT6630;
	cfg->rx_cfg.pamd_th = FM_RX_PAMD_TH_MT6630;
	cfg->rx_cfg.mr_th = FM_RX_MR_TH_MT6630;
	cfg->rx_cfg.atdc_th = FM_RX_ATDC_TH_MT6630;
	cfg->rx_cfg.prx_th = FM_RX_PRX_TH_MT6630;
	cfg->rx_cfg.smg_th = FM_RX_SMG_TH_MT6630;
	cfg->rx_cfg.deemphasis = FM_RX_DEEMPHASIS_MT6630;
	cfg->rx_cfg.osc_freq = FM_RX_OSC_FREQ_MT6630;

	cfg->tx_cfg.pamd_th = FM_TX_PAMD_TH_MT6630;
	cfg->tx_cfg.mr_th = FM_TX_MR_TH_MT6630;
	cfg->tx_cfg.smg_th = FM_TX_SMG_TH_MT6630;

#ifdef CONFIG_MTK_MERGE_INTERFACE_SUPPORT
	cfg->aud_cfg.aud_path = FM_AUD_MRGIF;
	cfg->aud_cfg.i2s_info.status = FM_I2S_OFF;
	cfg->aud_cfg.i2s_info.mode = FM_I2S_SLAVE;
	cfg->aud_cfg.i2s_info.rate = FM_I2S_44K;
	cfg->aud_cfg.i2s_pad = FM_I2S_PAD_IO;
#elif defined FM_DIGITAL_INPUT
	cfg->aud_cfg.aud_path = FM_AUD_I2S;
	cfg->aud_cfg.i2s_info.status = FM_I2S_OFF;
	cfg->aud_cfg.i2s_info.mode = FM_I2S_SLAVE;
	cfg->aud_cfg.i2s_info.rate = FM_I2S_44K;
	cfg->aud_cfg.i2s_pad = FM_I2S_PAD_IO;
#elif defined FM_ANALOG_INPUT
	cfg->aud_cfg.aud_path = FM_AUD_ANALOG;
	cfg->aud_cfg.i2s_info.status = FM_I2S_STATE_ERR;
	cfg->aud_cfg.i2s_info.mode = FM_I2S_MODE_ERR;
	cfg->aud_cfg.i2s_info.rate = FM_I2S_SR_ERR;
	cfg->aud_cfg.i2s_pad = FM_I2S_PAD_ERR;
#else
	cfg->aud_cfg.aud_path = FM_AUD_ERR;
	cfg->aud_cfg.i2s_info.status = FM_I2S_STATE_ERR;
	cfg->aud_cfg.i2s_info.mode = FM_I2S_MODE_ERR;
	cfg->aud_cfg.i2s_info.rate = FM_I2S_SR_ERR;
	cfg->aud_cfg.i2s_pad = FM_I2S_PAD_ERR;
#endif

	return 0;
}
开发者ID:hacknmtk,项目名称:android_kernel_alcatel_5017,代码行数:47,代码来源:mt6630_fm_config.c


示例15: MT6630fm_cust_config_default

static fm_s32 MT6630fm_cust_config_default(fm_cust_cfg *cfg)
{
    FMR_ASSERT(cfg);

    cfg->rx_cfg.long_ana_rssi_th = FM_RX_RSSI_TH_LONG_MT6630;
    cfg->rx_cfg.short_ana_rssi_th = FM_RX_RSSI_TH_SHORT_MT6630;
    cfg->rx_cfg.desene_rssi_th = FM_RX_DESENSE_RSSI_MT6630;
    cfg->rx_cfg.pamd_th = FM_RX_PAMD_TH_MT6630;
    cfg->rx_cfg.mr_th = FM_RX_MR_TH_MT6630;
    cfg->rx_cfg.atdc_th = FM_RX_ATDC_TH_MT6630;
    cfg->rx_cfg.prx_th = FM_RX_PRX_TH_MT6630;
    cfg->rx_cfg.smg_th = FM_RX_SMG_TH_MT6630;
    cfg->rx_cfg.deemphasis = FM_RX_DEEMPHASIS_MT6630;
	cfg->rx_cfg.osc_freq = FM_RX_OSC_FREQ_MT6630;

    return 0;
}
开发者ID:huyparody,项目名称:OT_7047D,代码行数:17,代码来源:mt6630_fm_config.c


示例16: fm_trace_in

fm_s32 fm_trace_in(struct fm_trace_fifo_t *thiz, struct fm_trace_t *new_tra)
{
	FMR_ASSERT(new_tra);

	if (thiz->len < thiz->size) {
		fm_memcpy(&(thiz->trace[thiz->in]), new_tra, sizeof(struct fm_trace_t));
		thiz->trace[thiz->in].time = jiffies;
		thiz->in = (thiz->in + 1) % thiz->size;
		thiz->len++;
		/* WCN_DBG(FM_DBG | RDSC, "add a new tra[len=%d]\n", thiz->len); */
	} else {
		WCN_DBG(FM_WAR | RDSC, "tra buf is full\n");
		return -FM_ENOMEM;
	}

	return 0;
}
开发者ID:nxglabs,项目名称:mt6735-kernel-3.10.61,代码行数:17,代码来源:fm_link.c


示例17: bt_host_init_uart

static int bt_host_init_uart(char *dev)
{
	struct termios ti;
	int fd, i;

    FMR_ASSERT(dev);
    
	fd = open(dev, O_RDWR | O_NOCTTY);
	if(fd < 0){
		LOGE("Can't open serial port\n");
		return -1;
	}

	tcflush(fd, TCIOFLUSH);

	if(tcgetattr(fd, &ti) < 0){
        LOGE("unable to get UART port setting\n");
		return -1;
	}

	cfmakeraw(&ti);

	ti.c_cflag |= CLOCAL;
	ti.c_cflag &= ~CRTSCTS;

    ti.c_lflag = 0;
    ti.c_cc[VTIME]    = 5; /* 0.5 sec */
    ti.c_cc[VMIN]     = 0;

	if(tcsetattr(fd, TCSANOW, &ti) < 0){
		LOGE("Can't set port settings\n");
		return -1;
	}

	/* Set initial baudrate */
	cfsetospeed(&ti, B115200);
	cfsetispeed(&ti, B115200);

    tcsetattr(fd, TCSANOW, &ti);
	tcflush(fd, TCIOFLUSH);

	return fd;
}
开发者ID:Bebooo43,项目名称:android_hardware_mediatek,代码行数:43,代码来源:bt_ctrl.cpp


示例18: fm_timer_get

fm_s32 fm_timer_get(struct fm_timer *thiz)
{
	FMR_ASSERT(thiz);
	thiz->ref++;
	return 0;
}
开发者ID:Elnter,项目名称:j608_kernel,代码行数:6,代码来源:fm_utils.c


示例19: cfg_parser

fm_s32 cfg_parser(fm_s8 *buffer, CFG_HANDLER handler, fm_cust_cfg *cfg)
{
	fm_s32 ret = 0;
	fm_s8 *p = buffer;
	fm_s8 *group_start = NULL;
	fm_s8 *key_start = NULL;
	fm_s8 *value_start = NULL;

	enum fm_cfg_parser_state state = FM_CFG_STAT_NONE;

	FMR_ASSERT(p);

	for (p = buffer; *p != '\0'; p++) {
		switch (state) {
		case FM_CFG_STAT_NONE:{
				if (*p == '[') {
					/* if we get char '[' in none state, it means a new group name start */
					state = FM_CFG_STAT_GROUP;
					group_start = p + 1;
				} else if (*p == COMMENT_CHAR) {
					/* if we get char '#' in none state, it means a new comment start */
					state = FM_CFG_STAT_COMMENT;
				} else if (!isspace(*p) && (*p != '\n') && (*p != '\r')) {
					/* if we get an nonspace char in none state, it means a new key start */
					state = FM_CFG_STAT_KEY;
					key_start = p;
				}

				break;
			}
		case FM_CFG_STAT_GROUP:{
				if (*p == ']') {
					/* if we get char ']' in group state, it means a group name complete */
					*p = '\0';
					/* FIX_ME */
					/* record group name */
					state = FM_CFG_STAT_NONE;
					trim_string(&group_start);
					/* WCN_DBG(FM_NTC|MAIN, "g=%s\n", group_start); */
				}

				break;
			}
		case FM_CFG_STAT_COMMENT:{
				if (*p == '\n') {
					/* if we get char '\n' in comment state, it means new line start */
					state = FM_CFG_STAT_NONE;
					group_start = p + 1;
				}

				break;
			}
		case FM_CFG_STAT_KEY:{
				if (*p == DELIMIT_CHAR) {
					/* if we get char '=' in key state, it means a key name complete */
					*p = '\0';
					/* FIX_ME */
					/* record key name */
					state = FM_CFG_STAT_VALUE;
					value_start = p + 1;
					trim_string(&key_start);
					/* WCN_DBG(FM_NTC|MAIN, "k=%s\n", key_start); */
				}

				break;
			}
		case FM_CFG_STAT_VALUE:{
				if (*p == '\n' || *p == '\r') {
					/* if we get char '\n' or '\r' in value state, it means a value complete */
					*p = '\0';
					/* record value */
					trim_string(&value_start);
					/* WCN_DBG(FM_NTC|MAIN, "v=%s\n", value_start); */

					if (handler)
						ret = handler(group_start, key_start, value_start, cfg);

					state = FM_CFG_STAT_NONE;
				}

				break;
			}
		default:
			break;
		}
	}

	return ret;
}
开发者ID:Elnter,项目名称:j608_kernel,代码行数:89,代码来源:fm_config.c


示例20: fm_workthread_get

fm_s32 fm_workthread_get(struct fm_workthread *thiz)
{
	FMR_ASSERT(thiz);
	thiz->ref++;
	return 0;
}
开发者ID:Elnter,项目名称:j608_kernel,代码行数:6,代码来源:fm_utils.c



注:本文中的FMR_ASSERT函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ FMS函数代码示例发布时间:2022-05-30
下一篇:
C++ FMOD_System_Update函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap