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

📄 mtel.lst

📁 cc2430讀取短地址程式
💻 LST
📖 第 1 页 / 共 5 页
字号:
   \   000000                REQUIRE __INIT_XDATA_Z
    120          byte MT_TaskID;
   \                     MT_TaskID:
   \   000000                DS 1

   \                                 In segment XDATA_Z, align 1, keep-with-next
   \   000000                REQUIRE __INIT_XDATA_Z
    121          byte debugThreshold;
   \                     debugThreshold:
   \   000000                DS 1

   \                                 In segment XDATA_Z, align 1, keep-with-next
   \   000000                REQUIRE __INIT_XDATA_Z
    122          byte debugCompId;
   \                     debugCompId:
   \   000000                DS 1
    123          

   \                                 In segment XDATA_Z, align 1, keep-with-next
   \   000000                REQUIRE __INIT_XDATA_Z
    124          UINT16 save_cmd;
   \                     save_cmd:
   \   000000                DS 2
    125          
    126          //DEBUG

   \                                 In segment XDATA_Z, align 1, keep-with-next
   \   000000                REQUIRE __INIT_XDATA_Z
    127          uint32 longvar;
   \                     longvar:
   \   000000                DS 4

   \                                 In segment XDATA_Z, align 1, keep-with-next
   \   000000                REQUIRE __INIT_XDATA_Z
    128          uint16 *temp_glob_ptr1;
   \                     temp_glob_ptr1:
   \   000000                DS 2

   \                                 In segment XDATA_Z, align 1, keep-with-next
   \   000000                REQUIRE __INIT_XDATA_Z
    129          uint16 *temp_glob_ptr2;
   \                     temp_glob_ptr2:
   \   000000                DS 2
    130          
    131          /*********************************************************************
    132           * EXTERNAL VARIABLES
    133           */
    134          
    135          /*********************************************************************
    136           * EXTERNAL FUNCTIONS
    137           */
    138          extern unsigned int mac_sim_eventLoop( void );
    139          
    140          #ifdef MACSIM
    141            // Used to pass Zignet message
    142            extern void MACSIM_TranslateMsg( byte *buf, byte bLen );
    143          #endif
    144          
    145          /*********************************************************************
    146           * LOCAL VARIABLES
    147           */
    148          
    149          /*********************************************************************
    150           * LOCAL FUNCTIONS
    151           */
    152          void MT_MsgQueueInit( void );
    153          void MT_ProcessCommand( mtOSALSerialData_t *msg );
    154          void MT_ProcessSerialCommand( byte *msg );
    155          byte MT_RAMRead( UINT16 addr, byte *pData );
    156          byte MT_RAMWrite( UINT16 addr , byte val );
    157          void MT_ProcessDebugMsg( mtDebugMsg_t *pData );
    158          void MT_ProcessDebugStr( mtDebugStr_t *pData );
    159          byte MT_SetDebugThreshold( byte comp_id, byte threshold );
    160          void MT_SendErrorNotification( byte err );
    161          void MT_ResetMsgQueue( void );
    162          byte MT_QueueMsg( byte *msg , byte len );
    163          void MT_ProcessQueue( void );
    164          void MT_SendSPIRespMsg( byte ret, uint16 cmd_id, byte msgLen, byte respLen);
    165          void MT_Reset(byte typID);
    166          byte MT_ProcessSetNV( byte *pData );
    167          void MT_ProcessGetNV( byte *pData );
    168          void MT_ProcessGetNvInfo( void );
    169          void MT_ProcessGetDeviceInfo( void );
    170          byte MTProcessAppMsg( byte *pData, byte len );
    171          void MTProcessAppRspMsg( byte *pData, byte len );
    172          
    173          #if (defined HAL_LED) && (HAL_LED == TRUE)
    174          byte MTProcessLedControl( byte *pData );
    175          #endif
    176          
    177          #if defined ( MT_USER_TEST_FUNC )
    178          void MT_ProcessAppUserCmd( byte *pData );
    179          #endif
    180          
    181          /*********************************************************************
    182           * @fn      MT_TaskInit
    183           *
    184           * @brief
    185           *
    186           *   MonitorTest Task Initialization.  This function is put into the
    187           *   task table.
    188           *
    189           * @param   byte task_id - task ID of the MT Task
    190           *
    191           * @return  void
    192           *
    193           *********************************************************************/

   \                                 In segment BANKED_CODE, align 1, keep-with-next
    194          void MT_TaskInit( byte task_id )
   \                     MT_TaskInit:
    195          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    196            MT_TaskID = task_id;
   \   000004   E9           MOV     A,R1
   \   000005   90....       MOV     DPTR,#MT_TaskID
   \   000008   F0           MOVX    @DPTR,A
    197          
    198            debugThreshold = 0;
   \   000009   E4           CLR     A
   \   00000A   90....       MOV     DPTR,#debugThreshold
   \   00000D   F0           MOVX    @DPTR,A
    199            debugCompId = 0;
   \   00000E   90....       MOV     DPTR,#debugCompId
   \   000011   F0           MOVX    @DPTR,A
    200          
    201            // Initialize the Serial port
    202            SPIMgr_Init();
   \   000012                ; Setup parameters for call to function SPIMgr_Init
   \   000012   90....       MOV     DPTR,#(SPIMgr_Init & 0xffff)
   \   000015   74..         MOV     A,#((SPIMgr_Init >> 16) & 0xff)
   \   000017   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
    203          
    204          } /* MT_TaskInit() */
   \   00001A   02....       LJMP    ?Subroutine15 & 0xFFFF

   \                                 In segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine15:
   \   000000   D083         POP     DPH
   \   000002   D082         POP     DPL
   \   000004   02....       LJMP    ?BRET
    205          
    206          #ifdef ZTOOL_PORT
    207          /*********************************************************************
    208           * @fn      MT_IndReset()
    209           *
    210           * @brief   Sends a ZTOOL "reset response" message.
    211           *
    212           * @param   None
    213           *
    214           * @return  None
    215           *
    216           *********************************************************************/

   \                                 In segment BANKED_CODE, align 1, keep-with-next
    217          void MT_IndReset( void )
   \                     MT_IndReset:
    218          {
   \   000000   74F6         MOV     A,#-0xa
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 10
   \   000005                ; Auto size: 1
   \   000005   74FF         MOV     A,#-0x1
   \   000007   12....       LCALL   ?ALLOC_XSTACK8
    219          
    220            byte rsp = 0;  // Reset type==0 indicates Z-Stack reset
   \   00000A   E4           CLR     A
   \   00000B   12....       LCALL   ?Subroutine1 & 0xFFFF
    221          
    222            // Send out Reset Response message
    223            MT_BuildAndSendZToolResponse( (SPI_0DATA_MSG_LEN + sizeof( rsp )),
    224                                          (SPI_RESPONSE_BIT | SPI_CMD_SYS_RESET),
    225                                          sizeof( rsp ), &rsp );
   \                     ??CrossCallReturnLabel_2:
   \   00000E   12....       LCALL   ?PUSH_XSTACK_I_TWO
   \   000011   7C01         MOV     R4,#0x1
   \   000013   7A05         MOV     R2,#0x5
   \   000015   02....       LJMP    ?Subroutine16 & 0xFFFF
    226          }

   \                                 In segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine16:
   \   000000   7B10         MOV     R3,#0x10
   \   000002   7906         MOV     R1,#0x6
   \   000004   90....       MOV     DPTR,#(MT_BuildAndSendZToolResponse & 0xffff)
   \   000007   74..         MOV     A,#((MT_BuildAndSendZToolResponse >> 16) & 0xff)
   \   000009   12....       LCALL   ?BCALL               ; Banked call to: DPTR()
   \   00000C   7402         MOV     A,#0x2
   \   00000E   12....       LCALL   ?DEALLOC_XSTACK8
   \   000011   7401         MOV     A,#0x1
   \                     ??Subroutine16_0:
   \   000013   12....       LCALL   ?DEALLOC_XSTACK8
   \                     ??Subroutine16_1:
   \   000016   7F02         MOV     R7,#0x2
   \   000018   02....       LJMP    ?BANKED_LEAVE_XDATA

   \                                 In segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine1:
   \   000000   85..82       MOV     DPL,?XSP + 0
   \   000003   85..83       MOV     DPH,?XSP + 1
   \   000006   F0           MOVX    @DPTR,A
   \   000007                ; Setup parameters for call to function MT_BuildAndSendZToolResponse
   \   000007                ; Setup parameters for call to function MT_BuildAndSendZToolResponse
   \   000007   8582..       MOV     ?V0 + 0,DPL
   \   00000A   8583..       MOV     ?V0 + 1,DPH
   \   00000D   78..         MOV     R0,#?V0 + 0
   \   00000F   22           RET
    227          #endif
    228          
    229          /*********************************************************************
    230           * @fn      MT_ProcessEvent
    231           *
    232           * @brief
    233           *
    234           *   MonitorTest Task Event Processor.  This task is put into the
    235           *   task table.
    236           *
    237           * @param   byte task_id - task ID of the MT Task
    238           * @param   UINT16 events - event(s) for the MT Task
    239           *
    240           * @return  void
    241           */

   \                                 In segment BANKED_CODE, align 1, keep-with-next
    242          UINT16 MT_ProcessEvent( byte task_id, UINT16 events )
   \                     MT_ProcessEvent:
    243          {
   \   000000   74F6         MOV     A,#-0xa
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 10
   \   000005                ; Auto size: 0
   \   000005   EA           MOV     A,R2
   \   000006   FE           MOV     R6,A
   \   000007   EB           MOV     A,R3
   \   000008   FF           MOV     R7,A
    244            uint8 *msg_ptr;
    245          
    246            // Could be multiple events, so switch won't work
    247          
    248            if ( events & SYS_EVENT_MSG )
   \   000009   7480         MOV     A,#-0x80
   \   00000B   5F           ANL     A,R7
   \   00000C   F9           MOV     R1,A
   \   00000D   E4           CLR     A
   \   00000E   7001         JNZ     ??MT_ProcessEvent_0
   \   000010   E9           MOV     A,R1
   \                     ??MT_ProcessEvent_0:
   \   000011   701F         JNZ     ??MT_ProcessEvent_1
    249            {
    250              while ( (msg_ptr = osal_msg_receive( MT_TaskID )) )
    251              {
    252                MT_ProcessCommand( (mtOSALSerialData_t *)msg_ptr );
    253              }
    254          
    255              // Return unproccessed events
    256              return (events ^ SYS_EVENT_MSG);
    257            }
    258          

⌨️ 快捷键说明

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