⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iarapp.c

📁 无线网络传感器基站通用节点测试程序.包含基站接口和主模块程序.
💻 C
📖 第 1 页 / 共 5 页
字号:
    __nesc_atomic_end(__nesc_atomic); }
  return SUCCESS;
}

//# 7 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/CC2430/CC2430RFInterrupt.nc"
/*inline*/ static   result_t CC2430ControlM___CCA__startWait(void){
//#line 7
  unsigned char result;
//#line 7

//#line 7
  result = HPLCC2430RFInterruptM___CCA__startWait();
//#line 7

//#line 7
  return result;
//#line 7
}
//#line 7
static /*inline*/
//# 106 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/CC2430/CC2430ControlM.nc"
result_t CC2430ControlM__SplitControl__start(void)
//#line 106
{
  uint8_t _state = 0;

  { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
//#line 109
    {
      if (CC2430ControlM__state == CC2430ControlM__INIT_STATE_DONE) {
          CC2430ControlM__state = CC2430ControlM__START_STATE;
          _state = 1;
        }
    }
//#line 114
    __nesc_atomic_end(__nesc_atomic); }
  if (!_state) {
    return FAIL;
    }

  RFIF = 0;
  RFIM = 0;

  S1CON &= ~0x03;

  IEN2 |= 0x01;



  if (!halRfConfig(2405000)) {
      _state = 0;
    }
  (

  (unsigned char volatile __xdata  *)0)[0xDF4F] = 127;


  RFERRIF = 0;

  RFERRIE = 1;
  (


  (unsigned char volatile __xdata  *)0)[0xDF16] = 0xFF;
  do {
//#line 143
      RFST = 0xC2;
    }
  while (
//#line 143
  0);
  do {
//#line 144
      RFST = 0xC7;
    }
  while (
//#line 144
  0);
  do {
//#line 145
      RFST = 0xC6;
    }
  while (
//#line 145
  0);
  do {
//#line 146
      RFST = 0xC6;
    }
  while (
//#line 146
  0);

  do {
//#line 148
      RFST = 0xFE;
    }
  while (
//#line 148
  0);
  (
//#line 160
  (unsigned char volatile __xdata  *)0)[0xDF50] = 24;


  CC2430ControlM___CCA__startWait();

  return SUCCESS;
}

//# 77 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/SplitControl.nc"
/*inline*/ static  result_t CC2430RadioM__CC2430SplitControl__start(void){
//#line 77
  unsigned char result;
//#line 77

//#line 77
  result = CC2430ControlM__SplitControl__start();
//#line 77

//#line 77
  return result;
//#line 77
}
//#line 77
static /*inline*/
//# 224 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/CC2430/CC2430RadioM.nc"
result_t CC2430RadioM__SplitControl__start(void)
//#line 224
{
  uint8_t chkstateRadio;

  { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
//#line 227
    chkstateRadio = CC2430RadioM__stateRadio;
//#line 227
    __nesc_atomic_end(__nesc_atomic); }

  if (chkstateRadio == CC2430RadioM__DISABLED_STATE) {
      { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
//#line 230
        {
          CC2430RadioM__stateRadio = CC2430RadioM__WARMUP_STATE;
          CC2430RadioM__countRetry = 0;
          CC2430RadioM__rxbufptr->length = 0;
        }
//#line 234
        __nesc_atomic_end(__nesc_atomic); }
      do {
//#line 235
          T2CNF = 1 ? T2CNF | 0x01 : T2CNF & ~0x01;
        }
      while (
//#line 235
      0);

      return CC2430RadioM__CC2430SplitControl__start();
    }
  return FAIL;
}

static /*inline*/
//#line 186
void CC2430RadioM__startRadio(void)
//#line 186
{
  result_t success = FAIL;

//#line 188
  { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
//#line 188
    {
      if (CC2430RadioM__stateRadio == CC2430RadioM__DISABLED_STATE_STARTTASK) {
          CC2430RadioM__stateRadio = CC2430RadioM__DISABLED_STATE;
          success = SUCCESS;
        }
    }
//#line 193
    __nesc_atomic_end(__nesc_atomic); }

  if (success == SUCCESS) {
    CC2430RadioM__SplitControl__start();
    }
}

static /*inline*/  result_t CC2430RadioM__StdControl__start(void)
//#line 200
{







  result_t success = FAIL;

  { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
//#line 210
    {
      if (CC2430RadioM__stateRadio == CC2430RadioM__DISABLED_STATE) {

          if (TOS_post(CC2430RadioM__startRadio)) {
              success = SUCCESS;
              CC2430RadioM__stateRadio = CC2430RadioM__DISABLED_STATE_STARTTASK;
            }
        }
    }
//#line 218
    __nesc_atomic_end(__nesc_atomic); }

  return success;
}

//# 70 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc"
/*inline*/ static  result_t GenericBaseM__RadioControl__start(void){
//#line 70
  unsigned char result;
//#line 70

//#line 70
  result = CC2430RadioM__StdControl__start();
//#line 70

//#line 70
  return result;
//#line 70
}
//#line 70
static /*inline*/
//# 11 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/CC2430/HPLUART0M.nc"
result_t HPLUART0M__UART__init(void)
//#line 11
{

  do {
//#line 13
      if (0 == 2 && 2 == 3) {
//#line 13
          if (1) {
//#line 13
              P2SEL |= 0x02;
            }
          else
//#line 13
            {
//#line 13
              P2SEL &= ~0x02;
            }
        }
      else {
//#line 13
        if (0 == 2 && 2 == 4) {
//#line 13
            if (1) {
//#line 13
                P2SEL |= 0x04;
              }
            else
//#line 13
              {
//#line 13
                P2SEL &= ~0x04;
              }
          }
        else
//#line 13
          {
//#line 13
            if (1) {
//#line 13
                P0SEL |= 0x01 << 2;
              }
            else
//#line 13
              {
//#line 13
                P0SEL &= ~(0x01 << 2);
              }
          }
        }
    }
  while (
//#line 13
  0);
  do {
//#line 14
      if (0 == 2 && 3 == 3) {
//#line 14
          if (1) {
//#line 14
              P2SEL |= 0x02;
            }
          else
//#line 14
            {
//#line 14
              P2SEL &= ~0x02;
            }
        }
      else {
//#line 14
        if (0 == 2 && 3 == 4) {
//#line 14
            if (1) {
//#line 14
                P2SEL |= 0x04;
              }
            else
//#line 14
              {
//#line 14
                P2SEL &= ~0x04;
              }
          }
        else
//#line 14
          {
//#line 14
            if (1) {
//#line 14
                P0SEL |= 0x01 << 3;
              }
            else
//#line 14
              {
//#line 14
                P0SEL &= ~(0x01 << 3);
              }
          }
        }
    }
  while (
//#line 14
  0);
  do {
//#line 15
      PERCFG = (PERCFG & ~0x01) | 0x00;
    }
  while (
//#line 15
  0);
  do {
//#line 16
      if (0x00) {
//#line 16
          CLKCON |= 0x40;
//#line 16
          while (!(SLEEP & 0x20)) ;
//#line 16
          if ((CLKCON & 0x38) >> 3 == 0) {
//#line 16
              CLKCON |= 0x08;
            }
//#line 16
          SLEEP |= 0x04;
        }
      else
//#line 16
        {
//#line 16
          SLEEP &= ~0x04;
//#line 16
          while (!(SLEEP & 0x40)) ;
//#line 16
           __asm ("NOP");CLKCON &= ~0x47;
//#line 16
          SLEEP |= 0x04;
        }
    }
  while (
//#line 16
  0);
  do {
//#line 17
      if (0 == 0) {
//#line 17
          if (PERCFG & 0x01) {
//#line 17
              P1SEL |= 0x30;
            }
          else
//#line 17
            {
//#line 17
              P0SEL |= 0x0C;
            }
        }
      else
//#line 17
        {
//#line 17
          if (PERCFG & 0x02) {
//#line 17
              P1SEL |= 0xC0;
            }
          else
//#line 17
            {
//#line 17
              P0SEL |= 0x30;
            }
        }
//#line 17
      U0GCR = 115200 == 2400 ? 6 + (CLKCON & 0x07) : 115200 == 4800 ? 7 + (CLKCON & 0x07) : 115200 == 9600 ? 8 + (CLKCON & 0x07) : 115200 == 14400 ? 8 + (CLKCON & 0x07) : 115200 == 19200 ? 9 + (CLKCON & 0x07) : 115200 == 28800 ? 9 + (CLKCON & 0x07) : 115200 == 38400 ? 10 + (CLKCON & 0x07) : 115200 == 57600 ? 10 + (CLKCON & 0x07) : 115200 == 76800 ? 11 + (CLKCON & 0x07) : 115200 == 115200 ? 11 + (CLKCON & 0x07) : 115200 == 153600 ? 12 + (CLKCON & 0x07) : 115200 == 230400 ? 12 + (CLKCON & 0x07) : 115200 == 307200 ? 13 + (CLKCON & 0x07) : 0;
//#line 17
      U0BAUD = 115200 == 2400 ? 59 : 115200 == 4800 ? 59 : 115200 == 9600 ? 59 : 115200 == 14400 ? 216 : 115200 == 19200 ? 59 : 115200 == 28800 ? 216 : 115200 == 38400 ? 59 : 115200 == 57600 ? 216 : 115200 == 76800 ? 59 : 115200 == 115200 ? 216 : 115200 == 153600 ? 59 : 115200 == 230400 ? 216 : 115200 == 307200 ? 59 : 0;
//#line 17
      U0CSR |= 0x80;
//#line 17
      U0UCR |= 0x00 | 0x80;
//#line 17
      if (0x00 & 0x80) {
//#line 17
          U0GCR |= 0x20;
        }
    }
  while (
//#line 17
  0);

  URX0IE = 1;
  IEN2 |= 0x04;


  UTX0IF = 0;

  return SUCCESS;
}

//# 62 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/HPLUART.nc"
/*inline*/ static   result_t UARTM__HPLUART__init(void){
//#line 62
  unsigned char result;
//#line 62

//#line 62
  result = HPLUART0M__UART__init();
//#line 62

//#line 62
  return result;
//#line 62
}
//#line 62
static /*inline*/
//# 68 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/UARTM.nc"
result_t UARTM__Control__start(void)
//#line 68
{
  return UARTM__HPLUART__init();
}

//# 70 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc"
/*inline*/ static  result_t NoCRCPacket__ByteControl__start(void){
//#line 70
  unsigned char result;
//#line 70

//#line 70
  result = UARTM__Control__start();
//#line 70

//#line 70
  return result;
//#line 70
}
//#line 70
static /*inline*/
//# 111 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/NoCRCPacket.nc"
result_t NoCRCPacket__Control__start(void)
//#line 111
{

  return NoCRCPacket__ByteControl__start();
}

//# 70 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc"
/*inline*/ static  result_t GenericBaseM__UARTControl__start(void){
//#line 70
  unsigned char result;
//#line 70

//#line 70
  result = NoCRCPacket__Control__start();
//#line 70

//#line 70
  return result;
//#line 70
}
//#line 70
static /*inline*/
//# 83 "GenericBaseM.nc"
result_t GenericBaseM__StdControl__start(void)
//#line 83
{
  result_t ok1;
//#line 84
  result_t ok2;

  ok1 = GenericBaseM__UARTControl__start();
  ok2 = GenericBaseM__RadioControl__start();

  return rcombine(ok1, ok2);
}

//# 70 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc"
/*inline*/ static  result_t RealMain__StdControl__start(void){
//#line 70
  unsigned char result;
//#line 70

//#line 70
  result = GenericBaseM__StdControl__start();
//#line 70

//#line 70
  return result;
//#line 70
}
//#line 70
static
//# 131 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/CC2430/CC2430hardware.h"
/*__inline*/ void __nesc_enable_interrupt(void)
//#line 131
{
  EA = 1;
}

static /*inline*/
//#line 100
void TOSH_wait(void)
{
   __asm ("NOP");
   __asm ("NOP");}

static /*inline*/ void TOSH_sleep(void)
{
}

//#line 125
/*__inline*/ void  __nesc_atomic_end(__nesc_atomic_t oldSreg)
{
  PSW = oldSreg;
  EA = 1;
}

//#line 118
/*__inline*/ __nesc_atomic_t  __nesc_atomic_start(void )
{
  __nesc_atomic_t result = PSW;

//#line 121
  EA = 0;
  return result;
}

static /*inline*/
//# 139 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/sched.c"
bool TOSH_run_next_task(void)
//#line 139
{
  __nesc_atomic_t fInterruptFlags;
  uint8_t old_full;
  void (*func)(void );

  if (TOSH_sched_full == TOSH_sched_free) {

      return 0;
    }
  else {

      fInterruptFlags = __nesc_atomic_start();
      old_full = TOSH_sched_full;
      TOSH_sched_full++;
      TOSH_sched_full &= TOSH_TASK_BITMASK;
      func = TOSH_queue[(int )old_full].tp;
      TOSH_queue[(int )old_full].tp = 0;
      __nesc_atomic_end(fInterruptFlags);
      func();
      return 1;
    }
}

static /*inline*/ void TOSH_run_task(void)
//#line 162
{
  while (TOSH_run_next_task())
    ;
  TOSH_sleep();
  TOSH_wait();
}

//# 9 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/CC2430/HPLCC2430Capture.nc"
/*inline*/ static   result_t HPLCC2430RFInterruptM___SFD__captured(uint16_t arg_0xa2b3640){

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -