当前位置: 首页>>代码示例>>C++>>正文


C++ DBG1函数代码示例

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


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

示例1: skb_push

static struct sk_buff *rmnet_usb_tx_fixup(struct usbnet *dev,
		struct sk_buff *skb, gfp_t flags)
{
	struct QMI_QOS_HDR_S	*qmih;

	if (test_bit(RMNET_MODE_QOS, &dev->data[0])) {
		qmih = (struct QMI_QOS_HDR_S *)
		skb_push(skb, sizeof(struct QMI_QOS_HDR_S));
		qmih->version = 1;
		qmih->flags = 0;
		qmih->flow_id = skb->mark;
	 }

	DBG1("[%s] Tx packet #%lu len=%d mark=0x%x\n",
	    dev->net->name, dev->net->stats.tx_packets, skb->len, skb->mark);

	return skb;
}
开发者ID:android-armv7a-belalang-tempur,项目名称:android_kernel_samsung_smdk4210-1,代码行数:18,代码来源:rmnet_usb_data.c

示例2: return

int RVB::init(double p[], int n_args)
{
    float  outskip, inskip, rvb_time;

    outskip = p[0];
    inskip = p[1];
    m_dur = p[2];
    if (m_dur < 0)                      /* "dur" represents timend */
        m_dur = -m_dur - inskip;

	if (rtsetinput(inskip, this) == -1) { // no input
	  return(DONT_SCHEDULE);
	}

    insamps = (int)(m_dur * SR);
    m_amp = p[3];

    if (inputChannels() != 2)
		return die(name(), "Input must be stereo.");

	if (outputChannels() != 2)
		return die(name(), "Output must be stereo.");

    double Matrix[12][12];
   
    /* Get results of Minc setup calls (space, mikes_on, mikes_off, matrix) */
    if (get_rvb_setup_params(Dimensions, Matrix, &rvb_time) == -1)
       return die(name(), "You must call setup routine `space' first.");
    /* (perform some initialization that used to be in space.c) */
    int meanLength = MFP_samps(SR, Dimensions); // mean delay length for reverb
    get_lengths(meanLength);              /* sets up delay lengths */
    set_gains(rvb_time);                		/* sets gains for filters */
	set_random();                       /* sets up random variation of delays */
    set_allpass();
   
	wire_matrix(Matrix);

	_skip = (int) (SR / (float) resetval);
	
	if (rtsetoutput(outskip, m_dur + rvb_time, this) == -1)
		return DONT_SCHEDULE;
	DBG1(printf("nsamps = %d\n", nSamps()));
	return nSamps();
}
开发者ID:eriser,项目名称:rtcmix-android,代码行数:44,代码来源:RVB.cpp

示例3: usb_read

int usb_read(usb_handle *h, void *_data, int len)
{
    unsigned char *data = (unsigned char*) _data;
    unsigned count = 0;
    struct usbdevfs_bulktransfer bulk;
    int n, retry;

    if(h->ep_in == 0) {
        return -1;
    }

    while(len > 0) {
        int xfer = (len > MAX_USBFS_BULK_SIZE) ? MAX_USBFS_BULK_SIZE : len;

        bulk.ep = h->ep_in;
        bulk.len = xfer;
        bulk.data = data;
        bulk.timeout = 0;
        retry = 0;

        do{
           DBG("[ usb read %d fd = %d], fname=%s\n", xfer, h->desc, h->fname);
           n = ioctl(h->desc, USBDEVFS_BULK, &bulk);
           DBG("[ usb read %d ] = %d, fname=%s, Retry %d \n", xfer, n, h->fname, retry);

           if( n < 0 ) {
            DBG1("ERROR: n = %d, errno = %d (%s)\n",n, errno, strerror(errno));
            if ( ++retry > MAX_RETRIES ) return -1;
            sleep( 1 );
           }
        }
        while( n < 0 );

        count += n;
        len -= n;
        data += n;

        if(n < xfer) {
            break;
        }
    }

    return count;
}
开发者ID:xwaynec,项目名称:Vixen-system,代码行数:44,代码来源:usb_linux.c

示例4: ps2_main

void ps2_main(void){

    m_state = STA_WAIT_RESET;
    kbd_init();

    keymap_init();
    clear();

    //set key repeat speed;
    uint8_t gSpeed = eeprom_read_byte((uint8_t *)EEPROM_PS2_REPEAT_SPEED);
    if(gSpeed == 0xFF) gSpeed = 1;
    if(ps2_repeat_speed == PS2_REPEAT_SPEED_NONE){
    	ps2_repeat_speed = gSpeed;
    }else if(ps2_repeat_speed != gSpeed){
    	eeprom_write_byte((uint8_t *)EEPROM_PS2_REPEAT_SPEED, ps2_repeat_speed);
    }


    // init
    setKeyScanDriver(&driverKeyScanPs2);
    setUpdateDriver(&updatePs2);
    clearMatrix();

//    DEBUG_PRINT(("STARTING PS/2 KEYBOARD\n"));

    sei();
//    DBG1(0x90, 0, 0);
    for(;;){

        // 카운트 이내에 신호가 잡히지 않으면 이동;
        // 특별한 경우에만 발생하는 현상이다.
        if(INTERFACE == INTERFACE_PS2 && interfaceReady == false && interfaceCount++ > 1000){
            // move to usb
            INTERFACE = INTERFACE_USB;
            DBG1(0x99, 0, 0);
            break;
        }

        processRxPs2();
        processTxPs2();

    }
//    DBG1(0x9F, 0, 0);
}
开发者ID:HaNeul-Kim,项目名称:ps2avrU,代码行数:44,代码来源:ps2main.c

示例5: serve

/**
 * Server routine
 */
static int serve(host_t *host, identification_t *server,
                 int times, tls_cache_t *cache)
{
    tls_socket_t *tls;
    int fd, cfd;

    fd = socket(AF_INET, SOCK_STREAM, 0);
    if (fd == -1)
    {
        DBG1(DBG_TLS, "opening socket failed: %s", strerror(errno));
        return 1;
    }
    if (bind(fd, host->get_sockaddr(host),
             *host->get_sockaddr_len(host)) == -1)
    {
        DBG1(DBG_TLS, "binding to %#H failed: %s", host, strerror(errno));
        close(fd);
        return 1;
    }
    if (listen(fd, 1) == -1)
    {
        DBG1(DBG_TLS, "listen to %#H failed: %m", host, strerror(errno));
        close(fd);
        return 1;
    }

    while (times == -1 || times-- > 0)
    {
        cfd = accept(fd, host->get_sockaddr(host), host->get_sockaddr_len(host));
        if (cfd == -1)
        {
            DBG1(DBG_TLS, "accept failed: %s", strerror(errno));
            close(fd);
            return 1;
        }
        DBG1(DBG_TLS, "%#H connected", host);

        tls = tls_socket_create(TRUE, server, NULL, cfd, cache, TLS_1_2, TRUE);
        if (!tls)
        {
            close(fd);
            return 1;
        }
        tls->splice(tls, 0, 1);
        DBG1(DBG_TLS, "%#H disconnected", host);
        tls->destroy(tls);
    }
    close(fd);

    return 0;
}
开发者ID:21superman,项目名称:strongswan,代码行数:54,代码来源:tls_test.c

示例6: chunk_to_sequence

void chunk_to_sequence(const chunk_t * const chunk, void *sequence,
					   const uint32_t typelen)
{
	const uint32_t seqlenmax = typelen - sizeof(uint32_t);
	sequence_type *seq = sequence;

	memset(sequence, 0, typelen);
	if (chunk->len > seqlenmax)
	{
		DBG1(DBG_LIB, "chunk too large to fit into sequence %d > %d, limiting"
			 " to %d bytes", chunk->len, seqlenmax, seqlenmax);
		seq->size = seqlenmax;
	}
	else
	{
		seq->size = chunk->len;
	}
	memcpy(seq->data, chunk->ptr, seq->size);
}
开发者ID:21superman,项目名称:strongswan,代码行数:19,代码来源:tkm_utils.c

示例7: MuteStatusChange

// 改变Mute状态
VOID MuteStatusChange(VOID)
{	
	DBG((">>MuteStatusChange()\n"));
	if(gSys.MuteFg)
	{
		gSys.MuteFg = FALSE;		
		UnMute();	
		DBG1(("4433\n"));
	}
	else
	{	
		gSys.MuteFg = TRUE;
		MuteOn(TRUE, TRUE);       
	}
#ifdef FUNC_DISP_EN
   	DispMute();
#endif	
	DBG(("<<MuteStatusChange()\n"));
}
开发者ID:BarryChen,项目名称:au6210_oem_bt168,代码行数:20,代码来源:user_interface.c

示例8: pt_tls_read

/**
 * Read a PT-TLS message, return header data
 */
bio_reader_t* pt_tls_read(tls_socket_t *tls, uint32_t *vendor,
						  uint32_t *type, uint32_t *identifier)
{
	bio_reader_t *reader;
	uint32_t len;
	uint8_t reserved;

	reader = read_tls(tls, PT_TLS_HEADER_LEN);
	if (!reader)
	{
		return NULL;
	}
	if (!reader->read_uint8(reader, &reserved) ||
		!reader->read_uint24(reader, vendor) ||
		!reader->read_uint32(reader, type) ||
		!reader->read_uint32(reader, &len) ||
		!reader->read_uint32(reader, identifier))
	{
		reader->destroy(reader);
		return NULL;
	}
	reader->destroy(reader);

	if (len < PT_TLS_HEADER_LEN)
	{
		DBG1(DBG_TNC, "received short PT-TLS header (%d bytes)", len);
		return NULL;
	}

	if (*vendor == PEN_IETF)
	{
		DBG2(DBG_TNC, "received PT-TLS message #%d of type '%N' (%d bytes)",
					  *identifier, pt_tls_message_type_names, *type, len);
	}
	else
	{
		DBG2(DBG_TNC, "received PT-TLS message #%d of unknown type "
					  "0x%06x/0x%08x (%d bytes)",
					  *identifier, *vendor, *type, len);
	}

	return read_tls(tls, len - PT_TLS_HEADER_LEN);
}
开发者ID:FancyMariusz,项目名称:strongswan,代码行数:46,代码来源:pt_tls.c

示例9: SECMOD_GetDefaultModuleList

static SECMODModule *find_module_by_library(char *pkcs11_module)
{
  SECMODModule *module = NULL;
  SECMODModuleList *modList = SECMOD_GetDefaultModuleList();

  /* threaded applications should also acquire the
   * DefaultModuleListLock */
  DBG("Looking up module in list");
  for ( ; modList; modList = modList->next) {
    char *dllName = modList->module->dllName;
    DBG2("modList = 0x%x next = 0x%x\n", modList, modList->next);
    DBG1("dllName= %s \n", dllName ? dllName : "<null>");
    if (dllName && strcmp(dllName,pkcs11_module) == 0) {
        module = SECMOD_ReferenceModule(modList->module);
        break;
    }
  }
  return module;
}
开发者ID:dirkx,项目名称:pam_pkcs11,代码行数:19,代码来源:pkcs11_lib.c

示例10: usbFunctionWrite

/**
 * The write function is called when LEDs should be set. Normally, we get only
 * one byte that contains info about the LED states.
 * \param data pointer to received data
 * \param len number ob bytes received
 * \return 0x01
 */
uint8_t usbFunctionWrite(uchar *data, uchar len) {
//    DBG1(0xBB, (uchar *)&len, 1);
    if (expectReport == 1 && (len == 1)) {
        // change LEDs of indicator
        delegateLedUsb(data[0]);
        expectReport = 0;
    }else if (expectReport == 2){   // options
        DBG1(0xEE, data, len);
        // start bootloader
        if(data[1] == OPTION_INDEX_BOOTLOADER && len == 8){
        	if(data[2] == 0xFF){
        		eeprom_write_byte((uint8_t *)EEPROM_BOOTLOADER_START, 0x00);
        	}
        	delegateGotoBootloader();
/* TODO
 * 이전 버전과 호환을 위해 남겨둠
 */
#ifdef ENABLE_BOOTMAPPER
        }else if(data[1] == OPTION_INDEX_BOOTMAPPER){
        	if(data[2] == OPTION_VALUE_BOOTMAPPER_START){
        		setToBootMapper(true);
        	}else{
        		setToBootMapper(false);
        	}
#endif
       /* }else if(data[1] == OPTION_INDEX_READY){
            stopPwmForUsbReport(true);

        }else if(data[1] == OPTION_INDEX_ACTION){
            stopPwmForUsbReport(false);*/
        }else{
        	setOptions((uint8_t *)data);
        }
    }else if (expectReport == 4){
    	// rainbow color setting
    	setOptions((uint8_t *)data);
    }else if (expectReport == 5){
        // write quick macro;
        updateQuickMacro((uint8_t *)data, len);
    }

    return 0x01;
}
开发者ID:super-fishz,项目名称:ps2avrU,代码行数:50,代码来源:vusb.c

示例11: nozomi_card_exit

/* Deallocate memory for one device */
static void nozomi_card_exit(struct pci_dev *pdev)
{
	int i;
	struct ctrl_ul ctrl;
	struct nozomi *dc = pci_get_drvdata(pdev);

	/* Disable all interrupts */
	dc->last_ier = 0;
	writew(dc->last_ier, dc->reg_ier);

	tty_exit(dc);

	/* Send 0x0001, command card to resend the reset token.  */
	/* This is to get the reset when the module is reloaded. */
	ctrl.port = 0x00;
	ctrl.reserved = 0;
	ctrl.RTS = 0;
	ctrl.DTR = 1;
	DBG1("sending flow control 0x%04X", *((u16 *)&ctrl));

	/* Setup dc->reg addresses to we can use defines here */
	write_mem32(dc->port[PORT_CTRL].ul_addr[0], (u32 *)&ctrl, 2);
	writew(CTRL_UL, dc->reg_fcr);	/* push the token to the card. */

	remove_sysfs_files(dc);

	free_irq(pdev->irq, dc);

	for (i = 0; i < MAX_PORT; i++)
		kfifo_free(&dc->port[i].fifo_ul);

	kfree(dc->send_buf);

	iounmap(dc->base_addr);

	pci_release_regions(pdev);

	pci_disable_device(pdev);

	ndevs[dc->index_start / MAX_PORT] = NULL;

	kfree(dc);
}
开发者ID:ReneNyffenegger,项目名称:linux,代码行数:44,代码来源:nozomi.c

示例12: leaveBootloader

static void leaveBootloader() {
    DBG1(0x01, 0, 0);
    bootLoaderExit();
    cli();
    boot_rww_enable();
    USB_INTR_ENABLE = 0;
    USB_INTR_CFG = 0;       /* also reset config bits */
#if F_CPU == 12800000
    TCCR0 = 0;              /* default value */
#endif
    GICR = (1 << IVCE);     /* enable change of interrupt vectors */
    GICR = (0 << IVSEL);    /* move interrupts to application flash section */
/* We must go through a global function pointer variable instead of writing
 *  ((void (*)(void))0)();
 * because the compiler optimizes a constant 0 to "rcall 0" which is not
 * handled correctly by the assembler.
 */
    nullVector();
}
开发者ID:agural,项目名称:Photuris,代码行数:19,代码来源:main.c

示例13: spin_lock_irqsave

static struct sk_buff *rmnet_usb_tx_fixup(struct usbnet *dev,
		struct sk_buff *skb, gfp_t flags)
{
	struct QMI_QOS_HDR_S	*qmih;
//++SSD_RIL:20120731: For tx/rx enable_hlt/disable_hlt
	if (rnmet_usb_hlt_enabled == 1 ) {
//++SSD_RIL:20120814: For CPU/Freq min default value
		int is_disable_flt = 0;
//--SSD_RIL
		unsigned long flags = 0;
		spin_lock_irqsave(&rmnet_usb_hlt_lock, flags);
		if ( rnmet_usb_hlt_timer_enabled == 0 ) {
			rnmet_usb_hlt_timer_enabled = 1;
			disable_hlt();
//++SSD_RIL:20120814: For CPU/Freq min default value
			is_disable_flt = 1;
//--SSD_RIL
			pr_info("%s: rmnet hlt disable\n", __func__);
		}
		del_timer(&rmnet_usb_lp2_in_idle_timer);
		mod_timer(&rmnet_usb_lp2_in_idle_timer, jiffies + msecs_to_jiffies(2000));
		spin_unlock_irqrestore(&rmnet_usb_hlt_lock, flags);
//++SSD_RIL:20120814: For CPU/Freq min default value
		if ( is_disable_flt == 1 && rnmet_usb_cpu_freq_enabled == 1 ) {
			rmnet_usb_freq_timer_enable();
		}
//--SSD_RIL
	}
//--SSD_RIL
	if (test_bit(RMNET_MODE_QOS, &dev->data[0])) {
		qmih = (struct QMI_QOS_HDR_S *)
		skb_push(skb, sizeof(struct QMI_QOS_HDR_S));
		qmih->version = 1;
		qmih->flags = 0;
		qmih->flow_id = skb->mark;
	 }

	DBG1("[%s] Tx packet #%lu len=%d mark=0x%x\n",
	    dev->net->name, dev->net->stats.tx_packets, skb->len, skb->mark);

	return skb;
}
开发者ID:SimonSickle,项目名称:android_kernel_htc_evitareul,代码行数:42,代码来源:rmnet_usb_data.c

示例14: zc_wsrv

/*
 * This routine is symmetric for master and slave, so it handles both without
 * splitting up the codepath.
 *
 * If there are messages on this queue that can be sent to the other, send
 * them via putnext(). Else, if queued messages cannot be sent, leave them
 * on this queue.
 */
static void
zc_wsrv(queue_t *qp)
{
	mblk_t *mp;

	DBG1("zc_wsrv master (%s) side", zc_side(qp));

	/*
	 * Partner has no read queue, so take the data, and throw it away.
	 */
	if (zc_switch(RD(qp)) == NULL) {
		DBG("zc_wsrv: other side isn't listening");
		while ((mp = getq(qp)) != NULL) {
			if (mp->b_datap->db_type == M_IOCTL)
				miocnak(qp, mp, 0, 0);
			else
				freemsg(mp);
		}
		flushq(qp, FLUSHALL);
		return;
	}

	/*
	 * while there are messages on this write queue...
	 */
	while ((mp = getq(qp)) != NULL) {
		/*
		 * Due to the way zc_wput is implemented, we should never
		 * see a control message here.
		 */
		ASSERT(mp->b_datap->db_type < QPCTL);

		if (bcanputnext(RD(zc_switch(qp)), mp->b_band)) {
			DBG("wsrv: send message to other side\n");
			putnext(RD(zc_switch(qp)), mp);
		} else {
			DBG("wsrv: putting msg back on queue\n");
			(void) putbq(qp, mp);
			break;
		}
	}
}
开发者ID:pcd1193182,项目名称:openzfs,代码行数:50,代码来源:zcons.c

示例15: sdio_recv_notify

/* Rx Callback, Called in Work Queue context */
static void sdio_recv_notify(void *dev, struct sk_buff *skb)
{
	struct rmnet_private *p = netdev_priv(dev);
	unsigned long flags;
	u32 opmode;

	if (skb) {
		skb->dev = dev;
		/* Handle Rx frame format */
		spin_lock_irqsave(&p->lock, flags);
		opmode = p->operation_mode;
		spin_unlock_irqrestore(&p->lock, flags);

		if (RMNET_IS_MODE_IP(opmode)) {
			/* Driver in IP mode */
			skb->protocol = rmnet_ip_type_trans(skb, dev);
		} else {
			/* Driver in Ethernet mode */
			skb->protocol = eth_type_trans(skb, dev);
		}
		if (RMNET_IS_MODE_IP(opmode) ||
		    count_this_packet(skb->data, skb->len)) {
#ifdef CONFIG_MSM_RMNET_DEBUG
			p->wakeups_rcv += rmnet_cause_wakeup(p);
#endif
			p->stats.rx_packets++;
			p->stats.rx_bytes += skb->len;
		}
		DBG1("[%s] Rx packet #%lu len=%d\n",
			((struct net_device *)dev)->name,
			p->stats.rx_packets, skb->len);

		/* Deliver to network stack */
		netif_rx(skb);
	} else {
		spin_lock_irqsave(&p->lock, flags);
		if (!sdio_update_reset_state((struct net_device *)dev))
			pr_err("[%s] %s: No skb received",
				((struct net_device *)dev)->name, __func__);
		spin_unlock_irqrestore(&p->lock, flags);
	}
}
开发者ID:robcore,项目名称:Alucard-Kernel-jfltexx,代码行数:43,代码来源:msm_rmnet_sdio.c


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