📄 app_sender.c
字号:
} /*HilTimerMilliC.VirtualizeTimerC*/VirtualizeTimerC__0__Timer_t;/*HilTimerMilliC.VirtualizeTimerC*/VirtualizeTimerC__0__Timer_t /*HilTimerMilliC.VirtualizeTimerC*/VirtualizeTimerC__0__m_timers[/*HilTimerMilliC.VirtualizeTimerC*/VirtualizeTimerC__0__NUM_TIMERS];static void /*HilTimerMilliC.VirtualizeTimerC*/VirtualizeTimerC__0__fireTimers(uint32_t now);static /*inline*/ void /*HilTimerMilliC.VirtualizeTimerC*/VirtualizeTimerC__0__updateFromTimer__runTask(void);static /*inline*/ void /*HilTimerMilliC.VirtualizeTimerC*/VirtualizeTimerC__0__TimerFrom__fired(void);static /*inline*/ void /*HilTimerMilliC.VirtualizeTimerC*/VirtualizeTimerC__0__startTimer(uint8_t num, uint32_t t0, uint32_t dt, bool isoneshot);static /*inline*/ void /*HilTimerMilliC.VirtualizeTimerC*/VirtualizeTimerC__0__Timer__startPeriodic(uint8_t num, uint32_t dt);static /*inline*/ void /*HilTimerMilliC.VirtualizeTimerC*/VirtualizeTimerC__0__Timer__default__fired(uint8_t num);static void SimpleMacM__SimpleMac__sendPacketDone(packet_t *arg_0x7ea21838, error_t arg_0x7ea219b8);static packet_t *SimpleMacM__SimpleMac__receivedPacket(packet_t *arg_0x7ea12010);static error_t SimpleMacM__HALCC2420Control__start(void);static error_t SimpleMacM__initTask__postTask(void);static error_t SimpleMacM__HALCC2420__rxDisable(void);static const mac_addr_t *SimpleMacM__HALCC2420__getAddress(void);static error_t SimpleMacM__HALCC2420__setChannel(uint8_t arg_0x7e7e3950);static error_t SimpleMacM__HALCC2420__sendPacket(uint8_t *arg_0x7e7b8550);static error_t SimpleMacM__signalSendPacketDone__postTask(void);enum SimpleMacM____nesc_unnamed4284 { SimpleMacM__initTask = 3U};typedef int SimpleMacM____nesc_sillytask_initTask[SimpleMacM__initTask];enum SimpleMacM____nesc_unnamed4285 { SimpleMacM__signalSendPacketDone = 4U};typedef int SimpleMacM____nesc_sillytask_signalSendPacketDone[SimpleMacM__signalSendPacketDone];packet_t SimpleMacM__receivedPacket;packet_t *SimpleMacM__receivedPacketPtr;const mac_addr_t *SimpleMacM__shortAddress;static /*inline*/ error_t SimpleMacM__Init__init(void);static /*inline*/ void SimpleMacM__initTask__runTask(void);static /*inline*/ error_t SimpleMacM__SimpleMacControl__start(void);uint8_t SimpleMacM__transmitbuffer[128];packet_t *SimpleMacM__sendPacketPtr;static /*inline*/ error_t SimpleMacM__SimpleMac__sendPacket(packet_t *packet);error_t SimpleMacM__sendPacketResult;static /*inline*/ void SimpleMacM__signalSendPacketDone__runTask(void);static /*inline*/ void SimpleMacM__HALCC2420__sendPacketDone(uint8_t *packet, error_t result);static /*inline*/ error_t SimpleMacM__SimpleMac__setChannel(uint8_t channel);static /*inline*/ error_t SimpleMacM__SimpleMac__rxDisable(void);static /*inline*/ uint8_t *SimpleMacM__HALCC2420__receivedPacket(uint8_t *packet);static error_t HalCC2430RadioP__receivedPacketTask__postTask(void);static error_t HalCC2430RadioP__sendPacketDoneTask__postTask(void);static error_t HalCC2430RadioP__InterruptRFErr__enableRisingEdge(void);static error_t HalCC2430RadioP__InterruptTXDone__enableRisingEdge(void);static error_t HalCC2430RadioP__initTask__postTask(void);static void HalCC2430RadioP__HALCC2420__sendPacketDone(uint8_t *arg_0x7e7b8bf0, error_t arg_0x7e7b8d70);static uint8_t *HalCC2430RadioP__HALCC2420__receivedPacket(uint8_t *arg_0x7e7e3350);static error_t HalCC2430RadioP__flushBufferTask__postTask(void);static int HalCC2430RadioP__StdOut__print(const char *arg_0x7e7b1678);static error_t HalCC2430RadioP__InterruptFIFOP__disable(void);static error_t HalCC2430RadioP__InterruptFIFOP__enableRisingEdge(void);static error_t HalCC2430RadioP__setChannelTask__postTask(void);static error_t HalCC2430RadioP__transmitTask__postTask(void);enum HalCC2430RadioP____nesc_unnamed4286 { HalCC2430RadioP__initTask = 5U};typedef int HalCC2430RadioP____nesc_sillytask_initTask[HalCC2430RadioP__initTask];enum HalCC2430RadioP____nesc_unnamed4287 { HalCC2430RadioP__transmitTask = 6U};typedef int HalCC2430RadioP____nesc_sillytask_transmitTask[HalCC2430RadioP__transmitTask];enum HalCC2430RadioP____nesc_unnamed4288 { HalCC2430RadioP__setChannelTask = 7U};typedef int HalCC2430RadioP____nesc_sillytask_setChannelTask[HalCC2430RadioP__setChannelTask];enum HalCC2430RadioP____nesc_unnamed4289 { HalCC2430RadioP__receivedPacketTask = 8U};typedef int HalCC2430RadioP____nesc_sillytask_receivedPacketTask[HalCC2430RadioP__receivedPacketTask];enum HalCC2430RadioP____nesc_unnamed4290 { HalCC2430RadioP__flushBufferTask = 9U};typedef int HalCC2430RadioP____nesc_sillytask_flushBufferTask[HalCC2430RadioP__flushBufferTask];enum HalCC2430RadioP____nesc_unnamed4291 { HalCC2430RadioP__sendPacketDoneTask = 10U};typedef int HalCC2430RadioP____nesc_sillytask_sendPacketDoneTask[HalCC2430RadioP__sendPacketDoneTask];typedef enum HalCC2430RadioP____nesc_unnamed4292 { HalCC2430RadioP__CC_REG_SNOP = 0x00, HalCC2430RadioP__CC_REG_SXOSCON = 0x01, HalCC2430RadioP__CC_REG_STXCAL = 0x02, HalCC2430RadioP__CC_REG_SRXON = 0x03, HalCC2430RadioP__CC_REG_STXON = 0x04, HalCC2430RadioP__CC_REG_STXONCCA = 0x05, HalCC2430RadioP__CC_REG_SRFOFF = 0x06, HalCC2430RadioP__CC_REG_SXOSCOFF = 0x07, HalCC2430RadioP__CC_REG_SFLUSHRX = 0x08, HalCC2430RadioP__CC_REG_SFLUSHTX = 0x09, HalCC2430RadioP__CC_REG_SACK = 0x0A, HalCC2430RadioP__CC_REG_SACKPEND = 0x0B, HalCC2430RadioP__CC_REG_SRXDEC = 0x0C, HalCC2430RadioP__CC_REG_STXENC = 0x0D, HalCC2430RadioP__CC_REG_SAES = 0x0E, HalCC2430RadioP__CC_REG_MAIN = 0x10, HalCC2430RadioP__CC_REG_MDMCTRL0 = 0x11, HalCC2430RadioP__CC_REG_MDMCTRL1 = 0x12, HalCC2430RadioP__CC_REG_RSSI = 0x13, HalCC2430RadioP__CC_REG_SYNCWORD = 0x14, HalCC2430RadioP__CC_REG_TXCTRL = 0x15, HalCC2430RadioP__CC_REG_RXCTRL0 = 0x16, HalCC2430RadioP__CC_REG_RXCTRL1 = 0x17, HalCC2430RadioP__CC_REG_FSCTRL = 0x18, HalCC2430RadioP__CC_REG_SECCTRL0 = 0x19, HalCC2430RadioP__CC_REG_SECCTRL1 = 0x1A, HalCC2430RadioP__CC_REG_BATTMON = 0x1B, HalCC2430RadioP__CC_REG_IOCFG0 = 0x1C, HalCC2430RadioP__CC_REG_IOCFG1 = 0x1D, HalCC2430RadioP__CC_REG_MANFIDL = 0x1E, HalCC2430RadioP__CC_REG_MANFIDH = 0x1F, HalCC2430RadioP__CC_REG_FSMTC = 0x20, HalCC2430RadioP__CC_REG_MANAND = 0x21, HalCC2430RadioP__CC_REG_MANOR = 0x22, HalCC2430RadioP__CC_REG_AGCCTRL = 0x23, HalCC2430RadioP__CC_REG_AGCTST0 = 0x24, HalCC2430RadioP__CC_REG_AGCTST1 = 0x25, HalCC2430RadioP__CC_REG_AGCTST2 = 0x26, HalCC2430RadioP__CC_REG_FSTST0 = 0x27, HalCC2430RadioP__CC_REG_FSTST1 = 0x28, HalCC2430RadioP__CC_REG_FSTST2 = 0x29, HalCC2430RadioP__CC_REG_FSTST3 = 0x2A, HalCC2430RadioP__CC_REG_RXBPFTST = 0x2B, HalCC2430RadioP__CC_REG_FSMSTATE = 0x2C, HalCC2430RadioP__CC_REG_ADCTST = 0x2D, HalCC2430RadioP__CC_REG_DACTST = 0x2E, HalCC2430RadioP__CC_REG_TOPTST = 0x2F, HalCC2430RadioP__CC_REG_RESERVED = 0x30, HalCC2430RadioP__CC_REG_TXFIFO = 0x3E, HalCC2430RadioP__CC_REG_RXFIFO = 0x3F} HalCC2430RadioP__cc2420_reg_t;typedef enum HalCC2430RadioP____nesc_unnamed4293 { HalCC2430RadioP__CC_ADDR_TXFIFO = 0x000, HalCC2430RadioP__CC_ADDR_RXFIFO = 0x080, HalCC2430RadioP__CC_ADDR_KEY0 = 0x100, HalCC2430RadioP__CC_ADDR_RXNONCE = 0x110, HalCC2430RadioP__CC_ADDR_SABUF = 0x120, HalCC2430RadioP__CC_ADDR_KEY1 = 0x130, HalCC2430RadioP__CC_ADDR_TXNONCE = 0x140, HalCC2430RadioP__CC_ADDR_CBCSTATE = 0x150, HalCC2430RadioP__CC_ADDR_IEEEADDR = 0x160, HalCC2430RadioP__CC_ADDR_PANID = 0x168, HalCC2430RadioP__CC_ADDR_SHORTADDR = 0x16A} HalCC2430RadioP__cc2420_addr_t;typedef enum HalCC2430RadioP____nesc_unnamed4294 { HalCC2430RadioP__CCA_HYST_0DB = 0x00, HalCC2430RadioP__CCA_HYST_1DB = 0x01, HalCC2430RadioP__CCA_HYST_2DB = 0x02, HalCC2430RadioP__CCA_HYST_3DB = 0x03, HalCC2430RadioP__CCA_HYST_4DB = 0x04, HalCC2430RadioP__CCA_HYST_5DB = 0x05, HalCC2430RadioP__CCA_HYST_6DB = 0x06, HalCC2430RadioP__CCA_HYST_7DB = 0x07} HalCC2430RadioP__cca_hyst_db_t;typedef enum HalCC2430RadioP____nesc_unnamed4295 { HalCC2430RadioP__LEADING_ZERO_BYTES_1 = 0x00, HalCC2430RadioP__LEADING_ZERO_BYTES_2 = 0x01, HalCC2430RadioP__LEADING_ZERO_BYTES_3 = 0x02, HalCC2430RadioP__LEADING_ZERO_BYTES_4 = 0x03, HalCC2430RadioP__LEADING_ZERO_BYTES_5 = 0x04, HalCC2430RadioP__LEADING_ZERO_BYTES_6 = 0x05, HalCC2430RadioP__LEADING_ZERO_BYTES_7 = 0x06, HalCC2430RadioP__LEADING_ZERO_BYTES_8 = 0x07, HalCC2430RadioP__LEADING_ZERO_BYTES_9 = 0x08, HalCC2430RadioP__LEADING_ZERO_BYTES_10 = 0x09, HalCC2430RadioP__LEADING_ZERO_BYTES_11 = 0x0A, HalCC2430RadioP__LEADING_ZERO_BYTES_12 = 0x0B, HalCC2430RadioP__LEADING_ZERO_BYTES_13 = 0x0C, HalCC2430RadioP__LEADING_ZERO_BYTES_14 = 0x0D, HalCC2430RadioP__LEADING_ZERO_BYTES_15 = 0x0E, HalCC2430RadioP__LEADING_ZERO_BYTES_16 = 0x0F} HalCC2430RadioP__preamble_length_t;typedef struct HalCC2430RadioP____nesc_unnamed4296 { HalCC2430RadioP__preamble_length_t preamble_length : 4; bool autoack : 1; bool autocrc : 1; uint8_t cca_mode : 2; HalCC2430RadioP__cca_hyst_db_t cca_hyst : 3; bool adr_decode : 1; bool pan_coordinator : 1; bool reserved_frame_mode : 1; uint8_t reserved : 2;} HalCC2430RadioP__MDMCTRL0_t;sfr HalCC2430RadioP__RFIF = 0xE9;static /*inline*/ void HalCC2430RadioP__CC2430SetPanid(uint16_t id);static /*inline*/ void HalCC2430RadioP__CC2430SetShortaddr(uint16_t shortAddr);static /*inline*/ void HalCC2430RadioP__CC2420SetIEEEAddr(ieee_mac_addr_t extAddress);static /*inline*/ void HalCC2430RadioP__CC2430Reset(void);static /*inline*/ void HalCC2430RadioP__CC2430RFEnable(void);static /*inline*/ void HalCC2430RadioP__CC2430ExternalOscillator(void);static void HalCC2430RadioP__CC2430RxEnable(void);static /*inline*/ void HalCC2430RadioP__CC2430RxDisable(void);static void HalCC2430RadioP__CC2430ChannelSet(uint8_t channel);static /*inline*/ void HalCC2430RadioP__CC2430PALevelSet(uint8_t new_power);static /*inline*/ void HalCC2430RadioP__CC2430ControlSet(void);static /*inline*/ void HalCC2430RadioP__CC2430TxWait(void);static void HalCC2430RadioP__wait(uint16_t u);ieee_mac_addr_t HalCC2430RadioP__ieeeAddress;mac_addr_t HalCC2430RadioP__shortAddress;mac_addr_t HalCC2430RadioP__panid;bool HalCC2430RadioP__rxEnabled = FALSE;uint8_t HalCC2430RadioP__receivedPacket[128];uint8_t *HalCC2430RadioP__receivedPacketPtr;static /*inline*/ error_t HalCC2430RadioP__Init__init(void);static /*inline*/ void HalCC2430RadioP__initTask__runTask(void);static /*inline*/ error_t HalCC2430RadioP__HALCC2420Control__start(void);uint8_t *HalCC2430RadioP__transmitPacketPtr;bool HalCC2430RadioP__transmitInProgress = FALSE;static /*inline*/ error_t HalCC2430RadioP__HALCC2420__sendPacket(uint8_t *packet);static /*inline*/ void HalCC2430RadioP__transmitTask__runTask(void);uint8_t HalCC2430RadioP__currentChannel;static /*inline*/ error_t HalCC2430RadioP__HALCC2420__setChannel(uint8_t channel);static /*inline*/ void HalCC2430RadioP__setChannelTask__runTask(void);static /*inline*/ error_t HalCC2430RadioP__HALCC2420__rxDisable(void);static /*inline*/ const mac_addr_t *HalCC2430RadioP__HALCC2420__getAddress(void);static /*inline*/ void HalCC2430RadioP__CC2430SetPanid(uint16_t id);static /*inline*/ void HalCC2430RadioP__CC2430SetShortaddr(uint16_t shortAddr);static /*inline*/ void HalCC2430RadioP__CC2420SetIEEEAddr(ieee_mac_addr_t extAddress);bool HalCC2430RadioP__receivedPacketTaskPosted = FALSE;bool HalCC2430RadioP__flushBufferTaskPosted = FALSE;static /*inline*/ void HalCC2430RadioP__InterruptTXDone__fired(void);static /*inline*/ void HalCC2430RadioP__sendPacketDoneTask__runTask(void);static /*inline*/ void HalCC2430RadioP__InterruptFIFOP__fired(void);uint8_t HalCC2430RadioP__frameLength = 0;uint8_t HalCC2430RadioP__receivedPacketTaskRetries = 0;static /*inline*/ void HalCC2430RadioP__receivedPacketTask__runTask(void);static /*inline*/ void HalCC2430RadioP__InterruptRFErr__fired(void);static /*inline*/ void HalCC2430RadioP__flushBufferTask__runTask(void);static /*inline*/ void HalCC2430RadioP__CC2430Reset(void);static /*inline*/ void HalCC2430RadioP__CC2430RFEnable(void);static /*inline*/ void HalCC2430RadioP__CC2430ExternalOscillator(void);static void HalCC2430RadioP__CC2430RxEnable(void);static /*inline*/ void HalCC2430RadioP__CC2430RxDisable(void);static void HalCC2430RadioP__CC2430ChannelSet(uint8_t channel);static /*inline*/ void HalCC2430RadioP__CC2430PALevelSet(uint8_t new_power);static /*inline*/ void HalCC2430RadioP__CC2430ControlSet(void);static /*inline*/ void HalCC2430RadioP__CC2430TxWait(void);static /*inline*/ void HalCC2430RadioP__wait(uint16_t u);static /*inline*/ void HalCC2430RadioP__StdOut__get(uint8_t _data);static void HplCC2430InterruptsC__CaptureSFD__captured(uint16_t arg_0x7e6b67e8);static void HplCC2430InterruptsC__InterruptRFErr__fired(void);static void HplCC2430InterruptsC__InterruptTXDone__fired(void);static void HplCC2430InterruptsC__InterruptCCA__fired(void);static void HplCC2430InterruptsC__InterruptFIFOP__fired(void);static /*inline*/ error_t HplCC2430InterruptsC__InterruptFIFOP__enableRisingEdge(void);static error_t HplCC2430InterruptsC__InterruptFIFOP__disable(void);static /*inline*/ error_t HplCC2430InterruptsC__InterruptTXDone__enableRisingEdge(void);static /*inline*/ error_t HplCC2430InterruptsC__InterruptRFErr__enableRisingEdge(void);/*void __vector_0(void) __attribute((interrupt)) ;*//*void __vector_16(void) __attribute((interrupt)) ;*/static /*inline*/ void HplCC2430InterruptsC__CaptureSFD__default__captured(uint16_t time);static /*inline*/ void HplCC2430InterruptsC__InterruptCCA__default__fired(void);static error_t StdOutM__UART__put(uint8_t arg_0x7e682e48);static void StdOutM__StdOut__get(uint8_t arg_0x7e7a4a48);char StdOutM__buffer[1000];char *StdOutM__bufferhead;char *StdOutM__buffertail;char *StdOutM__bufferend;int StdOutM__isOutputting;int StdOutM__count;static /*inline*/ error_t StdOutM__Init__init(void);static int StdOutM__StdOut__print(const char *str);s
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -