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

📄 iarapp.c

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

#include "hal.h"

#define MANGLED_NESC_APP_C
#define dbg(mode, format) ((void)0)
#define dbg_clear(mode, format) ((void)0)
#define dbg_active(mode) 0
//# 60 "/usr/local/avr/include/inttypes.h"
typedef signed char int8_t;




typedef unsigned char uint8_t;
//# 83 "/usr/local/avr/include/inttypes.h" 3
typedef int int16_t;




typedef unsigned int uint16_t;










typedef long int32_t;




typedef unsigned long uint32_t;
//#line 117




//#line 134
typedef int16_t intptr_t;




typedef uint16_t uintptr_t;
//# 213 "/usr/local/lib/gcc-lib/avr/3.3-tinyos/include/stddef.h" 3
typedef unsigned int size_t;
//#line 325
typedef int wchar_t;
//# 60 "/usr/local/avr/include/stdlib.h"
typedef struct __nesc_unnamed4242 {
  int quot;
  int rem;
} div_t;


typedef struct __nesc_unnamed4243 {
  long quot;
  long rem;
} ldiv_t;


typedef int (*__compar_fn_t)(const void *, const void *);
//# 151 "/usr/local/lib/gcc-lib/avr/3.3-tinyos/include/stddef.h" 3
typedef int ptrdiff_t;
//# 85 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/tos.h"
typedef unsigned char bool;

uint16_t TOS_LOCAL_ADDRESS = 1;

enum __nesc_unnamed4245 {
  FAIL = 0,
  SUCCESS = 1
};
static /*inline*/

uint8_t rcombine(uint8_t r1, uint8_t r2);
typedef uint8_t  result_t;
static /*inline*/






result_t rcombine(result_t r1, result_t r2);
static /*inline*/






result_t rcombine3(result_t r1, result_t r2, result_t r3);
//#line 128
//# 39 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/CC2430/hal.h"
//typedef unsigned char BOOL;


//typedef unsigned char BYTE;
//typedef unsigned short WORD;
//typedef unsigned long DWORD;


//typedef unsigned char UINT8;
//typedef unsigned short UINT16;
//typedef unsigned long UINT32;


//typedef signed char INT8;
//typedef signed short INT16;
//typedef signed long INT32;
//#line 501
//#line 1140
BOOL halSetTimer2Period(BYTE mode, DWORD period);
//#line 1506
BOOL halRfConfig(UINT32 frequency);
//# 89 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/CC2430/ioCC2430.h"
//typedef int sfr;
//#line 125
//U0CSR = 0x86
//#line 139
//P1 = 0x90
//RFIM = 0x91


//T2CMP = 0x94







//IEN2 = 0x9A
//S1CON = 0x9B
//T2PEROF0 = 0x9C
//T2PEROF1 = 0x9D
//T2PEROF2 = 0x9E




//T2OF0 = 0xA1
//T2OF1 = 0xA2
//T2OF2 = 0xA3
//T2CAPLPL = 0xA4
//T2CAPHPH = 0xA5
//T2TLD = 0xA6
//T2THD = 0xA7
//#line 194
//SLEEP = 0xBE




//U0DBUF = 0xC1
//U0BAUD = 0xC2
//T2CNF = 0xC3
//U0UCR = 0xC4
//U0GCR = 0xC5
//CLKCON = 0xC6
//#line 217
//PSW = 0xD0










//RFD = 0xD9








//RFST = 0xE1









//RFIF = 0xE9








//PERCFG = 0xF1

//P0SEL = 0xF3
//P1SEL = 0xF4
//P2SEL = 0xF5









//P1DIR = 0xFE







//typedef int sbit;
//#line 295
//URX0IF = 0x8B

//RFERRIF = 0x89
//#line 325
//EA = 0xAF




//URX0IE = 0xAA

//RFERRIE = 0xA8
//#line 350
//T2IF = 0xC2
//#line 381
//UTX0IF = 0xE9
static /*inline*/
//# 100 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/CC2430/CC2430hardware.h"
void TOSH_wait(void);
static /*inline*/



void TOSH_sleep(void);










typedef uint8_t __nesc_atomic_t;

/*__inline*/ __nesc_atomic_t  __nesc_atomic_start(void );






/*__inline*/ void  __nesc_atomic_end(__nesc_atomic_t oldSreg);
static




/*__inline*/ void __nesc_enable_interrupt(void);
//# 34 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/CC2430/hardware.h"
static /*__inline*/ void TOSH_SET_RED_LED_PIN(void);
//#line 34
static /*__inline*/ void TOSH_CLR_RED_LED_PIN(void);
//#line 34
static /*__inline*/ void TOSH_MAKE_RED_LED_OUTPUT(void);
//#line 34
static /*__inline*/ void TOSH_MAKE_RED_LED_GIO(void);
static /*__inline*/ void TOSH_SET_GREEN_LED_PIN(void);
//#line 35
static /*__inline*/ void TOSH_CLR_GREEN_LED_PIN(void);
//#line 35
static /*__inline*/ void TOSH_MAKE_GREEN_LED_OUTPUT(void);
//#line 35
static /*__inline*/ void TOSH_MAKE_GREEN_LED_GIO(void);
static /*__inline*/ void TOSH_SET_YELLOW_LED_PIN(void);
//#line 36
static /*__inline*/ void TOSH_CLR_YELLOW_LED_PIN(void);
//#line 36
static /*__inline*/ void TOSH_MAKE_YELLOW_LED_OUTPUT(void);
//#line 36
static /*__inline*/ void TOSH_MAKE_YELLOW_LED_GIO(void);
static /*inline*/
//#line 57
void TOSH_SET_PIN_DIRECTIONS(void );
//#line 74
enum __nesc_unnamed4248 {
  TOSH_ADC_PORTMAPSIZE = 9
};
//# 54 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/types/dbg_modes.h"
typedef long  TOS_dbg_mode;



//# 59 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/sched.c"
typedef struct __nesc_unnamed4250 {
  void (*tp)(void);
} TOSH_sched_entry_T;

enum __nesc_unnamed4251 {
  TOSH_MAX_TASKS = 8,
  TOSH_TASK_BITMASK = TOSH_MAX_TASKS - 1
};

TOSH_sched_entry_T TOSH_queue[TOSH_MAX_TASKS];
volatile uint8_t TOSH_sched_full;
volatile uint8_t TOSH_sched_free;
static /*inline*/

void TOSH_wait(void );
static /*inline*/ void TOSH_sleep(void );
static /*inline*/
void TOSH_sched_init(void );
//#line 98
bool  TOS_post(void (*tp)(void));
static /*inline*/
//#line 139
bool TOSH_run_next_task(void);
static /*inline*/
//#line 162
void TOSH_run_task(void);
//# 46 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/CC2430/AM.h"
enum __nesc_unnamed4252 {
  TOS_BCAST_ADDR = 0xffff,
  TOS_UART_ADDR = 0x007e
};





enum __nesc_unnamed4253 {
  TOS_DEFAULT_AM_GROUP = 0x7d
};

uint8_t TOS_AM_GROUP = TOS_DEFAULT_AM_GROUP;
//#line 71
typedef struct TOS_Msg {


  uint8_t length;
  uint8_t fcfhi;
  uint8_t fcflo;
  uint8_t dsn;
  uint16_t destpan;
  uint16_t addr;
  uint8_t type;
  uint8_t group;
  int8_t data[28];







  uint8_t strength;
  uint8_t lqi;
  bool crc;
  bool ack;
  uint16_t time;
} TOS_Msg;


enum __nesc_unnamed4254 {

  MSG_HEADER_SIZE = (size_t)(unsigned long)& ((struct TOS_Msg *)0)->data - 1,

  MSG_FOOTER_SIZE = 2,

  MSG_DATA_SIZE = (size_t)(unsigned long)& ((struct TOS_Msg *)0)->strength + sizeof(uint16_t ),

  DATA_LENGTH = 28,

  LENGTH_BYTE_NUMBER = (size_t)(unsigned long)& ((struct TOS_Msg *)0)->length + 1
};

typedef TOS_Msg *TOS_MsgPtr;
static /*inline*/
uint8_t TOS_MsgLength(uint8_t type);
static
//# 12 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/CC2430/byteorder.h"
/*__inline*/ int is_host_lsb(void);
static




/*__inline*/ uint16_t toLSB16(uint16_t a);
static



/*__inline*/ uint16_t fromLSB16(uint16_t a);
//# 9 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/CC2430/CC2430Timer.h"
enum __nesc_unnamed4255 {

  CC2430TIMER_CM_NONE = 0,
  CC2430TIMER_CM_RISING = 1,
  CC2430TIMER_CM_FALLING = 2,
  CC2430TIMER_CM_BOTH = 3,

  CC2430TIMER34_FREE_RUN_MODE = 0,
  CC2430TIMER34_DOWN_MODE = 1,
  CC2430TIMER34_CONTINUOUS_UP_MODE = 2,
  CC2430TIMER34_UPDOWN_MODE = 3,

  CC2430TIMER1_STOP_MODE = 0,
  CC2430TIMER1_FREE_RUN_MODE = 1,
  CC2430TIMER1_CONTINUOUS_UP_MODE = 2,
  CC2430TIMER1_UPDOWN_MODE = 3,

  CC2430TIMER_TACLK = 0,
  CC2430TIMER_TBCLK = 0,
  CC2430TIMER_ACLK = 1,
  CC2430TIMER_SMCLK = 2,
  CC2430TIMER_INCLK = 3,

  CC2430TIMER1_CLOCKDIV_1 = 0,
  CC2430TIMER1_CLOCKDIV_8 = 1,
  CC2430TIMER1_CLOCKDIV_32 = 2,
  CC2430TIMER1_CLOCKDIV_128 = 3,

  CC2430TIMER34_CLOCKDIV_1 = 0,
  CC2430TIMER34_CLOCKDIV_2 = 1,
  CC2430TIMER34_CLOCKDIV_4 = 2,
  CC2430TIMER34_CLOCKDIV_8 = 3,
  CC2430TIMER34_CLOCKDIV_16 = 4,
  CC2430TIMER34_CLOCKDIV_32 = 5,
  CC2430TIMER34_CLOCKDIV_64 = 6,
  CC2430TIMER34_CLOCKDIV_128 = 7
};
//#line 63
typedef struct __nesc_unnamed4256 {

  int t2cmpim : 1;
  int t2perim : 1;
  int t2ofcmpim : 1;
  int  : 3;
  int t2if : 1;
  int t2ie : 1;

  int t2cmpif : 1;
  int t2perif : 1;
  int t2ofcmpif : 1;
  int  : 1;
  int t2cmsel : 1;
  int  : 1;
  int t2sync : 1;
  int t2run : 1;
}
CC2430Timer2Control_t;


typedef struct __nesc_unnamed4257 {

  int t1ifg : 1;
  int t1ie : 1;
  int t1clr : 1;
  int _unused0 : 1;
  int mc : 2;
  int id : 2;
  int tassel : 2;
  int _unused1 : 6;
} CC2430Timer1Control_t;

typedef struct __nesc_unnamed4258 {

  int tbifg : 1;
  int tbie : 1;
  int tbclr : 1;
  int _unused0 : 1;
  int mc : 2;
  int id : 2;
  int tbssel : 2;
  int _unused1 : 1;
  int cntl : 2;
  int tbclgrp : 2;
  int _unused2 : 1;
} CC2430Timer34Control_t;
static  result_t HPLInit__init(void);
static  result_t GenericBaseM__UARTSend__sendDone(TOS_MsgPtr arg_0xa24e528, result_t arg_0xa24e678);
static  TOS_MsgPtr GenericBaseM__RadioReceive__receive(TOS_MsgPtr arg_0xa24f9a8);
static  result_t GenericBaseM__RadioSend__sendDone(TOS_MsgPtr arg_0xa24e528, result_t arg_0xa24e678);
static  result_t GenericBaseM__StdControl__init(void);
static  result_t GenericBaseM__StdControl__start(void);
static  TOS_MsgPtr GenericBaseM__UARTReceive__receive(TOS_MsgPtr arg_0xa24f9a8);
static  result_t CC2430RadioM__SplitControl__default__initDone(void);
static  result_t CC2430RadioM__SplitControl__init(void);
static  result_t CC2430RadioM__SplitControl__default__startDone(void);
static  result_t CC2430RadioM__SplitControl__start(void);
static    result_t CC2430RadioM___FIFOP__fired(void);
static   result_t CC2430RadioM___SFD__captured(uint16_t arg_0xa2b3640);
static  result_t CC2430RadioM__Send__send(TOS_MsgPtr arg_0xa24e010);
static   void CC2430RadioM__RadioReceiveCoordinator__default__startSymbol(uint8_t arg_0xa295ba0, uint8_t arg_0xa295ce8, TOS_MsgPtr arg_0xa295e38);
static  result_t CC2430RadioM__CC2430SplitControl__initDone(void);
static  result_t CC2430RadioM__CC2430SplitControl__startDone(void);
static   void CC2430RadioM__RadioSendCoordinator__default__startSymbol(uint8_t arg_0xa295ba0, uint8_t arg_0xa295ce8, TOS_MsgPtr arg_0xa295e38);
static  result_t CC2430RadioM__StdControl__init(void);
static  result_t CC2430RadioM__StdControl__start(void);
static  result_t CC2430ControlM__SplitControl__init(void);
static  result_t CC2430ControlM__SplitControl__start(void);
static   result_t CC2430ControlM__CC2430Control__RxMode(void);
static  result_t CC2430ControlM__CC2430Control__setShortAddress(uint16_t arg_0xa28eb98);
static    result_t CC2430ControlM___CCA__fired(void);
static   result_t HPLCC2430RFInterruptM___FIFOP__disable(void);
static   result_t HPLCC2430RFInterruptM___FIFOP__startWait(void);
static   result_t HPLCC2430RFInterruptM___SFD__disable(void);
static   result_t HPLCC2430RFInterruptM___SFD__enableCapture(bool arg_0xa2b2f50);
static   result_t HPLCC2430RFInterruptM___CCA__startWait(void);
static   uint16_t CC2430TimerM__Capture2__getEvent(void);
static   void CC2430TimerM__Capture2__clearOverflow(void);
static   void CC2430TimerM__Control2__setControlAsCapture(bool arg_0xa35f748);
static   void CC2430TimerM__Control2__enableEvents(void);
static   void CC2430TimerM__Control2__disableEvents(void);
static   void CC2430TimerM__Control2__clearPendingInterrupt(void);
static   result_t LedsC__Leds__yellowOff(void);
static   result_t LedsC__Leds__yellowOn(void);
static   result_t LedsC__Leds__init(void);
static   result_t LedsC__Leds__greenOff(void);
static   result_t LedsC__Leds__redOff(void);
static   result_t LedsC__Leds__greenToggle(void);
static   result_t LedsC__Leds__yellowToggle(void);
static   result_t LedsC__Leds__redToggle(void);
static   result_t LedsC__Leds__redOn(void);
static   result_t LedsC__Leds__greenOn(void);
static  result_t NoCRCPacket__Send__send(TOS_MsgPtr arg_0xa24e010);
static  result_t NoCRCPacket__SendVarLenPacket__default__sendDone(uint8_t *arg_0xa3bca08, result_t arg_0xa3bcb58);
static   result_t NoCRCPacket__ByteComm__txDone(void);
static   result_t NoCRCPacket__ByteComm__txByteReady(bool arg_0xa3cb108);
static   result_t NoCRCPacket__ByteComm__rxByteReady(uint8_t arg_0xa3ca938, bool arg_0xa3caa80, uint16_t arg_0xa3cabd8);
static  result_t NoCRCPacket__Control__init(void);
static  result_t NoCRCPacket__Control__start(void);
static  result_t NoCRCPacket__txBytes(uint8_t *arg_0xa3bd390, uint8_t arg_0xa3bd4e0);
static   result_t UARTM__HPLUART__get(uint8_t arg_0xa4030c0);
static   result_t UARTM__HPLUART__putDone(void);
static   result_t UARTM__ByteComm__txByte(uint8_t arg_0xa3ca4a8);
static  result_t UARTM__Control__init(void);
static  result_t UARTM__Control__start(void);
static   result_t HPLUART0M__UART__init(void);
static   result_t HPLUART0M__UART__put(uint8_t arg_0xa402bc0);
static
//# 47 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/CC2430/RealMain.nc"
result_t RealMain__hardwareInit(void);
static
//# 63 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc"
result_t RealMain__StdControl__init(void);
static





result_t RealMain__StdControl__start(void);
//# 57 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/CC2430/RealMain.nc"
int   main(void);
static /*inline*/
//# 10 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/CC2430/HPLInit.nc"
result_t HPLInit__init(void);
static
//# 58 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/BareSendMsg.nc"
result_t GenericBaseM__UARTSend__send(TOS_MsgPtr arg_0xa24e010);
static
//# 63 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc"
result_t GenericBaseM__RadioControl__init(void);
static





result_t GenericBaseM__RadioControl__start(void);
static
//#line 63
result_t GenericBaseM__UARTControl__init(void);
static

⌨️ 快捷键说明

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