📄 mtel.lst
字号:
418 MT_ProcessDebugMsg( (mtDebugMsg_t *)msg );
\ ??MT_ProcessCommand_1:
\ 00003F ; Setup parameters for call to function MT_ProcessDebugMsg
\ 00003F 90.... MOV DPTR,#(MT_ProcessDebugMsg & 0xffff)
\ 000042 74.. MOV A,#((MT_ProcessDebugMsg >> 16) & 0xff)
\ 000044 8069 SJMP ??MT_ProcessCommand_6
419 break;
420
421 case CMD_DEBUG_STR:
422 MT_ProcessDebugStr( (mtDebugStr_t *)msg );
\ ??MT_ProcessCommand_3:
\ 000046 ; Setup parameters for call to function MT_ProcessDebugStr
\ 000046 90.... MOV DPTR,#(MT_ProcessDebugStr & 0xffff)
\ 000049 74.. MOV A,#((MT_ProcessDebugStr >> 16) & 0xff)
\ 00004B 8062 SJMP ??MT_ProcessCommand_6
423 break;
424
425 case CB_FUNC:
426 /*
427 Build SPI message here instead of redundantly calling MT_BuildSPIMsg
428 because we have copied data already in the allocated message
429 */
430
431 /* msg_ptr is the beginning of the intended SPI message */
432 len = SPI_0DATA_MSG_LEN + msg_ptr[DATALEN_FIELD];
\ ??MT_ProcessCommand_2:
\ 00004D 8E82 MOV DPL,R6
\ 00004F 8F83 MOV DPH,R7
\ 000051 A3 INC DPTR
\ 000052 A3 INC DPTR
\ 000053 A3 INC DPTR
\ 000054 E0 MOVX A,@DPTR
\ 000055 2405 ADD A,#0x5
\ 000057 F5.. MOV ?V0 + 2,A
433
434 /*
435 FCS goes to the last byte in the message and is calculated over all
436 the bytes except FCS and SOP
437 */
438 msg_ptr[len-1] = SPIMgr_CalcFCS( msg_ptr + 1 , (byte)(len-2) );
\ 000059 ; Setup parameters for call to function SPIMgr_CalcFCS
\ 000059 74FE MOV A,#-0x2
\ 00005B 25.. ADD A,?V0 + 2
\ 00005D F9 MOV R1,A
\ 00005E 8E82 MOV DPL,R6
\ 000060 8F83 MOV DPH,R7
\ 000062 A3 INC DPTR
\ 000063 AA82 MOV R2,DPL
\ 000065 AB83 MOV R3,DPH
\ 000067 90.... MOV DPTR,#(SPIMgr_CalcFCS & 0xffff)
\ 00006A 74.. MOV A,#((SPIMgr_CalcFCS >> 16) & 0xff)
\ 00006C 12.... LCALL ?BCALL ; Banked call to: DPTR()
\ 00006F E9 MOV A,R1
\ 000070 C0E0 PUSH A
\ 000072 85.... MOV ?V0 + 4,?V0 + 2
\ 000075 EE MOV A,R6
\ 000076 25.. ADD A,?V0 + 4
\ 000078 F8 MOV R0,A
\ 000079 EF MOV A,R7
\ 00007A 3400 ADDC A,#0x0
\ 00007C F9 MOV R1,A
\ 00007D 74FF MOV A,#-0x1
\ 00007F 28 ADD A,R0
\ 000080 F582 MOV DPL,A
\ 000082 74FF MOV A,#-0x1
\ 000084 39 ADDC A,R1
\ 000085 F583 MOV DPH,A
\ 000087 D0E0 POP A
\ 000089 F0 MOVX @DPTR,A
439
440 #ifdef SPI_MGR_DEFAULT_PORT
441 HalUARTWrite ( SPI_MGR_DEFAULT_PORT, msg_ptr, len );
\ 00008A ; Setup parameters for call to function HalUARTWrite
\ 00008A AC.. MOV R4,?V0 + 2
\ 00008C 7D00 MOV R5,#0x0
\ 00008E EE MOV A,R6
\ 00008F FA MOV R2,A
\ 000090 EF MOV A,R7
\ 000091 FB MOV R3,A
\ 000092 7900 MOV R1,#0x0
\ 000094 90.... MOV DPTR,#(HalUARTWrite & 0xffff)
\ 000097 74.. MOV A,#((HalUARTWrite >> 16) & 0xff)
\ 000099 8014 SJMP ??MT_ProcessCommand_6
442 #endif
443 break;
444
445 #if !defined ( NONWK )
446 case MT_SYS_APP_RSP_MSG:
447 len = SPI_0DATA_MSG_LEN + msg_ptr[DATALEN_FIELD];
448 MTProcessAppRspMsg( msg_ptr, len );
\ ??MT_ProcessCommand_4:
\ 00009B ; Setup parameters for call to function MTProcessAppRspMsg
\ 00009B 8E82 MOV DPL,R6
\ 00009D 8F83 MOV DPH,R7
\ 00009F A3 INC DPTR
\ 0000A0 A3 INC DPTR
\ 0000A1 A3 INC DPTR
\ 0000A2 E0 MOVX A,@DPTR
\ 0000A3 2405 ADD A,#0x5
\ 0000A5 F9 MOV R1,A
\ 0000A6 EE MOV A,R6
\ 0000A7 FA MOV R2,A
\ 0000A8 EF MOV A,R7
\ 0000A9 FB MOV R3,A
\ 0000AA 90.... MOV DPTR,#(MTProcessAppRspMsg & 0xffff)
\ 0000AD 74.. MOV A,#((MTProcessAppRspMsg >> 16) & 0xff)
\ ??MT_ProcessCommand_6:
\ 0000AF 12.... LCALL ?BCALL ; Banked call to: DPTR()
449 break;
450 #endif // NONWK
451 #endif // ZTOOL
452
453 default:
454 break;
455 }
456
457 if ( deallocate )
458 {
459 osal_msg_deallocate( (uint8 *)msg );
\ ??MT_ProcessCommand_5:
\ 0000B2 ; Setup parameters for call to function osal_msg_deallocate
\ 0000B2 AA.. MOV R2,?V0 + 0
\ 0000B4 AB.. MOV R3,?V0 + 1
\ 0000B6 90.... MOV DPTR,#(osal_msg_deallocate & 0xffff)
\ 0000B9 74.. MOV A,#((osal_msg_deallocate >> 16) & 0xff)
\ 0000BB 12.... LCALL ?BCALL ; Banked call to: DPTR()
460 }
461 }
\ 0000BE 02.... LJMP ??Subroutine17_0 & 0xFFFF
\ In segment BANKED_CODE, align 1, keep-with-next
\ ?Subroutine7:
\ 000000 85..82 MOV DPL,?XSP + 0
\ 000003 85..83 MOV DPH,?XSP + 1
\ ??Subroutine7_0:
\ 000006 E0 MOVX A,@DPTR
\ 000007 FA MOV R2,A
\ 000008 A3 INC DPTR
\ 000009 E0 MOVX A,@DPTR
\ 00000A FB MOV R3,A
\ 00000B 22 RET
462
463 #if defined (ZTOOL_P1) || defined (ZTOOL_P2)
464 /*********************************************************************
465 * @fn MT_ProcessDebugMsg
466 *
467 * @brief
468 *
469 * Build and send a debug message.
470 *
471 * @param byte *data - pointer to the data portion of the debug message
472 *
473 * @return void
474 */
\ In segment BANKED_CODE, align 1, keep-with-next
475 void MT_ProcessDebugMsg( mtDebugMsg_t *msg )
\ MT_ProcessDebugMsg:
476 {
\ 000000 74F2 MOV A,#-0xe
\ 000002 12.... LCALL ?BANKED_ENTER_XDATA
\ 000005 ; Saved register size: 14
\ 000005 ; Auto size: 11
\ 000005 74F5 MOV A,#-0xb
\ 000007 12.... LCALL ?ALLOC_XSTACK8
\ 00000A EA MOV A,R2
\ 00000B FE MOV R6,A
\ 00000C EB MOV A,R3
\ 00000D FF MOV R7,A
477 byte *msg_ptr;
478 byte dataLen;
479 uint8 buf[11];
480 uint8 *pBuf;
481
482 // Calculate the data length based
483 dataLen = 5 + (msg->numParams * sizeof ( uint16 ));
\ 00000E 8E82 MOV DPL,R6
\ 000010 8F83 MOV DPH,R7
\ 000012 A3 INC DPTR
\ 000013 A3 INC DPTR
\ 000014 A3 INC DPTR
\ 000015 A3 INC DPTR
\ 000016 E0 MOVX A,@DPTR
\ 000017 C3 CLR C
\ 000018 33 RLC A
\ 000019 2405 ADD A,#0x5
\ 00001B F5.. MOV ?V0 + 0,A
484
485 // Get a message buffer to build the debug message
486 msg_ptr = osal_msg_allocate( (byte)(SPI_0DATA_MSG_LEN + dataLen + 1) );
\ 00001D ; Setup parameters for call to function osal_msg_allocate
\ 00001D 7406 MOV A,#0x6
\ 00001F 12.... LCALL ?Subroutine11 & 0xFFFF
\ ??CrossCallReturnLabel_43:
\ 000022 12.... LCALL ?BCALL ; Banked call to: DPTR()
\ 000025 8A.. MOV ?V0 + 2,R2
\ 000027 8B.. MOV ?V0 + 3,R3
487 if ( msg_ptr )
\ 000029 EA MOV A,R2
\ 00002A 7001 JNZ ??MT_ProcessDebugMsg_0
\ 00002C EB MOV A,R3
\ ??MT_ProcessDebugMsg_0:
\ 00002D 7003 JNZ $+5
\ 00002F 02.... LJMP ??MT_ProcessDebugMsg_1 & 0xFFFF
488 {
489 // Build the message
490 pBuf = buf;
491 *pBuf++ = msg->compID;
\ 000032 8E82 MOV DPL,R6
\ 000034 8F83 MOV DPH,R7
\ 000036 A3 INC DPTR
\ 000037 A3 INC DPTR
\ 000038 E0 MOVX A,@DPTR
\ 000039 85..82 MOV DPL,?XSP + 0
\ 00003C 85..83 MOV DPH,?XSP + 1
\ 00003F 12.... LCALL ?Subroutine3 & 0xFFFF
492 *pBuf++ = msg->severity;
\ ??CrossCallReturnLabel_6:
\ 000042 E0 MOVX A,@DPTR
\ 000043 C0E0 PUSH A
\ 000045 7401 MOV A,#0x1
\ 000047 12.... LCALL ?XSTACK_DISP0_8
\ 00004A D0E0 POP A
\ 00004C F0 MOVX @DPTR,A
493 *pBuf++ = msg->numParams;
\ 00004D EE MOV A,R6
\ 00004E 2404 ADD A,#0x4
\ 000050 F8 MOV R0,A
\ 000051 EF MOV A,R7
\ 000052 3400 ADDC A,#0x0
\ 000054 F9 MOV R1,A
\ 000055 E8 MOV A,R0
\ 000056 FA MOV R2,A
\ 000057 E9 MOV A,R1
\ 000058 FB MOV R3,A
\ 000059 8A82 MOV DPL,R2
\ 00005B 8B83 MOV DPH,R3
\ 00005D E0 MOVX A,@DPTR
\ 00005E C0E0 PUSH A
\ 000060 7402 MOV A,#0x2
\ 000062 12.... LCALL ?XSTACK_DISP0_8
\ 000065 D0E0 POP A
\ 000067 F0 MOVX @DPTR,A
\ 000068 7403 MOV A,#0x3
\ 00006A 12.... LCALL ?XSTACK_DISP0_8
\ 00006D A882 MOV R0,DPL
\ 00006F A983 MOV R1,DPH
494
495 if ( msg->numParams >= 1 )
\ 000071 8A82 MOV DPL,R2
\ 000073 8B83 MOV DPH,R3
\ 000075 E0 MOVX A,@DPTR
\ 000076 6030 JZ ??MT_ProcessDebugMsg_2
496 {
497 *pBuf++ = HI_UINT16( msg->param1 );
\ 000078 EE MOV A,R6
\ 000079 2405 ADD A,#0x5
\ 00007B F8 MOV R0,A
\ 00007C EF MOV A,R7
\ 00007D 3400 ADDC A,#0x0
\ 00007
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -