📄 app.c
字号:
# 42 "/opt/tinyos-2.x/tos/chips/rf230/IEEE154Packet.h"#line 27typedef nx_struct ieee154_header_t { nxle_uint8_t length; nxle_uint16_t fcf; nxle_uint8_t dsn; nxle_uint16_t destpan; nxle_uint16_t dest; nxle_uint16_t src; nxle_uint8_t type;} __attribute__((packed)) ieee154_header_t;#line 45typedef nx_struct ieee154_footer_t { nxle_uint16_t crc;} __attribute__((packed)) ieee154_footer_t;enum ieee154_fcf_enums { IEEE154_FCF_FRAME_TYPE = 0, IEEE154_FCF_SECURITY_ENABLED = 3, IEEE154_FCF_FRAME_PENDING = 4, IEEE154_FCF_ACK_REQ = 5, IEEE154_FCF_INTRAPAN = 6, IEEE154_FCF_DEST_ADDR_MODE = 10, IEEE154_FCF_SRC_ADDR_MODE = 14};enum ieee154_fcf_type_enums { IEEE154_TYPE_BEACON = 0, IEEE154_TYPE_DATA = 1, IEEE154_TYPE_ACK = 2, IEEE154_TYPE_MAC_CMD = 3, IEEE154_TYPE_MASK = 7};enum iee154_fcf_addr_mode_enums { IEEE154_ADDR_NONE = 0, IEEE154_ADDR_SHORT = 2, IEEE154_ADDR_EXT = 3, IEEE154_ADDR_MASK = 3};# 29 "/opt/tinyos-2.x/tos/chips/rf230/RF230Packet.h"typedef ieee154_header_t rf230packet_header_t;#line 31typedef nx_struct rf230packet_footer_t {} __attribute__((packed)) rf230packet_footer_t;#line 36typedef struct rf230packet_metadata_t { uint8_t flags; uint8_t lqi; uint8_t power; uint32_t timestamp;} rf230packet_metadata_t;enum rf230packet_metadata_flags { RF230PACKET_WAS_ACKED = 0x01, RF230PACKET_TIMESTAMP = 0x02, RF230PACKET_TXPOWER = 0x04, RF230PACKET_RSSI = 0x08, RF230PACKET_TIMESYNC = 0x10, RF230PACKET_CLEAR_METADATA = 0x00};# 6 "/opt/tinyos-2.x/tos/types/AM.h"typedef nx_uint8_t nx_am_id_t;typedef nx_uint8_t nx_am_group_t;typedef nx_uint16_t nx_am_addr_t;typedef uint8_t am_id_t;typedef uint8_t am_group_t;typedef uint16_t am_addr_t;enum __nesc_unnamed4312 { AM_BROADCAST_ADDR = 0xffff};enum __nesc_unnamed4313 { TOS_AM_GROUP = 0x22, TOS_AM_ADDRESS = 1};# 72 "/opt/tinyos-2.x/tos/lib/serial/Serial.h"typedef uint8_t uart_id_t;enum __nesc_unnamed4314 { HDLC_FLAG_BYTE = 0x7e, HDLC_CTLESC_BYTE = 0x7d};enum __nesc_unnamed4315 { TOS_SERIAL_ACTIVE_MESSAGE_ID = 0, TOS_SERIAL_CC1000_ID = 1, TOS_SERIAL_802_15_4_ID = 2, TOS_SERIAL_UNKNOWN_ID = 255};enum __nesc_unnamed4316 { SERIAL_PROTO_ACK = 67, SERIAL_PROTO_PACKET_ACK = 68, SERIAL_PROTO_PACKET_NOACK = 69, SERIAL_PROTO_PACKET_UNKNOWN = 255};#line 110#line 98typedef struct radio_stats { uint8_t version; uint8_t flags; uint8_t reserved; uint8_t platform; uint16_t MTU; uint16_t radio_crc_fail; uint16_t radio_queue_drops; uint16_t serial_crc_fail; uint16_t serial_tx_fail; uint16_t serial_short_packets; uint16_t serial_proto_drops;} radio_stats_t;#line 112typedef nx_struct serial_header { nx_am_addr_t dest; nx_am_addr_t src; nx_uint8_t length; nx_am_group_t group; nx_am_id_t type;} __attribute__((packed)) serial_header_t;#line 120typedef nx_struct serial_packet { serial_header_t header; nx_uint8_t data[];} __attribute__((packed)) serial_packet_t;#line 125typedef nx_struct serial_metadata { nx_uint8_t ack;} __attribute__((packed)) serial_metadata_t;# 71 "/opt/tinyos-2.x/tos/platforms/iris/platform_message.h"#line 68typedef union message_header { rf230packet_header_t rf230; serial_header_t serial;} message_header_t;#line 73typedef union message_footer { rf230packet_footer_t rf230;} message_footer_t;#line 77typedef union message_metadata { rf230packet_metadata_t rf230;} message_metadata_t;# 19 "/opt/tinyos-2.x/tos/types/message.h"#line 14typedef nx_struct message_t { nx_uint8_t header[sizeof(message_header_t )]; nx_uint8_t data[28]; nx_uint8_t footer[sizeof(message_footer_t )]; nx_uint8_t metadata[sizeof(message_metadata_t )];} __attribute__((packed)) message_t;# 39 "/opt/tinyos-2.x/tos/chips/atm128/crc.h"uint16_t crcTable[256] __attribute((__progmem__)) = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 };static uint16_t crcByte(uint16_t oldCrc, uint8_t byte) __attribute((noinline)) ;# 32 "/opt/tinyos-2.x/tos/chips/atm128/Atm128Uart.h"typedef uint8_t Atm128_UDR0_t;typedef uint8_t Atm128_UDR1_t;#line 48#line 36typedef union __nesc_unnamed4317 { struct Atm128_UCSRA_t { uint8_t mpcm : 1; uint8_t u2x : 1; uint8_t upe : 1; uint8_t dor : 1; uint8_t fe : 1; uint8_t udre : 1; uint8_t txc : 1; uint8_t rxc : 1; } bits; uint8_t flat;} Atm128UartStatus_t;typedef Atm128UartStatus_t Atm128_UCSR0A_t;typedef Atm128UartStatus_t Atm128_UCSR1A_t;#line 66#line 54typedef union __nesc_unnamed4318 { struct Atm128_UCSRB_t { uint8_t txb8 : 1; uint8_t rxb8 : 1; uint8_t ucsz2 : 1; uint8_t txen : 1; uint8_t rxen : 1; uint8_t udrie : 1; uint8_t txcie : 1; uint8_t rxcie : 1; } bits; uint8_t flat;} Atm128UartControl_t;typedef Atm128UartControl_t Atm128_UCSR0B_t;typedef Atm128UartControl_t Atm128_UCSR1B_t;enum __nesc_unnamed4319 { ATM128_UART_DATA_SIZE_5_BITS = 0, ATM128_UART_DATA_SIZE_6_BITS = 1, ATM128_UART_DATA_SIZE_7_BITS = 2, ATM128_UART_DATA_SIZE_8_BITS = 3};#line 89#line 79typedef union __nesc_unnamed4320 { uint8_t flat; struct Atm128_UCSRC_t { uint8_t ucpol : 1; uint8_t ucsz : 2; uint8_t usbs : 1; uint8_t upm : 2; uint8_t umsel : 1; uint8_t rsvd : 1; } bits;} Atm128UartMode_t;typedef Atm128UartMode_t Atm128_UCSR0C_t;typedef Atm128UartMode_t Atm128_UCSR1C_t;enum __nesc_unnamed4321 { ATM128_19200_BAUD_4MHZ = 12, ATM128_38400_BAUD_4MHZ = 6, ATM128_57600_BAUD_4MHZ = 3, ATM128_19200_BAUD_4MHZ_2X = 25, ATM128_38400_BAUD_4MHZ_2X = 12, ATM128_57600_BAUD_4MHZ_2X = 8, ATM128_19200_BAUD_7MHZ = 23, ATM128_38400_BAUD_7MHZ = 11, ATM128_57600_BAUD_7MHZ = 7, ATM128_19200_BAUD_7MHZ_2X = 47, ATM128_38400_BAUD_7MHZ_2X = 23, ATM128_57600_BAUD_7MHZ_2X = 15, ATM128_19200_BAUD_8MHZ = 25, ATM128_38400_BAUD_8MHZ = 12, ATM128_57600_BAUD_8MHZ = 8, ATM128_19200_BAUD_8MHZ_2X = 51, ATM128_38400_BAUD_8MHZ_2X = 34, ATM128_57600_BAUD_8MHZ_2X = 11};typedef uint8_t Atm128_UBRR0L_t;typedef uint8_t Atm128_UBRR0H_t;typedef uint8_t Atm128_UBRR1L_t;typedef uint8_t Atm128_UBRR1H_t;typedef uint16_t T6004C$CO2Reader$val_t;typedef TMilli T6004C$Timer$precision_tag;enum HilTimerMilliC$__nesc_unnamed4322 { HilTimerMilliC$TIMER_COUNT = 1U};typedef TMilli /*AlarmCounterMilliP.Atm128AlarmAsyncC*/Atm128AlarmAsyncC$0$precision;typedef /*AlarmCounterMilliP.Atm128AlarmAsyncC*/Atm128AlarmAsyncC$0$precision /*AlarmCounterMilliP.Atm128AlarmAsyncC.Atm1281AlarmAsyncP*/Atm1281AlarmAsyncP$0$precision;typedef /*AlarmCounterMilliP.Atm128AlarmAsyncC.Atm1281AlarmAsyncP*/Atm1281AlarmAsyncP$0$precision /*AlarmCounterMilliP.Atm128AlarmAsyncC.Atm1281AlarmAsyncP*/Atm1281AlarmAsyncP$0$Alarm$precision_tag;typedef uint32_t /*AlarmCounterMilliP.Atm128AlarmAsyncC.Atm1281AlarmAsyncP*/Atm1281AlarmAsyncP$0$Alarm$size_type;typedef /*AlarmCounterMilliP.Atm128AlarmAsyncC.Atm1281AlarmAsyncP*/Atm1281AlarmAsyncP$0$precision /*AlarmCounterMilliP.Atm128AlarmAsyncC.Atm1281AlarmAsyncP*/Atm1281AlarmAsyncP$0$Counter$precision_tag;typedef uint32_t /*AlarmCounterMilliP.Atm128AlarmAsyncC.Atm1281AlarmAsyncP*/Atm1281AlarmAsyncP$0$Counter$size_type;typedef uint8_t /*AlarmCounterMilliP.Atm128AlarmAsyncC.Atm1281AlarmAsyncP*/Atm1281AlarmAsyncP$0$Compare$size_type;typedef uint8_t /*AlarmCounterMilliP.Atm128AlarmAsyncC.Atm1281AlarmAsyncP*/Atm1281AlarmAsyncP$0$Timer$timer_size;typedef uint8_t HplAtm1281Timer2AsyncP$Compare$size_type;typedef uint8_t HplAtm1281Timer2AsyncP$Timer$timer_size;typedef TMilli /*HilTimerMilliC.AlarmToTimerC*/AlarmToTimerC$0$precision_tag;typedef /*HilTimerMilliC.AlarmToTimerC*/AlarmToTimerC$0$precision_tag /*HilTimerMilliC.AlarmToTimerC*/AlarmToTimerC$0$Alarm$precision_tag;typedef uint32_t /*HilTimerMilliC.AlarmToTimerC*/AlarmToTimerC$0$Alarm$size_type;typedef /*HilTimerMilliC.AlarmToTimerC*/AlarmToTimerC$0$precision_tag /*HilTimerMilliC.AlarmToTimerC*/AlarmToTimerC$0$Timer$precision_tag;typedef TMilli /*HilTimerMilliC.VirtualizeTimerC*/VirtualizeTimerC$0$precision_tag;typedef /*HilTimerMilliC.VirtualizeTimerC*/VirtualizeTimerC$0$precision_tag /*HilTimerMilliC.VirtualizeTimerC*/VirtualizeTimerC$0$TimerFrom$precision_tag;typedef /*HilTimerMilliC.VirtualizeTimerC*/VirtualizeTimerC$0$precision_tag /*HilTimerMilliC.VirtualizeTimerC*/VirtualizeTimerC$0$Timer$precision_tag;typedef TMilli /*HilTimerMilliC.CounterToLocalTimeC*/CounterToLocalTimeC$0$precision_tag;typedef /*HilTimerMilliC.CounterToLocalTimeC*/CounterToLocalTimeC$0$precision_tag /*HilTimerMilliC.CounterToLocalTimeC*/CounterToLocalTimeC$0$LocalTime$precision_tag;typedef /*HilTimerMilliC.CounterToLocalTimeC*/CounterToLocalTimeC$0$precision_tag /*HilTimerMilliC.CounterToLocalTimeC*/CounterToLocalTimeC$0$Counter$precision_tag;typedef uint32_t /*HilTimerMilliC.CounterToLocalTimeC*/CounterToLocalTimeC$0$Counter$size_type;typedef TMicro /*Atm128Uart1C.UartP*/Atm128UartP$0$Counter$precision_tag;typedef uint32_t /*Atm128Uart1C.UartP*/Atm128UartP$0$Counter$size_type;typedef uint16_t HplAtm1281Timer3P$CompareA$size_type;typedef uint16_t HplAtm1281Timer3P$Capture$size_type;typedef uint16_t HplAtm1281Timer3P$CompareB$size_type;typedef uint16_t HplAtm1281Timer3P$CompareC$size_type;typedef uint16_t HplAtm1281Timer3P$Timer$timer_size;typedef uint16_t /*InitThreeP.InitThree*/Atm128TimerInitC$0$timer_size;typedef /*InitThreeP.InitThree*/Atm128TimerInitC$0$timer_size /*InitThreeP.InitThree*/Atm128TimerInitC$0$Timer$timer_size;typedef TThree /*CounterThree16C.NCounter*/Atm128CounterC$0$frequency_tag;typedef uint16_t /*CounterThree16C.NCounter*/Atm128CounterC$0$timer_size;typedef /*CounterThree16C.NCounter*/Atm128CounterC$0$frequency_tag /*CounterThree16C.NCounter*/Atm128CounterC$0$Counter$precision_tag;typedef /*CounterThree16C.NCounter*/Atm128CounterC$0$timer_size /*CounterThree16C.NCounter*/Atm128CounterC$0$Counter$size_type;typedef /*CounterThree16C.NCounter*/Atm128CounterC$0$timer_size /*CounterThree16C.NCounter*/Atm128CounterC$0$Timer$timer_size;typedef TMicro /*CounterMicro32C.Transform32*/TransformCounterC$0$to_precision_tag;typedef uint32_t /*CounterMicro32C.Transform32*/TransformCounterC$0$to_size_type;typedef TThree /*CounterMicro32C.Transform32*/TransformCounterC$0$from_precision_tag;typedef uint16_t /*CounterMicro32C.Transform32*/TransformCounterC$0$from_size_type;typedef counter_three_overflow_t /*CounterMicro32C.Transform32*/TransformCounterC$0$upper_count_type;typedef /*CounterMicro32C.Transform32*/TransformCounterC$0$from_precision_tag /*CounterMicro32C.Transform32*/TransformCounterC$0$CounterFrom$precision_tag;typedef /*CounterMicro32C.Transform32*/TransformCounterC$0$from_size_type /*CounterMicro32C.Transform32*/TransformCounterC$0$CounterFrom$size_type;typedef /*CounterMicro32C.Transform32*/TransformCounterC$0$to_precision_tag /*CounterMicro32C.Transform32*/TransformCounterC$0$Counter$precision_tag;typedef /*CounterMicro32C.Transform32*/TransformCounterC$0$to_size_type /*CounterMicro32C.Transform32*/TransformCounterC$0$Counter$size_type;typedef uint16_t T6004ReaderP$T6004Reader$val_t;typedef TMicro /*Atm128Uart0C.UartP*/Atm128UartP$1$Counter$precision_tag;typedef uint32_t /*Atm128Uart0C.UartP*/Atm128UartP$1$Counter$size_type;# 51 "/opt/tinyos-2.x/tos/interfaces/Init.nc"static error_t PlatformP$Init$init(void );#line 51static error_t MotePlatformP$PlatformInit$init(void );# 31 "/opt/tinyos-2.x/tos/interfaces/GeneralIO.nc"static void /*HplAtm128GeneralIOC.PortA.Bit0*/HplAtm128GeneralIOPinP$0$IO$toggle(void );static void /*HplAtm128GeneralIOC.PortA.Bit0*/HplAtm128GeneralIOPinP$0$IO$makeOutput(void );#line 29static void /*HplAtm128GeneralIOC.PortA.Bit0*/HplAtm128GeneralIOPinP$0$IO$set(void );static void /*HplAtm128GeneralIOC.PortA.Bit1*/HplAtm128GeneralIOPinP$1$IO$toggle(void );static void /*HplAtm128GeneralIOC.PortA.Bit1*/HplAtm128GeneralIOPinP$1$IO$makeOutput(void );#line 29static void /*HplAtm128GeneralIOC.PortA.Bit1*/HplAtm128GeneralIOPinP$1$IO$set(void );static void /*HplAtm128GeneralIOC.PortA.Bit2*/HplAtm128GeneralIOPinP$2$IO$toggle(void );static void /*HplAtm128GeneralIOC.PortA.Bit2*/HplAtm128GeneralIOPinP$2$IO$makeOutput(void );#line 29static void /*HplAtm128GeneralIOC.PortA.Bit2*/HplAtm128GeneralIOPinP$2$IO$set(void );static void /*HplAtm128GeneralIOC.PortA.Bit4*/HplAtm128GeneralIOPinP$4$IO$makeInput(void );#line 30static void /*HplAtm128GeneralIOC.PortA.Bit4*/HplAtm128GeneralIOPinP$4$IO$clr(void );# 51 "/opt/tinyos-2.x/tos/interfaces/Init.nc"static error_t MeasureClockC$Init$init(void );# 60 "/opt/tinyos-2.x/tos/chips/atm128/timer/Atm128Calibrate.nc"static uint16_t MeasureClockC$Atm128Calibrate$baudrateRegister(uint32_t baudrate);# 56 "/opt/tinyos-2.x/tos/interfaces/TaskBasic.nc"static error_t SchedulerBasicP$TaskBasic$postTask(# 45 "/opt/tinyos-2.x/tos/system/SchedulerBasicP.nc"uint8_t arg_0x1031d70);# 64 "/opt/tinyos-2.x/tos/interfaces/TaskBasic.nc"static void SchedulerBasicP$TaskBasic$default$runTask(# 45 "/opt/tinyos-2.x/tos/system/SchedulerBasicP.nc"uint8_t arg_0x1031d70);# 46 "/opt/tinyos-2.x/tos/interfaces/Scheduler.nc"static void SchedulerBasicP$Scheduler$init(void );#line 61static void SchedulerBasicP$Scheduler$taskLoop(void );#line 54static bool SchedulerBasicP$Scheduler$runNextTask(void );# 59 "/opt/tinyos-2.x/tos/interfaces/McuSleep.nc"static void McuSleepC$McuSleep$sleep(void );# 44 "/opt/tinyos-2.x/tos/interfaces/McuPowerState.nc"static void McuSleepC$McuPowerState$update(void );# 51 "/opt/tinyos-2.x/tos/interfaces/Init.nc"static error_t LedsP$Init$init(void );# 56 "/opt/tinyos-2.x/tos/interfaces/Leds.nc"static void LedsP$Leds$led0Toggle(void );#line 72static void LedsP$Leds$led1Toggle(void );#line 89static void LedsP$Leds$led2Toggle(void );# 49 "/opt/tinyos-2.x/tos/interfaces/Boot.nc"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -