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


C++ BIT_SET函数代码示例

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


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

示例1: f2_parse_cof

/* Parse the COF head into the top-level f2, then parse tails into
   the f2->parts array, and NULL-terminate the array */
void
f2_parse_cof(const Uchar *file, size_t line, Uchar *lp, struct f2 *f2p, 
	     Uchar **psu_sense, Uchar *ampamp, struct sig_context *scp)
{
  List *cofs = list_create(LIST_SINGLE);
  Uchar *form = NULL;
  int i = 0;

  while (1)
    {
      list_add(cofs, lp);
      if (!ampamp)
	break;
      *ampamp = '\0';
      ampamp += 2;
      lp = ampamp;
      ampamp = (unsigned char *)strstr((char*)lp,"&&");
    }
  f2p->parts = mb_new_array(scp->mb_f2ps, list_len(cofs));

  /* Parse the head in the top-level f2 structure */
  form = list_first(cofs);
  f2_parse(file,line,form,f2p,NULL,NULL);
  f2p->cof_id = (uintptr_t)f2p;
  BIT_SET(f2p->flags, F2_FLAGS_COF_HEAD);

  /* Now parse the tails into the parts array */
  for (i = 0, form = list_next(cofs); 
       form; 
       form = list_next(cofs), ++i)
    {
      f2p->parts[i] = mb_new(scp->mb_f2s);
      f2_parse(file,line,form,f2p->parts[i],NULL,NULL);
      f2p->parts[i]->cof_id = (uintptr_t)f2p;
      BIT_SET(f2p->parts[i]->flags, F2_FLAGS_COF_TAIL);
    }
  f2p->parts[i] = NULL;
}
开发者ID:EleanorRobson,项目名称:oracc,代码行数:40,代码来源:f2_parse.c

示例2: main

int main(void)
{
    UINT8 data;

    BIT_SET(L_OUT_DDR,L_OUT_PIN); //L_OUT pin is output
    BIT_SET(K_OUT_DDR,K_OUT_PIN); //K_OUT pin is output

    K_OUT(1);
    L_OUT(1);


    uart1_init(10400);
    uart_init(115200); //Set up UART
    TimeInit();	 //set up time

    //set up printf
    fdevopen(uart_putchar, NULL);

    printf("Hello world\n");

    while (1)
    {
        if (uart1_kbhit())
        {
            data=uart1_getchar();
            printf("0x%02X ",data);
            //uart_putchar(data);
        }
        if (uart_kbhit())
        {
            data=uart_getchar();
            uart1_putchar(data);
        }
    }



}
开发者ID:DraakUSA,项目名称:avrobdii,代码行数:38,代码来源:main.c

示例3: OnItemchangedListFields

void CBibitemView::OnItemchangedListFields(NMHDR* pNMHDR, LRESULT* pResult) 
{
	NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
	if (!m_Updating) {
		if (pNMListView->uChanged == LVIF_STATE) {
			if (BIT_SET(pNMListView->uNewState, LVIS_FOCUSED))
				m_SelField = pNMListView->iItem;
			else
				m_SelField = -1;
		}
	}	
	
	*pResult = 0;
}
开发者ID:stievie,项目名称:bibedt,代码行数:14,代码来源:BibitemView.cpp

示例4: shift_write_word

void shift_write_word ( uint8_t *output, uint8_t size )
{
    uint8_t i;

    for ( i=1; i<=size; i++)
    {
        shift_write_bit(output[(size-i)/8] & (1<<(size-i)%8));
    }

    BIT_SET( LATCH_PORT, LATCH_BIT );
    _delay_us(DELAY);
    BIT_CLEAR( LATCH_PORT, LATCH_BIT );
    _delay_us(DELAY);
}
开发者ID:jim17,项目名称:componentmeter,代码行数:14,代码来源:shiftregister.c

示例5: AllocTrigId

static int8_t AllocTrigId(uint8_t pinNum)
{
    int8_t id = 0;
    while (BIT_IS_SET(trigUse, id)) {
        ++id;
    }
    if (id == MAX_TRIGGERS) {
        return AJS_IO_PIN_NO_TRIGGER;
    } else {
        BIT_SET(trigUse, id);
        pinIdToSource[id] = pinNum;
        return id;
    }
}
开发者ID:avernon,项目名称:asl_distribution,代码行数:14,代码来源:io_gpio.c

示例6: timer_milliseconds

/*************************************************************************
* Description: returns the current millisecond count
* Returns: none
* Notes: This method only disables the timer overflow interrupt.
*************************************************************************/
uint32_t timer_milliseconds(
    void)
{
    uint32_t timer_value;       /* return value */

    /* Disable the overflow interrupt.
       Prevents value corruption that would happen if interrupted */
    BIT_CLEAR(TIMSK2, TOIE2);
    timer_value = Millisecond_Counter;
    /* Enable the overflow interrupt */
    BIT_SET(TIMSK2, TOIE2);

    return timer_value;
}
开发者ID:8bitgeek,项目名称:bacnet-stack,代码行数:19,代码来源:timer2.c

示例7: timer_init

void timer_init(void)
{
	// commented out due to bug!?
	/* make sure the timer is stopped */
	//BIT_CLR(TIMER32(TMRCONTROL), RUN);
	
	/* set up the clock */
	//TIMER32(TMRCONTROL) &= ~(3<<SETCLK);
	//TIMER32(TMRCONTROL) |= (TIMER_CLK<<SETCLK);
	
	
	TIMER32(TMRCLKGEN) = (TIMER_PRES<<TCLKDIV)|(TIMER_CLK_SRC<<TCLKSRCSEL);
	BIT_SET(TIMER32(TMRCLKENB), TCLKGENENB);
}
开发者ID:BackupTheBerlios,项目名称:opendidj,代码行数:14,代码来源:timer.c

示例8: do_sethook

static int do_sethook(xpd_t *xpd, int pos, bool to_offhook)
{
	unsigned long		flags;
	xbus_t			*xbus;
	struct FXO_priv_data	*priv;
	int			ret = 0;
	byte			value;

	BUG_ON(!xpd);
	BUG_ON(xpd->direction == TO_PHONE);		// We can SETHOOK state only on PSTN
	xbus = xpd->xbus;
	priv = xpd->priv;
	BUG_ON(!priv);
	if(priv->battery[pos] != BATTERY_ON && to_offhook) {
		LINE_NOTICE(xpd, pos, "Cannot take offhook while battery is off!\n");
		return -EINVAL;
	}
	spin_lock_irqsave(&xpd->lock, flags);
	mark_ring(xpd, pos, 0, 0);				// No more rings
	value = REG_DAA_CONTROL1_ONHM;				/* Bit 3 is for CID */
	if(to_offhook)
		value |= REG_DAA_CONTROL1_OH;
	LINE_DBG(SIGNAL, xpd, pos, "SETHOOK: value=0x%02X %s\n", value, (to_offhook)?"OFFHOOK":"ONHOOK");
	if(to_offhook)
		MARK_ON(priv, pos, LED_GREEN);
	else
		MARK_OFF(priv, pos, LED_GREEN);
	ret = DAA_DIRECT_REQUEST(xbus, xpd, pos, DAA_WRITE, REG_DAA_CONTROL1, value);
	if(to_offhook) {
		BIT_SET(xpd->offhook, pos);
	} else {
		BIT_CLR(xpd->offhook, pos);
	}
	if(caller_id_style != CID_STYLE_PASS_ALWAYS) {
		LINE_DBG(SIGNAL, xpd, pos, "Caller-ID PCM: off\n");
		BIT_CLR(xpd->cid_on, pos);
	}
#ifdef	WITH_METERING
	priv->metering_count[pos] = 0;
	priv->metering_tone_state = 0L;
	DAA_DIRECT_REQUEST(xbus, xpd, pos, DAA_WRITE, DAA_REG_METERING, 0x2D);
#endif
	reset_battery_readings(xpd, pos);	/* unstable during hook changes */
	priv->power_denial_safezone[pos] = (to_offhook) ? POWER_DENIAL_SAFEZONE : 0;
	if(!to_offhook)
		priv->power[pos] = POWER_UNKNOWN;
	spin_unlock_irqrestore(&xpd->lock, flags);
	return ret;
}
开发者ID:xrg,项目名称:dahdi-linux-xrg,代码行数:49,代码来源:card_fxo.c

示例9: LedsSet

/******************************************************************
 ** LedsSet
 *
 *  DESCRIPTION:
 *		Sets the state of the leds
 *
 *  Create: 5/9/2006	9:37:35 PM - Trampas Stern
 *******************************************************************/
INT LedsSet(UINT8 Led, UINT8 State)
{
	if (Led<=7)
	{
		if (State)
	   	{
	   		BIT_CLEAR(LEDS_U18,Led);
		}else
		{
			BIT_SET(LEDS_U18,Led);
		}
	}else if (Led<=14)
	{
		Led=Led-8;
		if (State)
	   	{
	   		BIT_CLEAR(LEDS_U40,Led);
		}else
		{
			BIT_SET(LEDS_U40,Led);
		}
	}
	return LedsUpdate(); //update the LEDs
}
开发者ID:DraakUSA,项目名称:avrobdii,代码行数:32,代码来源:led.c

示例10: putBuffer

void putBuffer() 
{ 
    int8_t i; 
    BIT_SET(RF_24G_CE_PORT, RF_24G_CE_BIT); 
    CSDELAY(); 

    putByte(ADDR1_1); 
    putByte(ADDR1_0); 

    for( i=0; i<BUF_MAX ; i++) { 
        putByte(RF_24G_Buffer[i]); 
    } 
    BIT_CLEAR(RF_24G_CE_PORT, RF_24G_CE_BIT); 
    BIT_CLEAR(RF_24G_CLK1_PORT, RF_24G_CLK1_BIT); 
} 
开发者ID:vishl,项目名称:SMS-Buzzer-Embedded,代码行数:15,代码来源:rf24g_2.c

示例11: flash_init

/******************************************************************
 ** flash_init
 *
 *  DESCRIPTION:
 *
 *  Create: 7/23/2006	10:09:14 AM - Trampas Stern
 *******************************************************************/
void flash_init()
{
	//Set the Chip Select pin as output
	BIT_SET(FLASH_CS_DDR,FLASH_CS_BIT); 
	//SET Chip select high
	FLASH_CS(1); 
	FLASH_CLK(0);

	BIT_SET(FLASH_RESET_DDR,FLASH_RESET_PIN);
	FLASH_RESET(0);
	delay_ms(20);
	FLASH_RESET(1);

	//Set up the SPI port
	// AT45DBxxx can handle mode 0 or mode 1 transmissions
	// we will use mode zero (SCK low when idle & sample leading edge)
	//	SPI Interupt disabled - 0
	//	SPI Disabled - 0
	// 	DORD MSB first -0
	//  Master - 1
	//  Clk Polarity - 0 SCK low when idel
	//	CPHA =0 sample leading edge
	//  ClkRate= 000 (AT90 is 16Mhz and Flash can operate at 20Mhz, no clk divide)
	SPCR=0x10; //only master bit set

	//configure the direction of the SPI pins
	BIT_SET(DDRB,1); //SCK output
	BIT_SET(DDRB,2); //MOSI output

	//SET MISO to have internal pullup
	BIT_SET(PORTB,3); 

	//Enable the SPI port
	SPCR=SPCR | 0x40; 

}
开发者ID:DraakUSA,项目名称:avrobdii,代码行数:43,代码来源:flash.c

示例12: cmdNoReply

static void cmdNoReply(void *base)
{
	node_t *node = (node_t *) base;
 	
 	assert(node);
 	assert(node->handle >= 0);

 	// set our specific flag.
	BIT_SET(node->data.flags, DATA_FLAG_NOREPLY);
	
	assert(node->sysdata);
	logger(node->sysdata->logging, 3,
		"node:%d NOREPLY (flags:%x, mask:%x)",
		node->handle, node->data.flags, node->data.mask);
}
开发者ID:hyper,项目名称:rqd,代码行数:15,代码来源:commands.c

示例13: die

/*
 * Die in case of unrecoverable error.  On LF1000, we pull the power off. 
 * Otherwise just lock up. 
 */
static void die(void)
{
	db_puts("die()\n");
#ifdef CPU_LF1000
	/* enable access to Alive GPIO */
	REG32(LF1000_ALIVE_BASE+ALIVEPWRGATEREG) = 1;
	/* pull VDDPWRON low by resetting the flip-flop */
	BIT_CLR(REG32(LF1000_ALIVE_BASE+ALIVEGPIOSETREG), VDDPWRONSET);
	BIT_SET(REG32(LF1000_ALIVE_BASE+ALIVEGPIORSTREG), VDDPWRONSET);
	/* reset flip-flop to latch in */
	REG32(LF1000_ALIVE_BASE+ALIVEGPIOSETREG) = 0;
	REG32(LF1000_ALIVE_BASE+ALIVEGPIORSTREG) = 0;
	/* power should be off now... */
#endif
	while(1);
}
开发者ID:BackupTheBerlios,项目名称:opendidj,代码行数:20,代码来源:main.c

示例14: cmdId

static void cmdId(void *base, risp_int_t value)
{
	node_t *node= (node_t *) base;

 	assert(node);
 	assert(value >= 0);
 	assert(node->handle >= 0);

	BIT_SET(node->data.mask, DATA_MASK_ID);
	node->data.id = value;
	
	assert(node->sysdata);
	logger(node->sysdata->logging, 3,
		"node:%d ID (%d) (flags:%x, mask:%x)",
		node->handle, value, node->data.flags, node->data.mask);
}
开发者ID:hyper,项目名称:rqd,代码行数:16,代码来源:commands.c

示例15: refresh_display

static void refresh_display(void)
{
  static u8 i;

  // First shift enables only one column.
  shift_byte(~(0b00000001 << i));
  // Second shift for column data.
  shift_byte(matrix[i]);

  // Pulse to move everything to output.
  BIT_CLR(SHIFT_PORT, SHIFT_RCK);
  BIT_SET(SHIFT_PORT, SHIFT_RCK);

  // Increase i with each cycle, but don't let it get bigger than 7.
  i = (i + 1) % 7;
}
开发者ID:somemetricprefix,项目名称:cube,代码行数:16,代码来源:kernel.c


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