📄 zmac.lst
字号:
\ 000026 90.... MOV DPTR,#(osal_int_disable & 0xffff)
\ 000029 74.. MOV A,#((osal_int_disable >> 16) & 0xff)
\ 00002B 12.... LCALL ?BCALL ; Banked call to: DPTR()
99
100 return ( stat );
\ 00002E EE MOV A,R6
\ 00002F F9 MOV R1,A
\ 000030 80.. SJMP ??Subroutine6_0
101 }
\ In segment NEAR_CODE, align 1, keep-with-next
\ ?Subroutine6:
\ 000000 7401 MOV A,#0x1
\ 000002 12.... LCALL ?DEALLOC_XSTACK8
\ ??Subroutine6_0:
\ 000005 7F01 MOV R7,#0x1
\ 000007 02.... LJMP ?FUNC_LEAVE_XDATA
102
103 /********************************************************************************************************
104 * @fn ZMacUpdate
105 *
106 * @brief Gives MAC (or others) some processing time.
107 *
108 * @param none.
109 *
110 * @return true if CPU needs to keep running (not sleep).
111 ********************************************************************************************************/
\ In segment NEAR_CODE, align 1, keep-with-next
112 ROOT byte ZMacUpdate( void )
\ ZMacUpdate:
113 {
\ 000000 ; Saved register size: 0
\ 000000 ; Auto size: 0
114 /* Put code here that needs to run each OSAL event loop */
115 return ( false );
\ 000000 7900 MOV R1,#0x0
\ 000002 22 RET
116 }
117
118 /********************************************************************************************************
119 * @fn ZMacReset
120 *
121 * @brief Reset the MAC.
122 *
123 * @param Default to PIB defaults.
124 *
125 * @return status.
126 ********************************************************************************************************/
\ In segment NEAR_CODE, align 1, keep-with-next
127 ROOT uint8 ZMacReset( bool SetDefaultPIB )
\ ZMacReset:
128 {
\ 000000 74F8 MOV A,#-0x8
\ 000002 12.... LCALL ?FUNC_ENTER_XDATA
\ 000005 ; Saved register size: 8
\ 000005 ; Auto size: 1
\ 000005 74FF MOV A,#-0x1
\ 000007 12.... LCALL ?ALLOC_XSTACK8
129 byte stat;
130 byte value;
131
132 stat = MAC_MlmeResetReq( SetDefaultPIB );
\ 00000A ; Setup parameters for call to function MAC_MlmeResetReq
\ 00000A 90.... MOV DPTR,#(MAC_MlmeResetReq & 0xffff)
\ 00000D 74.. MOV A,#((MAC_MlmeResetReq >> 16) & 0xff)
\ 00000F 12.... LCALL ?BCALL ; Banked call to: DPTR()
\ 000012 E9 MOV A,R1
\ 000013 FE MOV R6,A
133
134 // Don't send PAN ID conflict
135 value = FALSE;
\ 000014 E4 CLR A
\ 000015 85..82 MOV DPL,?XSP + 0
\ 000018 85..83 MOV DPH,?XSP + 1
\ 00001B F0 MOVX @DPTR,A
136 MAC_MlmeSetReq( MAC_ASSOCIATED_PAN_COORD, &value );
\ 00001C ; Setup parameters for call to function MAC_MlmeSetReq
\ 00001C AA82 MOV R2,DPL
\ 00001E AB83 MOV R3,DPH
\ 000020 7956 MOV R1,#0x56
\ 000022 90.... MOV DPTR,#(MAC_MlmeSetReq & 0xffff)
\ 000025 74.. MOV A,#((MAC_MlmeSetReq >> 16) & 0xff)
\ 000027 12.... LCALL ?BCALL ; Banked call to: DPTR()
137 MAC_MlmeSetReq( MAC_EXTENDED_ADDRESS, &aExtendedAddress );
\ 00002A ; Setup parameters for call to function MAC_MlmeSetReq
\ 00002A 7A.. MOV R2,#(aExtendedAddress & 0xff)
\ 00002C 7B.. MOV R3,#((aExtendedAddress >> 8) & 0xff)
\ 00002E 79E2 MOV R1,#-0x1e
\ 000030 74.. MOV A,#((MAC_MlmeSetReq >> 16) & 0xff)
\ 000032 12.... LCALL ?BCALL ; Banked call to: DPTR()
138
139 if (ZMac_ScanBuf)
\ 000035 90.... MOV DPTR,#ZMac_ScanBuf
\ 000038 E0 MOVX A,@DPTR
\ 000039 7002 JNZ ??ZMacReset_0
\ 00003B A3 INC DPTR
\ 00003C E0 MOVX A,@DPTR
\ ??ZMacReset_0:
\ 00003D 6017 JZ ??ZMacReset_1
140 {
141 osal_mem_free(ZMac_ScanBuf);
\ 00003F ; Setup parameters for call to function osal_mem_free
\ 00003F 90.... MOV DPTR,#ZMac_ScanBuf
\ 000042 E0 MOVX A,@DPTR
\ 000043 FA MOV R2,A
\ 000044 A3 INC DPTR
\ 000045 E0 MOVX A,@DPTR
\ 000046 FB MOV R3,A
\ 000047 90.... MOV DPTR,#(osal_mem_free & 0xffff)
\ 00004A 74.. MOV A,#((osal_mem_free >> 16) & 0xff)
\ 00004C 12.... LCALL ?BCALL ; Banked call to: DPTR()
142 ZMac_ScanBuf = NULL;
\ 00004F 90.... MOV DPTR,#ZMac_ScanBuf
\ 000052 E4 CLR A
\ 000053 F0 MOVX @DPTR,A
\ 000054 A3 INC DPTR
\ 000055 F0 MOVX @DPTR,A
143 }
144
145 return ( stat );
\ ??ZMacReset_1:
\ 000056 EE MOV A,R6
\ 000057 F9 MOV R1,A
\ 000058 80.. SJMP ?Subroutine6
146 }
147
148
149 /********************************************************************************************************
150 * @fn ZMacGetReq
151 *
152 * @brief Read a MAC PIB attribute.
153 *
154 * @param attr - PIB attribute to get
155 * @param value - pointer to the buffer to store the attribute
156 *
157 * @return status
158 ********************************************************************************************************/
\ In segment NEAR_CODE, align 1, keep-with-next
159 ROOT uint8 ZMacGetReq( uint8 attr, uint8 *value )
\ ZMacGetReq:
160 {
\ 000000 C082 PUSH DPL
\ 000002 C083 PUSH DPH
\ 000004 ; Saved register size: 2
\ 000004 ; Auto size: 0
161 if ( attr == ZMacExtAddr )
\ 000004 74E2 MOV A,#-0x1e
\ 000006 69 XRL A,R1
\ 000007 7010 JNZ ??ZMacGetReq_0
162 {
163 osal_cpyExtAddr( value, &aExtendedAddress );
\ 000009 ; Setup parameters for call to function osal_cpyExtAddr
\ 000009 7C.. MOV R4,#(aExtendedAddress & 0xff)
\ 00000B 7D.. MOV R5,#((aExtendedAddress >> 8) & 0xff)
\ 00000D 90.... MOV DPTR,#(osal_cpyExtAddr & 0xffff)
\ 000010 74.. MOV A,#((osal_cpyExtAddr >> 16) & 0xff)
\ 000012 12.... LCALL ?BCALL ; Banked call to: DPTR()
164 return ZMacSuccess;
\ 000015 7900 MOV R1,#0x0
\ 000017 8008 SJMP ??ZMacGetReq_1
165 }
166
167 return (ZMacStatus_t) MAC_MlmeGetReq( attr, value );
\ ??ZMacGetReq_0:
\ 000019 ; Setup parameters for call to function MAC_MlmeGetReq
\ 000019 90.... MOV DPTR,#(MAC_MlmeGetReq & 0xffff)
\ 00001C 74.. MOV A,#((MAC_MlmeGetReq >> 16) & 0xff)
\ 00001E 12.... LCALL ?BCALL ; Banked call to: DPTR()
\ ??ZMacGetReq_1:
\ 000021 02.... LJMP ??Subroutine7_0
168 }
\ In segment NEAR_CODE, align 1, keep-with-next
\ ?Subroutine7:
\ 000000 12.... LCALL ?BCALL ; Banked call to: DPTR()
\ 000003 7900 MOV R1,#0x0
\ ??Subroutine7_0:
\ 000005 D083 POP DPH
\ 000007 D082 POP DPL
\ 000009 22 RET
169
170
171 /********************************************************************************************************
172 * @fn ZMacSetReq
173 *
174 * @brief Write a MAC PIB attribute.
175 *
176 * @param attr - PIB attribute to Set
177 * @param value - pointer to the data
178 *
179 * @return status
180 ********************************************************************************************************/
\ In segment NEAR_CODE, align 1, keep-with-next
181 ROOT uint8 ZMacSetReq( uint8 attr, byte *value )
\ ZMacSetReq:
182 {
\ 000000 74F8 MOV A,#-0x8
\ 000002 12.... LCALL ?FUNC_ENTER_XDATA
\ 000005 ; Saved register size: 8
\ 000005 ; Auto size: 0
\ 000005 89.. MOV ?V0 + 0,R1
\ 000007 EA MOV A,R2
\ 000008 FE MOV R6,A
\ 000009 EB MOV A,R3
\ 00000A FF MOV R7,A
183 if ( attr == ZMacExtAddr )
\ 00000B 74E2 MOV A,#-0x1e
\ 00000D 65.. XRL A,?V0 + 0
\ 00000F 7010 JNZ ??ZMacSetReq_0
184 {
185 osal_cpyExtAddr( &aExtendedAddress, value );
\ 000011 ; Setup parameters for call to function osal_cpyExtAddr
\ 000011 EE MOV A,R6
\ 000012 FC MOV R4,A
\ 000013 EF MOV A,R7
\ 000014 FD MOV R5,A
\ 000015 7A.. MOV R2,#(aExtendedAddress & 0xff)
\ 000017 7B.. MOV R3,#((aExtendedAddress >> 8) & 0xff)
\ 000019 90.... MOV DPTR,#(osal_cpyExtAddr & 0xffff)
\ 00001C 74.. MOV A,#((osal_cpyExtAddr >> 16) & 0xff)
\ 00001E 12.... LCALL ?BCALL ; Banked call to: DPTR()
186 }
187
188 return (ZMacStatus_t) MAC_MlmeSetReq( attr, value );
\ ??ZMacSetReq_0:
\ 000021 ; Setup parameters for call to function MAC_MlmeSetReq
\ 000021 EE MOV A,R6
\ 000022 FA MOV R2,A
\ 000023 EF MOV A,R7
\ 000024 FB MOV R3,A
\ 000025 A9.. MOV R1,?V0 + 0
\ 000027 90.... MOV DPTR,#(MAC_MlmeSetReq & 0xffff)
\ 00002A 74.. MOV A,#((MAC_MlmeSetReq >> 16) & 0xff)
\ 00002C 12.... LCALL ?BCALL ; Banked call to: DPTR()
\ 00002F 02.... LJMP ??Subroutine6_0
189 }
190
191 /********************************************************************************************************
192 * @fn ZMacAssociateReq
193 *
194 * @brief Request an association with a coordinator.
195 *
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -