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

C++ MS函数代码示例

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

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



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

示例1: ar9300GetSpectralParams

void
ar9300GetSpectralParams(struct ath_hal *ah, HAL_SPECTRAL_PARAM *ss)
{
    u_int32_t val;
    struct ath_hal_9300 *ahp = AH9300(ah);
    HAL_POWER_MODE pwrmode = ahp->ah_powerMode;

    if (AR_SREV_WASP(ah) && (pwrmode == HAL_PM_FULL_SLEEP)) {
        ar9300SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE);
    }

    val = OS_REG_READ(ah, AR_PHY_SPECTRAL_SCAN);

    ss->ss_fft_period = MS(val, AR_PHY_SPECTRAL_SCAN_FFT_PERIOD);
    ss->ss_period = MS(val, AR_PHY_SPECTRAL_SCAN_PERIOD);
    ss->ss_count = MS(val, AR_PHY_SPECTRAL_SCAN_COUNT);
    ss->ss_short_report = MS(val, AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT);

    if (AR_SREV_WASP(ah) && (pwrmode == HAL_PM_FULL_SLEEP)) {
        ar9300SetPowerMode(ah, HAL_PM_FULL_SLEEP, AH_TRUE);
    }
}
开发者ID:jorneytu,项目名称:wlan,代码行数:22,代码来源:ar9300_spectral.c


示例2: ar5416EepromRead

/*
 * Read 16 bits of data from offset into *data
 */
HAL_BOOL
ar5416EepromRead(struct ath_hal *ah, u_int off, u_int16_t *data)
{
    (void)OS_REG_READ(ah, AR5416_EEPROM_OFFSET + (off << AR5416_EEPROM_S));
    if (!ath_hal_wait(ah, AR_EEPROM_STATUS_DATA, AR_EEPROM_STATUS_DATA_BUSY
        | AR_EEPROM_STATUS_DATA_PROT_ACCESS, 0, AH_WAIT_TIMEOUT))
    {
        return AH_FALSE;
    }

    *data = MS(OS_REG_READ(ah, AR_EEPROM_STATUS_DATA), AR_EEPROM_STATUS_DATA_VAL);
    return AH_TRUE;
}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:16,代码来源:ar5416_eeprom.c


示例3: ar9300GpioGet

/*
 * Once configured for I/O - get input lines
 */
u_int32_t
ar9300GpioGet(struct ath_hal *ah, u_int32_t gpio)
{
    u_int32_t gpio_in;
    HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins);

    if (gpio >= AH_PRIVATE(ah)->ah_caps.halNumGpioPins) {
        return 0xffffffff;
    }

    gpio_in = OS_REG_READ(ah, AR_HOSTIF_REG(ah, AR_GPIO_IN));
    return (MS(gpio_in, AR_GPIO_IN_VAL) & AR_GPIO_BIT(gpio)) != 0;
}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:16,代码来源:ar9300_gpio.c


示例4: secondtask

/* This function is executed by the second task that is set up
 * in the function firsttask() by a call to nosTaskCreate()
 */
void secondtask(void *arg)
{
  char *name = (char*) arg;

  for(;;)
  {
    /* print string: "Task 2" */
    nosPrintf1("%s\n", name);

    /* sleep (=do nothing) for two seconds */
    nosTaskSleep(MS(2000));
  }
}
开发者ID:Sundarapandian,项目名称:avr_projects,代码行数:16,代码来源:ex_task4.c


示例5: ar5416GpioSetIntr

/*
 * Set the GPIO Interrupt
 */
void
ar5416GpioSetIntr(struct ath_hal *ah, u_int gpio, uint32_t ilevel)
{
    uint32_t val;

    HALASSERT(gpio < AR_NUM_GPIO);
    /* XXX bounds check gpio */
    val = MS(OS_REG_READ(ah, AR_GPIO_INTR_OUT), AR_GPIO_INTR_CTRL);
    if (ilevel)		/* 0 == interrupt on pin high */
        val &= ~AR_GPIO_BIT(gpio);
    else			/* 1 == interrupt on pin low */
        val |= AR_GPIO_BIT(gpio);
    OS_REG_RMW_FIELD(ah, AR_GPIO_INTR_OUT, AR_GPIO_INTR_CTRL, val);

    /* Change the interrupt mask. */
    val = MS(OS_REG_READ(ah, AR_INTR_ASYNC_ENABLE), AR_INTR_GPIO);
    val |= AR_GPIO_BIT(gpio);
    OS_REG_RMW_FIELD(ah, AR_INTR_ASYNC_ENABLE, AR_INTR_GPIO, val);

    val = MS(OS_REG_READ(ah, AR_INTR_ASYNC_MASK), AR_INTR_GPIO);
    val |= AR_GPIO_BIT(gpio);
    OS_REG_RMW_FIELD(ah, AR_INTR_ASYNC_MASK, AR_INTR_GPIO, val);
}
开发者ID:se7oluti0n,项目名称:madwifi,代码行数:26,代码来源:ar5416_gpio.c


示例6: tcpClientThread

void tcpClientThread(void* arg)
{
  int sock = (long)arg;
  int i;

  nosPrintf("in tcp client\n");
  for (i = 0; i < 5; i++) {

    write(sock, "Hello!\n", 7);
    posTaskSleep(MS(1000));
  }

  close(sock);
}
开发者ID:AriZuu,项目名称:wiced-test,代码行数:14,代码来源:sock_server.c


示例7: ar7010GpioGet

/*
 * Once configured for I/O - get input lines
 */
u_int32_t
ar7010GpioGet(struct ath_hal *ah, u_int32_t gpio)
{
    HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.hal_num_gpio_pins);

    if (gpio >= AH_PRIVATE(ah)->ah_caps.hal_num_gpio_pins) {
        return 0xffffffff;
    }

    /* Read output value for all gpio's, shift it left, and verify whether a 
     * specific gpio bit is set.                                                 
     */
    return (MS(OS_REG_READ(ah, AR7010_GPIO_IN), AR7010_GPIO_IN_VAL) & AR_GPIO_BIT(gpio)) != 0;
}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:17,代码来源:ar5416_gpio.c


示例8: ar9280_olpc_init

void
ar9280_olpc_init(struct athn_softc *sc)
{
	uint32_t reg;
	int i;

	/* Save original Tx gain values. */
	for (i = 0; i < AR9280_TX_GAIN_TABLE_SIZE; i++) {
		reg = AR_READ(sc, AR_PHY_TX_GAIN_TBL(i));
		sc->tx_gain_tbl[i] = MS(reg, AR_PHY_TX_GAIN);
	}
	/* Initial Tx gain temperature compensation. */
	sc->tcomp = 0;
}
开发者ID:alenichev,项目名称:openbsd-kernel,代码行数:14,代码来源:ar9280.c


示例9: task2

/* This function is executed by the second task that is set up
 * in the function firsttask() by a call to nosTaskCreate()
 */
void task2(void *arg)
{
  /* avoid compiler warning */
  (void) arg;

  for(;;)
  {
    /* call function */
    incrementCounter(2);

    /* do something here and waste some time */
    posTaskSleep(MS(300));
  }
}
开发者ID:AriZuu,项目名称:picoos,代码行数:17,代码来源:ex_mutx1.c


示例10: sizeof

/* Applies for first msdu in chain, before altering it. */
static struct ieee80211_hdr *ath10k_htt_rx_skb_get_hdr(struct sk_buff *skb)
{
	struct htt_rx_desc *rxd;
	enum rx_msdu_decap_format fmt;

	rxd = (void *)skb->data - sizeof(*rxd);
	fmt = MS(__le32_to_cpu(rxd->msdu_start.info1),
			RX_MSDU_START_INFO1_DECAP_FORMAT);

	if (fmt == RX_MSDU_DECAP_RAW)
		return (void *)skb->data;
	else
		return (void *)skb->data - RX_HTT_HDR_STATUS_LEN;
}
开发者ID:AkyZero,项目名称:wrapfs-latest,代码行数:15,代码来源:htt_rx.c


示例11: ar2133GetNoiseFloor

static void 
ar2133GetNoiseFloor(struct ath_hal *ah, int16_t nfarray[])
{
	struct ath_hal_5416 *ahp = AH5416(ah);
	int16_t nf;

	switch (ahp->ah_rx_chainmask) {
        case 0x7:
		nf = MS(OS_REG_READ(ah, AR_PHY_CH2_CCA), AR_PHY_CH2_MINCCA_PWR);
		if (nf & 0x100)
			nf = 0 - ((nf ^ 0x1ff) + 1);
		HALDEBUG(ah, HAL_DEBUG_NFCAL,
		    "NF calibrated [ctl] [chain 2] is %d\n", nf);
		nfarray[4] = nf;

		nf = MS(OS_REG_READ(ah, AR_PHY_CH2_EXT_CCA), AR_PHY_CH2_EXT_MINCCA_PWR);
		if (nf & 0x100)
			nf = 0 - ((nf ^ 0x1ff) + 1);
		HALDEBUG(ah, HAL_DEBUG_NFCAL,
		    "NF calibrated [ext] [chain 2] is %d\n", nf);
		nfarray[5] = nf;
		/* fall thru... */
        case 0x3:
        case 0x5:
		nf = MS(OS_REG_READ(ah, AR_PHY_CH1_CCA), AR_PHY_CH1_MINCCA_PWR);
		if (nf & 0x100)
			nf = 0 - ((nf ^ 0x1ff) + 1);
		HALDEBUG(ah, HAL_DEBUG_NFCAL,
		    "NF calibrated [ctl] [chain 1] is %d\n", nf);
		nfarray[2] = nf;


		nf = MS(OS_REG_READ(ah, AR_PHY_CH1_EXT_CCA), AR_PHY_CH1_EXT_MINCCA_PWR);
		if (nf & 0x100)
			nf = 0 - ((nf ^ 0x1ff) + 1);
		HALDEBUG(ah, HAL_DEBUG_NFCAL,
		    "NF calibrated [ext] [chain 1] is %d\n", nf);
		nfarray[3] = nf;
		/* fall thru... */
        case 0x1:
		nf = MS(OS_REG_READ(ah, AR_PHY_CCA), AR_PHY_MINCCA_PWR);
		if (nf & 0x100)
			nf = 0 - ((nf ^ 0x1ff) + 1);
		HALDEBUG(ah, HAL_DEBUG_NFCAL,
		    "NF calibrated [ctl] [chain 0] is %d\n", nf);
		nfarray[0] = nf;

		nf = MS(OS_REG_READ(ah, AR_PHY_EXT_CCA), AR_PHY_EXT_MINCCA_PWR);
		if (nf & 0x100)
			nf = 0 - ((nf ^ 0x1ff) + 1);
		HALDEBUG(ah, HAL_DEBUG_NFCAL,
		    "NF calibrated [ext] [chain 0] is %d\n", nf);
		nfarray[1] = nf;

		break;
	}
}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:57,代码来源:ar2133.c


示例12: ar5416GpioSet

/*
 * Once configured for I/O - set output lines
 */
HAL_BOOL
ar5416GpioSet(struct ath_hal *ah, uint32_t gpio, uint32_t val)
{
    uint32_t reg;

    HALASSERT(gpio < AR_NUM_GPIO);
    reg = MS(OS_REG_READ(ah, AR_GPIO_INTR_OUT), AR_GPIO_OUT_VAL);
    if (val & 1)
        reg |= AR_GPIO_BIT(gpio);
    else
        reg &= ~AR_GPIO_BIT(gpio);

    OS_REG_RMW_FIELD(ah, AR_GPIO_INTR_OUT, AR_GPIO_OUT_VAL, reg);
    return AH_TRUE;
}
开发者ID:se7oluti0n,项目名称:madwifi,代码行数:18,代码来源:ar5416_gpio.c


示例13: r12a_rx_radiotap_flags

uint8_t
r12a_rx_radiotap_flags(const void *buf)
{
	const struct r92c_rx_stat *stat = buf;
	uint8_t flags, rate;

	if (!(stat->rxdw4 & htole32(R12A_RXDW4_SPLCP)))
		return (0);
	rate = MS(le32toh(stat->rxdw3), R92C_RXDW3_RATE);
	if (RTWN_RATE_IS_CCK(rate))
		flags = IEEE80211_RADIOTAP_F_SHORTPRE;
	else
		flags = IEEE80211_RADIOTAP_F_SHORTGI;
	return (flags);
}
开发者ID:jaredmcneill,项目名称:freebsd,代码行数:15,代码来源:r12a_rx.c


示例14: sendStatus

void Status::tick()
{
    // Si on a de la place sur le buffer de sortie, alors on accepte
    if (Serial.availableForWrite() < sizeof(struct Payload)) {
        // Il faut attendre pendant au moins ce temps
        this->nextTick = UTime::now() + (sizeof(struct Payload) + 2) * CHAR_XMIT_DELAY;
        return;
    }
    sendStatus();
    if (motor.isMoving() || filterWheelMotor.isMoving()) {
        this->nextTick += MS(250);
    } else {
        this->nextTick += LongDuration::seconds(10);
    }
}
开发者ID:pludov,项目名称:ArdFocuser,代码行数:15,代码来源:Status.cpp


示例15: rx_task

void rx_task(void * ignore)
{
    int cnt = 0;
    while (1) {
        if (uart_gets(buf) <= 0)
            continue;
        PORTB ^= _BV(PB0);
        if (!strncmp(buf, "+BTINQ: ", 8)) {
            char * x = strchr(&buf[8], ',');
            if (x == NULL) continue;
            *(x+1) = 0;
            //strcpy(ptr[cnt], &buf[8]);
            uart_puts("AT+BTSDP=");
            uart_puts(&buf[8]);
            uart_puts("2\r");
            posTaskSleep(MS(500));
            PORTB ^= _BV(PB0);
            posTaskSleep(MS(500));
            PORTB ^= _BV(PB0);
            posTaskSleep(MS(500));
            PORTB ^= _BV(PB0);
        }
    }
}
开发者ID:Sundarapandian,项目名称:avr_projects,代码行数:24,代码来源:bttest.c


示例16: secondtask

/* This function is executed by the second task that is set up
 * in the function firsttask() by a call to nosTaskCreate()
 */
void secondtask(void *arg)
{
  char *name = (char*) arg;

  for(;;)
  {
    /* print string: "Task 2" */
    posTaskSchedLock();
    printf("%s\n", name);
    posTaskSchedUnlock();

    /* sleep (=do nothing) for two seconds */
    posTaskSleep(MS(2000));
  }
}
开发者ID:AriZuu,项目名称:picoos,代码行数:18,代码来源:ex_task1.c


示例17: ar9300GetExtChanNF

int16_t ar9300GetExtChanNF(struct ath_hal *ah)
{
    int16_t nf;
    struct ath_hal_private *ahpriv = AH_PRIVATE(ah);

    if ((OS_REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) == 0) {
        /* Noise floor calibration value is ready */
        nf = MS(OS_REG_READ(ah, AR_PHY_EXT_CCA), AR_PHY_EXT_MINCCA_PWR);
    } else {
        /* NF calibration is not done, return nominal value */
        nf = ahpriv->nfp->nominal;    
    }
    if (nf & 0x100)
        nf = (0 - ((nf ^ 0x1ff) + 1));
    return nf;
}
开发者ID:jorneytu,项目名称:wlan,代码行数:16,代码来源:ar9300_spectral.c


示例18: ar5212_decode_rxstatus

static void
ar5212_decode_rxstatus(struct if_ath_alq_payload *a)
{
	struct ar5212_desc rxs;

	/* XXX assumes rxs is smaller than PAYLOAD_LEN! */
	memcpy(&rxs, &a->payload, sizeof(struct ar5212_desc));

	printf("[%u] [%llu] RXSTATUS\n",
	    (unsigned int) be32toh(a->hdr.tstamp),
	    (unsigned long long) be64toh(a->hdr.threadid));

	printf("  link=0x%08x, data=0x%08x, ctl0=0x%08x, ctl2=0x%08x\n",
	    rxs.ds_link,
	    rxs.ds_data,
	    rxs.ds_ctl0,
	    rxs.ds_ctl1);

	/* ds_rxstatus0 */
	printf("  DataLen=%d, ArMore=%d, DecompCrcError=%d, RcvRate=0x%02x\n",
	    rxs.ds_rxstatus0 & AR_DataLen,
	    MF(rxs.ds_rxstatus0, AR_More),
	    MF(rxs.ds_rxstatus0, AR_DecompCRCErr),
	    MS(rxs.ds_rxstatus0, AR_RcvRate));
	printf("  RSSI=%d, RcvAntenna=0x%x\n",
	    MS(rxs.ds_rxstatus0, AR_RcvSigStrength),
	    MS(rxs.ds_rxstatus0, AR_RcvAntenna));

	/* ds_rxstatus1 */
	printf("  RxDone=%d, RxFrameOk=%d, CrcErr=%d, DecryptCrcErr=%d\n",
	    MF(rxs.ds_rxstatus1, AR_Done),
	    MF(rxs.ds_rxstatus1, AR_FrmRcvOK),
	    MF(rxs.ds_rxstatus1, AR_CRCErr),
	    MF(rxs.ds_rxstatus1, AR_DecryptCRCErr));
	printf("  PhyErr=%d, MichaelErr=%d, KeyIdxValid=%d\n",
	    MF(rxs.ds_rxstatus1, AR_PHYErr),
	    MF(rxs.ds_rxstatus1, AR_MichaelErr),
	    MF(rxs.ds_rxstatus1, AR_KeyIdxValid));

	/* If PHY error, print that out. Otherwise, the key index */
	if (MF(rxs.ds_rxstatus1, AR_PHYErr))
		printf("  PhyErrCode=0x%02x\n",
		    MS(rxs.ds_rxstatus1, AR_PHYErrCode));
	else
		printf("  KeyIdx=0x%02x\n",
		    MS(rxs.ds_rxstatus1, AR_KeyIdx));

	printf("  KeyMiss=%d\n",
	    MF(rxs.ds_rxstatus1, AR_KeyCacheMiss));

	printf("  Timetamp: 0x%05x\n",
	    MS(rxs.ds_rxstatus1, AR_RcvTimestamp));

	printf("\n ------\n");
}
开发者ID:vkhromov,项目名称:freebsd,代码行数:55,代码来源:ar5212_ds.c


示例19: r12a_tx_radiotap_flags

uint8_t
r12a_tx_radiotap_flags(const void *buf)
{
	const struct r12a_tx_desc *txd = buf;
	uint8_t flags, rate;

	if (!(txd->txdw5 & htole32(R12A_TXDW5_DATA_SHORT)))
		return (0);

	rate = MS(le32toh(txd->txdw4), R12A_TXDW4_DATARATE);
	if (RTWN_RATE_IS_CCK(rate))
		flags = IEEE80211_RADIOTAP_F_SHORTPRE;
	else
		flags = IEEE80211_RADIOTAP_F_SHORTGI;
	return (flags);
}
开发者ID:jaredmcneill,项目名称:freebsd,代码行数:16,代码来源:r12a_tx.c


示例20: r12a_c_cut_rf_read

uint32_t
r12a_c_cut_rf_read(struct rtwn_softc *sc, int chain, uint8_t addr)
{
	uint32_t pi_mode, val;

	val = rtwn_bb_read(sc, R12A_HSSI_PARAM1(chain));
	pi_mode = (val & R12A_HSSI_PARAM1_PI) ? 1 : 0;

	rtwn_bb_setbits(sc, R12A_HSSI_PARAM2,
	    R12A_HSSI_PARAM2_READ_ADDR_MASK, addr);
	rtwn_delay(sc, 20);

	val = rtwn_bb_read(sc, pi_mode ? R12A_HSPI_READBACK(chain) :
	    R12A_LSSI_READBACK(chain));

	return (MS(val, R92C_LSSI_READBACK_DATA));
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:17,代码来源:r12a_rf.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ MS2SEC函数代码示例发布时间:2022-05-30
下一篇:
C++ MR_IN函数代码示例发布时间: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