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

📄 af.lst

📁 cc2430应用实例
💻 LST
📖 第 1 页 / 共 5 页
字号:
   \   000001   8A82         MOV     DPL,R2
   \   000003   8B83         MOV     DPH,R3
   \   000005   02....       LJMP    ?Subroutine32 & 0xFFFF

   \                                 In segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine2:
   \   000000   F0           MOVX    @DPTR,A
   \   000001   8A82         MOV     DPL,R2
   \   000003   8B83         MOV     DPH,R3
   \   000005   A3           INC     DPTR
   \   000006   A3           INC     DPTR
   \   000007   22           RET

   \                                 In segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine32:
   \   000000   A3           INC     DPTR
   \                     ??Subroutine32_0:
   \   000001   A3           INC     DPTR
   \   000002   A3           INC     DPTR
   \   000003   A3           INC     DPTR
   \   000004   A3           INC     DPTR
   \   000005   22           RET

   \                                 In segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine25:
   \   000000   A3           INC     DPTR
   \                     ??Subroutine25_0:
   \   000001   E0           MOVX    A,@DPTR
   \   000002   F8           MOV     R0,A
   \   000003   A3           INC     DPTR
   \   000004   E0           MOVX    A,@DPTR
   \   000005   F9           MOV     R1,A
   \   000006   22           RET

   \                                 In segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine19:
   \   000000   12....       LCALL   ??Subroutine25_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_85:
   \   000003   8882         MOV     DPL,R0
   \   000005   8983         MOV     DPH,R1
   \   000007   22           RET
    225          
    226          /*********************************************************************
    227           * @fn      afRegister
    228           *
    229           * @brief   Register an Application's EndPoint description.
    230           *
    231           * @param   epDesc - pointer to the Application's endpoint descriptor.
    232           *
    233           * NOTE:  The memory that epDesc is pointing to must exist after this call.
    234           *
    235           * @return  afStatus_SUCCESS - Registered
    236           *          afStatus_MEM_FAIL - not enough memory to add descriptor
    237           */

   \                                 In segment BANKED_CODE, align 1, keep-with-next
    238          afStatus_t afRegister( endPointDesc_t *epDesc )
   \                     afRegister:
    239          {
   \   000000   74F5         MOV     A,#-0xb
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 11
   \   000005                ; Auto size: 0
    240            epList_t *ep = afRegisterExtended( epDesc, NULL );
    241          
    242            return ((ep == NULL) ? afStatus_MEM_FAIL : afStatus_SUCCESS);
   \   000005                ; Setup parameters for call to function afRegisterExtended
   \   000005   75..00       MOV     ?V0 + 0,#0x0
   \   000008   75..00       MOV     ?V0 + 1,#0x0
   \   00000B   75..00       MOV     ?V0 + 2,#0x0
   \   00000E   78..         MOV     R0,#?V0 + 0
   \   000010   12....       LCALL   ?PUSH_XSTACK_I_THREE
   \   000013   90....       MOV     DPTR,#(afRegisterExtended & 0xffff)
   \   000016   74..         MOV     A,#((afRegisterExtended >> 16) & 0xff)
   \   000018   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
   \   00001B   7403         MOV     A,#0x3
   \   00001D   12....       LCALL   ?DEALLOC_XSTACK8
   \   000020   EA           MOV     A,R2
   \   000021   7001         JNZ     ??afRegister_0
   \   000023   EB           MOV     A,R3
   \                     ??afRegister_0:
   \   000024   7004         JNZ     ??afRegister_1
   \   000026   7981         MOV     R1,#-0x7f
   \   000028   8002         SJMP    ??afRegister_2
   \                     ??afRegister_1:
   \   00002A   7900         MOV     R1,#0x0
   \                     ??afRegister_2:
   \   00002C   7F03         MOV     R7,#0x3
   \   00002E   02....       LJMP    ?BANKED_LEAVE_XDATA
    243          }
    244          
    245          #if ( AF_KVP_SUPPORT )
    246          /*********************************************************************
    247           * @fn      afRegisterFlags
    248           *
    249           * @brief   Register an Application's EndPoint description.
    250           *
    251           * @param   epDesc - pointer to the Application's endpoint descriptor.
    252           *
    253           * NOTE:  The memory that epDesc is pointing to must exist after this call.
    254           *
    255           * @return  afStatus_SUCCESS - Registered
    256           *          afStatus_MEM_FAIL - not enough memory to add descriptor
    257           */
    258          afStatus_t afRegisterFlags( endPointDesc_t *epDesc, eEP_Flags flags )
    259          {
    260            epList_t *ep = afRegisterExtended( epDesc, NULL );
    261          
    262            if ( ep != NULL )
    263            {
    264              ep->flags = flags;
    265              return afStatus_SUCCESS;
    266            }
    267            else
    268            {
    269              return afStatus_MEM_FAIL;
    270            }
    271          }
    272          #endif
    273          
    274          /*********************************************************************
    275           * @fn          afDataConfirm
    276           *
    277           * @brief       This function will generate the Data Confirm back to
    278           *              the application.
    279           *
    280           * @param       endPoint - confirm end point
    281           * @param       transID - transaction ID from APSDE_DATA_REQUEST
    282           * @param       status - status of APSDE_DATA_REQUEST
    283           *
    284           * @return      none
    285           */

   \                                 In segment BANKED_CODE, align 1, keep-with-next
    286          void afDataConfirm( uint8 endPoint, uint8 transID, ZStatus_t status )
   \                     afDataConfirm:
    287          {
   \   000000   74F4         MOV     A,#-0xc
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 12
   \   000005                ; Auto size: 0
   \   000005   89..         MOV     ?V0 + 0,R1
   \   000007   8B..         MOV     ?V0 + 1,R3
    288            endPointDesc_t *epDesc;
    289            afDataConfirm_t *msgPtr;
    290          
    291            // Find the endpoint description
    292            epDesc = afFindEndPointDesc( endPoint );
   \   000009                ; Setup parameters for call to function afFindEndPointDesc
   \   000009   90....       MOV     DPTR,#(afFindEndPointDesc & 0xffff)
   \   00000C   74..         MOV     A,#((afFindEndPointDesc >> 16) & 0xff)
   \   00000E   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
   \   000011   8A..         MOV     ?V0 + 2,R2
   \   000013   8B..         MOV     ?V0 + 3,R3
   \   000015   AE..         MOV     R6,?V0 + 2
   \   000017   AF..         MOV     R7,?V0 + 3
    293            if ( epDesc == NULL )
   \   000019   EE           MOV     A,R6
   \   00001A   7001         JNZ     ??afDataConfirm_0
   \   00001C   EF           MOV     A,R7
   \                     ??afDataConfirm_0:
   \   00001D   602C         JZ      ??afDataConfirm_1
    294              return;
    295          
    296            // Determine the incoming command type
    297            msgPtr = (afDataConfirm_t *)osal_msg_allocate( sizeof(afDataConfirm_t) );
   \   00001F                ; Setup parameters for call to function osal_msg_allocate
   \   00001F   7A04         MOV     R2,#0x4
   \   000021   7B00         MOV     R3,#0x0
   \   000023   90....       MOV     DPTR,#(osal_msg_allocate & 0xffff)
   \   000026   74..         MOV     A,#((osal_msg_allocate >> 16) & 0xff)
   \   000028   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
    298            if ( msgPtr )
   \   00002B   EA           MOV     A,R2
   \   00002C   7001         JNZ     ??afDataConfirm_2
   \   00002E   EB           MOV     A,R3
   \                     ??afDataConfirm_2:
   \   00002F   601A         JZ      ??afDataConfirm_1
    299            {
    300              // Build the Data Confirm message
    301              msgPtr->hdr.event = AF_DATA_CONFIRM_CMD;
   \   000031   74FD         MOV     A,#-0x3
   \   000033   8A82         MOV     DPL,R2
   \   000035   8B83         MOV     DPH,R3
   \   000037   F0           MOVX    @DPTR,A
    302              msgPtr->hdr.status = status;
   \   000038   A3           INC     DPTR
   \   000039   E5..         MOV     A,?V0 + 1
   \   00003B   12....       LCALL   ?Subroutine2 & 0xFFFF
    303              msgPtr->endpoint = endPoint;
   \                     ??CrossCallReturnLabel_3:
   \   00003E   E5..         MOV     A,?V0 + 0
   \   000040   F0           MOVX    @DPTR,A
    304          #if ( AF_V1_SUPPORT )
    305              msgPtr->transID = transID;
    306          #elif ( AF_KVP_SUPPORT )
    307              {
    308                epList_t *pList = afFindEndPointDescList( endPoint );
    309                if ( pList )
    310                {
    311                  if ( pList->flags & eEP_UsesKVP )
    312                  {
    313                    msgPtr->transID = transID;
    314                  }
    315                }
    316              }
    317          #else
    318              (void)transID;
    319          #endif
    320          
    321              // send message through task message
    322              osal_msg_send( *(epDesc->task_id), (byte *)msgPtr );
   \   000041                ; Setup parameters for call to function osal_msg_send
   \   000041   8E82         MOV     DPL,R6
   \   000043   8F83         MOV     DPH,R7
   \   000045   12....       LCALL   ?Subroutine8 & 0xFFFF
   \                     ??CrossCallReturnLabel_30:
   \   000048   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
   \                     ??afDataConfirm_1:
   \   00004B   7F04         MOV     R7,#0x4
   \   00004D   02....       LJMP    ?BANKED_LEAVE_XDATA
    323            }
    324          }

   \                                 In segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine8:
   \   000000   A3           INC     DPTR
   \   000001   12....       LCALL   ?Subroutine23 & 0xFFFF
   \                     ??CrossCallReturnLabel_79:
   \   000004   F9           MOV     R1,A
   \   000005   90....       MOV     DPTR,#(osal_msg_send & 0xffff)
   \   000008   74..         MOV     A,#((osal_msg_send >> 16) & 0xff)
   \   00000A   22           RET

   \                                 In segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine23:
   \   000000   12....       LCALL   ?Subroutine28 & 0xFFFF
   \                     ??CrossCallReturnLabel_92:
   \   000003   E0           MOVX    A,@DPTR
   \   000004   22           RET

   \                                 In segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine28:
   \   000000   E0           MOVX    A,@DPTR
   \   000001   F8           MOV     R0,A
   \   000002   A3           INC     DPTR
   \   000003   E0           MOVX    A,@DPTR
   \   000004   F583         MOV     DPH,A
   \   000006   8882         MOV     DPL,R0
   \   000008   22           RET
    325          
    326          /*********************************************************************

⌨️ 快捷键说明

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