📄 mac_backoff_timer.lst
字号:
##############################################################################
# #
# IAR 8051 C/C++ Compiler V7.20H/W32 08/Mar/2009 09:09:40 #
# Copyright 2004-2006 IAR Systems. All rights reserved. #
# #
# Core = plain #
# Code model = banked #
# Data model = large #
# Calling convention = xdata reentrant #
# Constant location = data #
# Dptr setup = 1,16 #
# Source file = C:\Texas Instruments\ZStack-1.4.2-1.1.0\Component #
# s\mac\low_level\srf03\mac_backoff_timer.c #
# Command line = -f "C:\Texas Instruments\ZStack-1.4.2-1.1.0\Proje #
# cts\zstack\Samples\SimpleApp\CC2430DB\..\..\..\To #
# ols\CC2430DB\f8wCoord.cfg" (-DCPU32MHZ #
# -DFORCE_MAC_NEAR -DROOT=__near_func #
# -DMAC_CFG_APP_PENDING_QUEUE=TRUE #
# -DZDO_COORDINATOR -DRTR_NWK -DBLINK_LEDS #
# "-DCONST=const __code" -DGENERIC=__generic) -f #
# "C:\Texas Instruments\ZStack-1.4.2-1.1.0\Projects #
# \zstack\Samples\SimpleApp\CC2430DB\..\..\..\Tools #
# \CC2430DB\f8wConfig.cfg" (-DSECURE=0 #
# -DDEFAULT_CHANLIST=0x00000800 #
# -DZDAPP_CONFIG_PAN_ID=0xFFFF #
# -DNWK_START_DELAY=100 -DEXTENDED_JOINING_RANDOM_M #
# ASK=0x007F -DBEACON_REQUEST_DELAY=100 #
# -DBEACON_REQ_DELAY_MASK=0x00FF #
# -DROUTE_EXPIRY_TIME=30 -DAPSC_ACK_WAIT_DURATION_P #
# OLLED=3000 -DNWK_INDIRECT_MSG_TIMEOUT=7 #
# -DMAX_RREQ_ENTRIES=10 -DAPSC_MAX_FRAME_RETRIES=3 #
# -DNWK_MAX_DATA_RETRIES=2 #
# -DMAX_POLL_FAILURE_RETRIES=2 -DMAX_BCAST=9 #
# -DAPS_MAX_GROUPS=16 -DMAX_RTG_ENTRIES=20 #
# -DNWK_MAX_BINDING_ENTRIES=10 #
# -DMAX_BINDING_CLUSTER_IDS=5 #
# "-DDEFAULT_KEY={0x01, 0x03, 0x05, 0x07, 0x09, #
# 0x0B, 0x0D, 0x0F, 0x00, 0x02, 0x04, 0x06, 0x08, #
# 0x0A, 0x0C, 0x0D}" -DRFD_RCVC_ALWAYS_ON=FALSE #
# -DPOLL_RATE=1000 -DQUEUED_POLL_RATE=100 #
# -DRESPONSE_POLL_RATE=100 -DREJOIN_POLL_RATE=440 #
# -DTOP_BOOT_PAGES=0) -I "C:\Program Files\IAR #
# Systems\Embedded Workbench 4.05 Evaluation #
# version\8051\inc\" -I "C:\Program Files\IAR #
# Systems\Embedded Workbench 4.05 Evaluation #
# version\8051\inc\clib\" -I "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\" -I "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\..\Source\" -I #
# "C:\Texas Instruments\ZStack-1.4.2-1.1.0\Projects #
# \zstack\Samples\SimpleApp\CC2430DB\..\..\..\ZMain #
# \TI2430DB\" -I "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\..\..\..\..\..\Component #
# s\mt\" -I "C:\Texas Instruments\ZStack-1.4.2-1.1. #
# 0\Projects\zstack\Samples\SimpleApp\CC2430DB\..\. #
# .\..\..\..\Components\hal\include\" -I "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\..\..\..\..\..\Component #
# s\hal\target\CC2430DB\" -I "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\..\..\..\..\..\Component #
# s\mac\include\" -I "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\..\..\..\..\..\Component #
# s\mac\high_level\" -I "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\..\..\..\..\..\Component #
# s\mac\low_level\srf03\" -I "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\..\..\..\..\..\Component #
# s\mac\low_level\srf03\single_chip\" -I "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\..\..\..\..\..\Component #
# s\osal\mcu\ccsoc\" -I "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\..\..\..\..\..\Component #
# s\osal\include\" -I "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\..\..\..\..\..\Component #
# s\services\saddr\" -I "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\..\..\..\..\..\Component #
# s\services\sdata\" -I "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\..\..\..\..\..\Component #
# s\stack\af\" -I "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\..\..\..\..\..\Component #
# s\stack\nwk\" -I "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\..\..\..\..\..\Component #
# s\stack\sapi\" -I "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\..\..\..\..\..\Component #
# s\stack\sec\" -I "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\..\..\..\..\..\Component #
# s\stack\sys\" -I "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\..\..\..\..\..\Component #
# s\stack\zdo\" -I "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\..\..\..\..\..\Component #
# s\zmac\f8w\" -I "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\..\..\..\..\..\Component #
# s\zmac\" -D CC2430DB -D HOLD_AUTO_START -D #
# SOFT_START -D REFLECTOR -D NV_INIT -D #
# xNV_RESTORE -D xZTOOL_P2 -D xMT_TASK -D #
# xMT_SAPI_FUNC -D xMT_SAPI_CB_FUNC -lC "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\SimpleControllerDB\List\ #
# " -lA "C:\Texas Instruments\ZStack-1.4.2-1.1.0\Pr #
# ojects\zstack\Samples\SimpleApp\CC2430DB\SimpleCo #
# ntrollerDB\List\" --diag_suppress Pe001,Pa010 #
# --diag_remark pe550 -o "C:\Texas #
# Instruments\ZStack-1.4.2-1.1.0\Projects\zstack\Sa #
# mples\SimpleApp\CC2430DB\SimpleControllerDB\Obj\" #
# -e --require_prototypes -z9 --no_code_motion #
# --debug --core=plain --dptr=16,1 #
# --data_model=large --code_model=banked #
# --calling_convention=xdata_reentrant #
# --place_constants=data --nr_virtual_regs 8 #
# "C:\Texas Instruments\ZStack-1.4.2-1.1.0\Componen #
# ts\mac\low_level\srf03\mac_backoff_timer.c" #
# List file = C:\Texas Instruments\ZStack-1.4.2-1.1.0\Projects\ #
# zstack\Samples\SimpleApp\CC2430DB\SimpleControlle #
# rDB\List\mac_backoff_timer.lst #
# Object file = C:\Texas Instruments\ZStack-1.4.2-1.1.0\Projects\ #
# zstack\Samples\SimpleApp\CC2430DB\SimpleControlle #
# rDB\Obj\mac_backoff_timer.r51 #
# #
# #
##############################################################################
C:\Texas Instruments\ZStack-1.4.2-1.1.0\Components\mac\low_level\srf03\mac_backoff_timer.c
1 /**************************************************************************************************
2 Filename:
3 Revised: $Date: 2007-03-26 16:18:09 -0700 (Mon, 26 Mar 2007) $
4 Revision: $Revision: 13860 $
5
6 Description:
7
8 Describe the purpose and contents of the file.
9
10 Copyright (c) 2006 by Texas Instruments, Inc.
11 All Rights Reserved. Permission to use, reproduce, copy, prepare
12 derivative works, modify, distribute, perform, display or sell this
13 software and/or its documentation for any purpose is prohibited
14 without the express written consent of Texas Instruments, Inc.
15 **************************************************************************************************/
16
17
18
19 /* ------------------------------------------------------------------------------------------------
20 * Includes
21 * ------------------------------------------------------------------------------------------------
22 */
23
24 /* hal */
25 #include "hal_types.h"
26 #include "hal_mcu.h"
\ In segment SFR_AN, at 0xa6
\ unsigned char volatile __sfr T2TLD
\ T2TLD:
\ 000000 DS 1
\ In segment SFR_AN, at 0xa7
\ unsigned char volatile __sfr T2THD
\ T2THD:
\ 000000 DS 1
\ In segment SFR_AN, at 0xc3
\ unsigned char volatile __sfr T2CNF
\ T2CNF:
\ 000000 DS 1
27
28 /* high-level specific */
29 #include "mac_spec.h"
30
31 /* exported low-level */
32 #include "mac_low_level.h"
33
34 /* low-level specific */
35 #include "mac_backoff_timer.h"
36 #include "mac_tx.h"
37
38 /* target specific */
39 #include "mac_radio_defs.h"
40
41 /* debug */
42 #include "mac_assert.h"
43
44
45 /* ------------------------------------------------------------------------------------------------
46 * Defines
47 * ------------------------------------------------------------------------------------------------
48 */
49 #define COMPARE_STATE_ROLLOVER_BV BV(0)
50 #define COMPARE_STATE_TRIGGER_BV BV(1)
51 #define COMPARE_STATE_ARM_BV BV(2)
52
53 #define COMPARE_STATE_TRIGGER COMPARE_STATE_TRIGGER_BV
54 #define COMPARE_STATE_ROLLOVER COMPARE_STATE_ROLLOVER_BV
55 #define COMPARE_STATE_ROLLOVER_AND_TRIGGER (COMPARE_STATE_ROLLOVER_BV | COMPARE_STATE_TRIGGER_BV)
56 #define COMPARE_STATE_ROLLOVER_AND_ARM_TRIGGER (COMPARE_STATE_ROLLOVER_BV | COMPARE_STATE_ARM_BV)
57
58
59 /*
60 * The datasheet mentions a small delay on both receive and transmit side of approximately
61 * two microseconds. The precise characterization is given below.
62 * (This data is not given in rev 1.03 datasheet)
63 */
64 #define RX_TX_PROP_DELAY_AVG_USEC ((MAC_RADIO_RX_TX_PROP_DELAY_MIN_USEC + MAC_RADIO_RX_TX_PROP_DELAY_MAX_USEC) / 2)
65 #define RX_TX_PROP_DELAY_AVG_TIMER_TICKS ((uint16)(MAC_RADIO_TIMER_TICKS_PER_USEC() * RX_TX_PROP_DELAY_AVG_USEC + 0.5))
66
67 /*
68 * For slotted receives, the SFD signal is expected to occur on a specifc symbol boundary.
69 * This does *not* correspond to the backoff boundary. The SFD signal occurs at an
70 * offset from the backoff boundary. This is done for efficiency of related algorithms.
71 *
72 * Once transmit is strobed there is a fixed delay until the SFD signal occurs. The frame
73 * does not start over-the-air transmit until after an internal radio delay of 12 symbols.
74 * Once transmitting over-the-air, the preamble is sent (8 symbols) followed by the
75 * SFD field (2 symbols). After the SFD field completes, the SFD signal occurs. This
76 * adds up to a total of 22 symbols from strobe to SFD signal.
77 *
78 * Since 22 symbols spans more than a backoff (20 symbols) the modulus operation is used
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -