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

C++ BUSYWAIT_UNTIL函数代码示例

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

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



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

示例1: cc2420_init

/*---------------------------------------------------------------------------*/
int
cc2420_init(void)
{
  uint16_t reg;
  {
    int s = splhigh();
    cc2420_arch_init();		/* Initalize ports and SPI. */
    CC2420_DISABLE_FIFOP_INT();
    CC2420_FIFOP_INT_INIT();
    splx(s);
  }

  /* Turn on voltage regulator and reset. */
  SET_VREG_ACTIVE();
  BUSYWAIT_UNTIL(0, RTIMER_SECOND / 100);
  SET_RESET_ACTIVE();
  BUSYWAIT_UNTIL(0, RTIMER_SECOND / 100);
  SET_RESET_INACTIVE();
  BUSYWAIT_UNTIL(0, RTIMER_SECOND / 100);

  pan = 0xffff;
  addr = 0x0000;
  
  BUSYWAIT_UNTIL(0, RTIMER_SECOND / 100);

  powerup();
  configure();
  flushrx();

  process_start(&cc2420_process, NULL);
  return 1;
}
开发者ID:Cancan79,项目名称:mist,代码行数:33,代码来源:cc2420.c


示例2: spirit_radio_off

/*---------------------------------------------------------------------------*/
static int
spirit_radio_off(void)
{  
  PRINTF("Spirit1: ->off\n");
  if(spirit_on == ON) {
    /* Disables the mcu to get IRQ from the SPIRIT1 */
    IRQ_DISABLE();

    /* first stop rx/tx */
    spirit1_strobe(SPIRIT1_STROBE_SABORT);

    /* Clear any pending irqs */
    SpiritIrqClearStatus();
    
    BUSYWAIT_UNTIL(SPIRIT1_STATUS() == SPIRIT1_STATE_READY, 5 * RTIMER_SECOND/1000);
    if(SPIRIT1_STATUS() != SPIRIT1_STATE_READY) {
      PRINTF("Spirit1: failed off->ready\n");
      return 1;
    }

    /* Puts the SPIRIT1 in STANDBY */
    spirit1_strobe(SPIRIT1_STROBE_STANDBY);
    BUSYWAIT_UNTIL(SPIRIT1_STATUS() == SPIRIT1_STATE_STANDBY, 5 * RTIMER_SECOND/1000);
    if(SPIRIT1_STATUS() != SPIRIT1_STATE_STANDBY) {
      PRINTF("Spirit1: failed off->stdby\n");
      return 1;
    }

    spirit_on = OFF;
    CLEAR_TXBUF();
    CLEAR_RXBUF(); 
  }
  PRINTF("Spirit1: off.\n");
  return 0; 
}
开发者ID:Cancan79,项目名称:mist,代码行数:36,代码来源:spirit1.c


示例3: cc2520_set_channel

/*---------------------------------------------------------------------------*/
int
cc2520_set_channel(int c)
{
  uint16_t f;

  GET_LOCK();
  /*
   * Subtract the base channel (11), multiply by 5, which is the
   * channel spacing. 357 is 2405-2048 and 0x4000 is LOCK_THR = 1.
   */
  channel = c;

  f = MIN_CHANNEL + ((channel - MIN_CHANNEL) * CHANNEL_SPACING);
  /*
   * Writing RAM requires crystal oscillator to be stable.
   */
  BUSYWAIT_UNTIL((status() & (BV(CC2520_XOSC16M_STABLE))), RTIMER_SECOND / 10);

  /* Wait for any transmission to end. */
  BUSYWAIT_UNTIL(!(status() & BV(CC2520_TX_ACTIVE)), RTIMER_SECOND / 10);

  /* Define radio channel (between 11 and 25) */
  setreg(CC2520_FREQCTRL, f);

  /* If we are in receive mode, we issue an SRXON command to ensure
     that the VCO is calibrated. */
  if(receive_on) {
    strobe(CC2520_INS_SRXON);
  }

  RELEASE_LOCK();
  return 1;
}
开发者ID:1uk3,项目名称:contiki,代码行数:34,代码来源:cc2520.c


示例4: cc2420_set_channel

/*---------------------------------------------------------------------------*/
int
cc2420_set_channel(int c)
{
  uint16_t f;

  GET_LOCK();
  /*
   * Subtract the base channel (11), multiply by 5, which is the
   * channel spacing. 357 is 2405-2048 and 0x4000 is LOCK_THR = 1.
   */
  channel = c;

  f = 5 * (c - 11) + 357 + 0x4000;
  /*
   * Writing RAM requires crystal oscillator to be stable.
   */
  BUSYWAIT_UNTIL((status() & (BV(CC2420_XOSC16M_STABLE))), RTIMER_SECOND / 10);

  /* Wait for any transmission to end. */
  BUSYWAIT_UNTIL(!(status() & BV(CC2420_TX_ACTIVE)), RTIMER_SECOND / 10);

  setreg(CC2420_FSCTRL, f);

  /* If we are in receive mode, we issue an SRXON command to ensure
     that the VCO is calibrated. */
  if(receive_on) {
    strobe(CC2420_SRXON);
  }

  RELEASE_LOCK();
  return 1;
}
开发者ID:leoqin,项目名称:Contiki-leo,代码行数:33,代码来源:cc2420.c


示例5: spirit_radio_on

/*---------------------------------------------------------------------------*/
static int
spirit_radio_on(void)
{
  PRINTF("Spirit1: on\n");
  if(spirit_on == OFF) {
    IRQ_DISABLE();

    /* ensure we are in READY state as we go from there to Rx */
    spirit1_strobe(SPIRIT1_STROBE_READY);
    BUSYWAIT_UNTIL(SPIRIT1_STATUS() == SPIRIT1_STATE_READY, 5 * RTIMER_SECOND/1000);
    if(SPIRIT1_STATUS() != SPIRIT1_STATE_READY) {
      PRINTF("Spirit1: failed to turn on\n");
      panic_ra(4);
      return 1;
    }

    /* now we go to Rx */
    spirit1_strobe(SPIRIT1_STROBE_RX);
    BUSYWAIT_UNTIL(SPIRIT1_STATUS() == SPIRIT1_STATE_RX, 5 * RTIMER_SECOND/1000);
    if(SPIRIT1_STATUS() != SPIRIT1_STATE_RX) {
      PRINTF("Spirit1: failed to enter rx\n");
      panic_ra(5);
      return 1;
    }
    
    /* Enables the mcu to get IRQ from the SPIRIT1 */
    IRQ_ENABLE();
    spirit_on = ON;
  }

  return 0;
}
开发者ID:Cancan79,项目名称:mist,代码行数:33,代码来源:spirit1.c


示例6: transmit

/*---------------------------------------------------------------------------*/
static int
transmit(unsigned short payload_len)
{
  if(tx_in_progress) {
    return RADIO_TX_COLLISION;
  }
  tx_in_progress = 1;

  /* Energest */
  if(listen_on) {
    ENERGEST_OFF(ENERGEST_TYPE_LISTEN);
  }
  ENERGEST_ON(ENERGEST_TYPE_TRANSMIT);

  /* Transmit and wait */
  vMMAC_StartPhyTransmit(&tx_frame_buffer,
                         E_MMAC_TX_START_NOW |
                         (send_on_cca ? E_MMAC_TX_USE_CCA : E_MMAC_TX_NO_CCA));

  if(poll_mode) {
    BUSYWAIT_UNTIL(u32MMAC_PollInterruptSource(E_MMAC_INT_TX_COMPLETE), MAX_PACKET_DURATION);
  } else {
    if(in_ack_transmission) {
      /* as nested interupts are not possible, the tx flag will never be cleared */
      BUSYWAIT_UNTIL(FALSE, MAX_ACK_DURATION);
    } else {
      /* wait until the tx flag is cleared */
      BUSYWAIT_UNTIL(!tx_in_progress, MAX_PACKET_DURATION);
    }
  }

  /* Energest */
  ENERGEST_OFF(ENERGEST_TYPE_TRANSMIT);
  if(listen_on) {
    ENERGEST_ON(ENERGEST_TYPE_LISTEN);
  }
  tx_in_progress = 0;

  /* Check error code */
  int ret;
  uint32_t tx_error = u32MMAC_GetTxErrors();
  if(tx_error == 0) {
    ret = RADIO_TX_OK;
    RIMESTATS_ADD(acktx);
  } else if(tx_error & E_MMAC_TXSTAT_ABORTED) {
    ret = RADIO_TX_ERR;
    RIMESTATS_ADD(sendingdrop);
  } else if(tx_error & E_MMAC_TXSTAT_CCA_BUSY) {
    ret = RADIO_TX_COLLISION;
    RIMESTATS_ADD(contentiondrop);
  } else if(tx_error & E_MMAC_TXSTAT_NO_ACK) {
    ret = RADIO_TX_NOACK;
    RIMESTATS_ADD(noacktx);
  } else {
    ret = RADIO_TX_ERR;
  }
  return ret;
}
开发者ID:Wmaia,项目名称:contiki,代码行数:59,代码来源:micromac-radio.c


示例7: cc2520_set_pan_addr

/*---------------------------------------------------------------------------*/
void
cc2520_set_pan_addr(unsigned pan,
                    unsigned addr,
                    const uint8_t *ieee_addr)
{
  uint8_t tmp[2];

  GET_LOCK();

  /*
   * Writing RAM requires crystal oscillator to be stable.
   */
  BUSYWAIT_UNTIL(status() & (BV(CC2520_XOSC16M_STABLE)), RTIMER_SECOND / 10);

  tmp[0] = pan & 0xff;
  tmp[1] = pan >> 8;
  CC2520_WRITE_RAM(&tmp, CC2520RAM_PANID, 2);


  tmp[0] = addr & 0xff;
  tmp[1] = addr >> 8;
  CC2520_WRITE_RAM(&tmp, CC2520RAM_SHORTADDR, 2);
  if(ieee_addr != NULL) {
    int f;
    uint8_t tmp_addr[8];
    // LSB first, MSB last for 802.15.4 addresses in CC2520
    for (f = 0; f < 8; f++) {
      tmp_addr[7 - f] = ieee_addr[f];
    }
    CC2520_WRITE_RAM(tmp_addr, CC2520RAM_IEEEADDR, 8);
  }
  RELEASE_LOCK();
}
开发者ID:1uk3,项目名称:contiki,代码行数:34,代码来源:cc2520.c


示例8: cc1200_arch_init

/*---------------------------------------------------------------------------*/
void
cc1200_arch_init(void)
{
	SPI_InitHighFreq(1);
	
	CC1200_CLK_ALT_MODE;
	CC1200_MISO_ALT_MODE;
	CC1200_MOSI_ALT_MODE;
  /* First leave RESET high */
  CC1200_RESET_OUTPUT;
  CC1200_RESET_SET;

  /* Initialize CSn, enable CSn and then wait for MISO to go low*/
  SPI_WAITFORTx_BEFORE();

  /* Configure GPIOx */
  CC1200_GDO2_INPUT_FLOAT;
	CC1200_GDO0_INPUT_FLOAT;

  /* Leave CSn as default */
  cc1200_arch_spi_deselect();

  /* Ensure MISO is high */
  BUSYWAIT_UNTIL(
    CC1200_MISO_GET(),
    RTIMER_SECOND / 10);
}
开发者ID:huyntsgs,项目名称:ampm_contiki_wisun,代码行数:28,代码来源:cc1200-arch.c


示例9: cc2520_rssi

/*---------------------------------------------------------------------------*/
int
cc2520_rssi(void)
{
  int rssi;
  int radio_was_off = 0;

  if(locked) {
    return 0;
  }

  GET_LOCK();

  if(!receive_on) {
    radio_was_off = 1;
    cc2520_on();
  }
  BUSYWAIT_UNTIL(status() & BV(CC2520_RSSI_VALID), RTIMER_SECOND / 100);

  rssi = (int)((signed char)getreg(CC2520_RSSI));

  if(radio_was_off) {
    cc2520_off();
  }
  RELEASE_LOCK();
  return rssi;
}
开发者ID:1uk3,项目名称:contiki,代码行数:27,代码来源:cc2520.c


示例10: cc1200_arch_init

/*---------------------------------------------------------------------------*/
void
cc1200_arch_init(void)
{
  /* First leave RESET high */
  GPIO_SOFTWARE_CONTROL(CC1200_RESET_PORT_BASE, CC1200_RESET_PIN_MASK);
  GPIO_SET_OUTPUT(CC1200_RESET_PORT_BASE, CC1200_RESET_PIN_MASK);
  ioc_set_over(CC1200_RESET_PORT, CC1200_RESET_PIN, IOC_OVERRIDE_OE);
  GPIO_SET_PIN(CC1200_RESET_PORT_BASE, CC1200_RESET_PIN_MASK);

  /* Initialize CSn, enable CSn and then wait for MISO to go low*/
  spix_cs_init(CC1200_SPI_CSN_PORT, CC1200_SPI_CSN_PIN);

  /* Initialize SPI */
  spix_init(CC1200_SPI_INSTANCE);

  /* Configure GPIOx */
  GPIO_SOFTWARE_CONTROL(CC1200_GDO0_PORT_BASE, CC1200_GDO0_PIN_MASK);
  GPIO_SET_INPUT(CC1200_GDO0_PORT_BASE, CC1200_GDO0_PIN_MASK);
  GPIO_SOFTWARE_CONTROL(CC1200_GDO2_PORT_BASE, CC1200_GDO2_PIN_MASK);
  GPIO_SET_INPUT(CC1200_GDO2_PORT_BASE, CC1200_GDO2_PIN_MASK);

  /* Leave CSn as default */
  cc1200_arch_spi_deselect();

  /* Ensure MISO is high */
  BUSYWAIT_UNTIL(
    GPIO_READ_PIN(CC1200_SPI_MISO_PORT_BASE, CC1200_SPI_MISO_PIN_MASK),
    RTIMER_SECOND / 10);
}
开发者ID:1847123212,项目名称:contiki,代码行数:30,代码来源:cc1200-zoul-arch.c


示例11: cc1200_arch_spi_select

/*---------------------------------------------------------------------------*/
void
cc1200_arch_spi_select(void)
{
  /* Set CSn to low (0) */
  GPIO_CLR_PIN(CC1200_SPI_CSN_PORT_BASE, CC1200_SPI_CSN_PIN_MASK);
  /* The MISO pin should go low before chip is fully enabled. */
  BUSYWAIT_UNTIL(
    GPIO_READ_PIN(CC1200_SPI_MISO_PORT_BASE, CC1200_SPI_MISO_PIN_MASK) == 0,
    RTIMER_SECOND / 100);
}
开发者ID:1847123212,项目名称:contiki,代码行数:11,代码来源:cc1200-zoul-arch.c


示例12: cc1200_arch_spi_select

/*---------------------------------------------------------------------------*/
void
cc1200_arch_spi_select(void)
{
  /* Set CSn to low (0) */
  CC1200_CSN_CLR;
  /* The MISO pin should go low before chip is fully enabled. */
  BUSYWAIT_UNTIL(
	CC1200_MISO_GET() == 0,
    RTIMER_SECOND / 100);
}
开发者ID:huyntsgs,项目名称:ampm_contiki_wisun,代码行数:11,代码来源:cc1200-arch.c


示例13: on

static void
on(void)
{
  CC2520_ENABLE_FIFOP_INT();
  strobe(CC2520_INS_SRXON);

  BUSYWAIT_UNTIL(status() & (BV(CC2520_XOSC16M_STABLE)), RTIMER_SECOND / 100);

  ENERGEST_ON(ENERGEST_TYPE_LISTEN);
  receive_on = 1;
}
开发者ID:1uk3,项目名称:contiki,代码行数:11,代码来源:cc2520.c


示例14: spirit_radio_channel_clear

/*---------------------------------------------------------------------------*/
static int
spirit_radio_channel_clear(void)
{
  float rssi_value;
  /* Local variable used to memorize the SPIRIT1 state */
  uint8_t spirit_state = ON;
  
  PRINTF("CHANNEL CLEAR IN\n");
  
  if(spirit_on == OFF) {
    /* Wakes up the SPIRIT1 */
    spirit_radio_on();
    spirit_state = OFF;
  }
  
  /*  */
  IRQ_DISABLE();
  spirit1_strobe(SPIRIT1_STROBE_SABORT);
/*  SpiritCmdStrobeSabort();*/
  SpiritIrqClearStatus();
  IRQ_ENABLE();
  {
    rtimer_clock_t timeout = RTIMER_NOW() + 5 * RTIMER_SECOND/1000;
    do {
      SpiritRefreshStatus();
    } while((g_xStatus.MC_STATE != MC_STATE_READY) && (RTIMER_NOW() < timeout));
    if(RTIMER_NOW() < timeout) {
      return 1;
    }
  }

  /* Stores the RSSI value */
  rssi_value = SpiritQiGetRssidBm();
  
  /* Puts the SPIRIT1 in its previous state */
  if(spirit_state==OFF) {
    spirit_radio_off();
  } else {
    spirit1_strobe(SPIRIT1_STROBE_RX);
/*    SpiritCmdStrobeRx();*/
    BUSYWAIT_UNTIL(SPIRIT1_STATUS() == SPIRIT1_STATE_RX, 5 * RTIMER_SECOND/1000);
  }
  
  PRINTF("CHANNEL CLEAR OUT\n");
  
  /* Checks the RSSI value with the threshold */
  if(rssi_value<CCA_THRESHOLD) {
    return 0;
  } else {
    return 1;
  }
}
开发者ID:Cancan79,项目名称:mist,代码行数:53,代码来源:spirit1.c


示例15: amb8420SetDstAddress

bool amb8420SetDstAddress(uint8_t dstAddress)
{
    bool ok;
    Handle_t handle;

    RPRINTF("set dst addr to %#02x\n", dstAddress);

    // disable radio rx/tx
    AMB8420ModeContext_t ctx;
    AMB8420_ENTER_STANDBY_MODE(ctx);

    // better be safe than sorry - treat 0 as broadcast too
    if (dstAddress == 0) dstAddress = 0xff;

    // Wait for device to become ready
    AMB8420_WAIT_FOR_RTS_READY(ok);
    if (!ok) goto end;

    // PRINTF("set dst, tar=%u\n", TAR);
//    ATOMIC_START_TIMESAVE(handle);
    AMB8420_SERIAL_CAPTURE(ok);

    commandInProgress = AMB8420_CMD_SET_DESTADDR_REQ;

    serialSendByte(AMB8420_UART_ID, AMB8420_START_DELIMITER);
    serialSendByte(AMB8420_UART_ID, AMB8420_CMD_SET_DESTADDR_REQ);
    serialSendByte(AMB8420_UART_ID, 0x1);
    serialSendByte(AMB8420_UART_ID, dstAddress);
    serialSendByte(AMB8420_UART_ID, AMB8420_START_DELIMITER
            ^ AMB8420_CMD_SET_DESTADDR_REQ ^ 0x1 ^ dstAddress);

    AMB8420_SERIAL_FREE();
//    ATOMIC_END_TIMESAVE(handle);
    // PRINTF("end set dst, tar=%u\n", TAR);

    // wait for reply
    INTERRUPT_ENABLED_START(handle);
    BUSYWAIT_UNTIL(!commandInProgress, TIMER_100_MS, ok);
//    if (commandInProgress) PRINTF("set dst addr: command wait fail\n");
    INTERRUPT_ENABLED_END(handle);
    // if (!ok) goto end;

    // Wait for device to become ready
    AMB8420_WAIT_FOR_RTS_READY(ok);
  end:
    AMB8420_RESTORE_MODE(ctx);
    // PRINTF(" ok = %d\n", (int)ok);
    // if (!ok) amb8420Reset();
    return ok;
}
开发者ID:placidrage,项目名称:mansos,代码行数:50,代码来源:amb8420.c


示例16: flushrx

/*---------------------------------------------------------------------------*/
static void
flushrx(void)
{
  restart_input();

  LOCK_SPI();
  if(state() == CC1101_STATE_RXFIFO_OVERFLOW) {
    strobe(CC1101_SFRX);
  }
  strobe(CC1101_SIDLE);
  BUSYWAIT_UNTIL((state() == CC1101_STATE_IDLE), RTIMER_SECOND / 10);
  strobe(CC1101_SFRX);
  strobe(CC1101_SRX);
  RELEASE_SPI();
}
开发者ID:ADVANSEE,项目名称:mist,代码行数:16,代码来源:cc1101.c


示例17: spirit_radio_transmit

/*---------------------------------------------------------------------------*/
static int
spirit_radio_transmit(unsigned short payload_len)
{ 
  /* This function blocks until the packet has been transmitted */
  rtimer_clock_t rtimer_txdone, rtimer_rxack;

  PRINTF("TRANSMIT IN\n");
  if(!packet_is_prepared) {
    return RADIO_TX_ERR;
  }

  /* Stores the length of the packet to send */
  /* Others spirit_radio_prepare will be in hold */
  spirit_txbuf[0] = payload_len;
  
  /* Puts the SPIRIT1 in TX state */
  receiving_packet = 0;
  SpiritSetReadyState(); 
  spirit1_strobe(SPIRIT1_STROBE_TX);
  just_got_an_ack = 0;
  BUSYWAIT_UNTIL(SPIRIT1_STATUS() == SPIRIT1_STATE_TX, 5 * RTIMER_SECOND/1000);
  BUSYWAIT_UNTIL(SPIRIT1_STATUS() != SPIRIT1_STATE_TX, 50 * RTIMER_SECOND/1000);

  /* Reset radio - needed for immediate RX of ack */
  CLEAR_TXBUF();
  CLEAR_RXBUF();
  SpiritIrqClearStatus();
  spirit1_strobe(SPIRIT1_STROBE_SABORT);
  BUSYWAIT_UNTIL(SPIRIT1_STATUS() == SPIRIT1_STATE_READY, 1 * RTIMER_SECOND/1000);
  spirit1_strobe(SPIRIT1_STROBE_READY);
  BUSYWAIT_UNTIL(SPIRIT1_STATUS() == SPIRIT1_STATE_READY, 1 * RTIMER_SECOND/1000);
  spirit1_strobe(SPIRIT1_STROBE_RX);
  BUSYWAIT_UNTIL(SPIRIT1_STATUS() == SPIRIT1_STATE_RX, 1 * RTIMER_SECOND/1000);

#if NULLRDC_CONF_802154_AUTOACK
  if (wants_an_ack) {
    rtimer_txdone = RTIMER_NOW();
    BUSYWAIT_UNTIL(just_got_an_ack, 15 * RTIMER_SECOND/1000);
    rtimer_rxack = RTIMER_NOW();

    if(just_got_an_ack) {
      ACKPRINTF("debug_ack: ack received after %u/%u ticks\n",
             (uint32_t)(rtimer_rxack - rtimer_txdone), 15 * RTIMER_SECOND/1000);
    } else {
      ACKPRINTF("debug_ack: no ack received\n");
    }
  }
#endif /* NULLRDC_CONF_802154_AUTOACK */

  PRINTF("TRANSMIT OUT\n");

  CLEAR_TXBUF();

  packet_is_prepared = 0;
  return RADIO_TX_OK;
}
开发者ID:Cancan79,项目名称:mist,代码行数:57,代码来源:spirit1.c


示例18: on

static void
on(void)
{
  if(completely_off) {
    completely_off = 0;
    powerup();
    configure();
  }
  CC2420_ENABLE_FIFOP_INT();
  strobe(CC2420_SRXON);

  BUSYWAIT_UNTIL(status() & (BV(CC2420_XOSC16M_STABLE)), RTIMER_SECOND / 100);

  ENERGEST_ON(ENERGEST_TYPE_LISTEN);
  receive_on = 1;
}
开发者ID:Cancan79,项目名称:mist,代码行数:16,代码来源:cc2420.c


示例19: off

static void
off(void)
{
  /*  PRINTF("off\n");*/
  receive_on = 0;

  /* Wait for transmission to end before turning radio off. */
  BUSYWAIT_UNTIL(!(status() & BV(CC2520_TX_ACTIVE)), RTIMER_SECOND / 10);

  ENERGEST_OFF(ENERGEST_TYPE_LISTEN);
  strobe(CC2520_INS_SRFOFF);
  CC2520_DISABLE_FIFOP_INT();

  if(!CC2520_FIFOP_IS_1) {
    flushrx();
  }
}
开发者ID:1uk3,项目名称:contiki,代码行数:17,代码来源:cc2520.c


示例20: configure

static void
configure(void)
{
  uint16_t reg;
  BUSYWAIT_UNTIL(status() & (BV(CC2420_XOSC16M_STABLE)), RTIMER_SECOND / 100);

  /* Turn on/off automatic packet acknowledgment and address decoding. */
  reg = getreg(CC2420_MDMCTRL0);

#if CC2420_CONF_AUTOACK
  reg |= AUTOACK | ADR_DECODE;
#else
  reg &= ~(AUTOACK | ADR_DECODE);
#endif /* CC2420_CONF_AUTOACK */
  setreg(CC2420_MDMCTRL0, reg);

  /* Set transmission turnaround time to the lower setting (8 symbols
     = 0.128 ms) instead of the default (12 symbols = 0.192 ms). */
  /*  reg = getreg(CC2420_TXCTRL);
  reg &= ~(1 << 13);
  setreg(CC2420_TXCTRL, reg);*/

  /* Change default values as recomended in the data sheet, */
  /* correlation threshold = 20, RX bandpass filter = 1.3uA. */
  setreg(CC2420_MDMCTRL1, CORR_THR(20));
  reg = getreg(CC2420_RXCTRL1);
  reg |= RXBPF_LOCUR;
  setreg(CC2420_RXCTRL1, reg);

  /* Set the FIFOP threshold to maximum. */
  setreg(CC2420_IOCFG0, FIFOP_THR(127));

  /* Turn off "Security enable" (page 32). */
  reg = getreg(CC2420_SECCTRL0);
  reg &= ~RXFIFO_PROTECTION;
  setreg(CC2420_SECCTRL0, reg);

  cc2420_set_pan_addr(pan, addr, NULL);
  cc2420_set_channel(channel);

  flushrx();

}
开发者ID:Cancan79,项目名称:mist,代码行数:43,代码来源:cc2420.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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