C51 COMPILER V9.59.0.0 STC8A_BMM_ISR 06/10/2021 17:30:45 PAGE 1 C51 COMPILER V9.59.0.0, COMPILATION OF MODULE STC8A_BMM_ISR OBJECT MODULE PLACED IN .\list\STC8A_BMM_Isr.obj COMPILER INVOKED BY: C:\Keil_v5\C51\BIN\C51.EXE STC8A_BMM_Isr.c LARGE OMF2 OPTIMIZE(8,SPEED) BROWSE DEBUG PRINT(.\list\S -TC8A_BMM_Isr.lst) TABS(2) OBJECT(.\list\STC8A_BMM_Isr.obj) line level source 1 /*---------------------------------------------------------------------*/ 2 /* --- STC MCU Limited ------------------------------------------------*/ 3 /* --- STC 1T Series MCU Demo Programme -------------------------------*/ 4 /* --- Mobile: (86)13922805190 ----------------------------------------*/ 5 /* --- Fax: 86-0513-55012956,55012947,55012969 ------------------------*/ 6 /* --- Tel: 86-0513-55012928,55012929,55012966 ------------------------*/ 7 /* --- Web: www.STCMCU.com --------------------------------------------*/ 8 /* --- Web: www.STCMCUDATA.com ---------------------------------------*/ 9 /* --- QQ: 800003751 -------------------------------------------------*/ 10 /* 如果要在程序中使用此代码,请在程序中注明使用了STC的资料及程序 */ 11 /*---------------------------------------------------------------------*/ 12 13 #include "STC8A_BMM.h" 14 #include "STC8A_SPI.h" 15 16 //======================================================================== 17 // 函数: BMM_ISR_Handler 18 // 描述: BMM中断函数. 19 // 参数: none. 20 // 返回: none. 21 // 版本: V1.0, 2021-05-25 22 //======================================================================== 23 void BMM_ISR_Handler (void) interrupt 13 24 { 25 1 char store; 26 1 27 1 store = P_SW2; 28 1 P_SW2 |= 0x80; //使能扩展SFR(XSFR)访问 29 1 30 1 // TODO: 在此处添加用户代码 31 1 //----------- BMM M2M -------------- 32 1 if(BMM_M2M_STA & 0x01) //M2M传输完成 33 1 { 34 2 BMM_M2M_STA &= ~0x01; //清标志位 35 2 if(u2sFlag) 36 2 { 37 3 u2sFlag = 0; 38 3 SpiSendFlag = 1; 39 3 } 40 2 if(s2uFlag) 41 2 { 42 3 s2uFlag = 0; 43 3 UartSendFlag = 1; 44 3 } 45 2 } 46 1 47 1 //---------- BMM UART1 ------------- 48 1 if (BMM_UR1T_STA & 0x01) //发送完成 49 1 { 50 2 BMM_UR1T_STA &= ~0x01; //清标志位 51 2 BmmTx1Flag = 1; 52 2 } 53 1 if (BMM_UR1T_STA & 0x04) //数据覆盖 54 1 { C51 COMPILER V9.59.0.0 STC8A_BMM_ISR 06/10/2021 17:30:45 PAGE 2 55 2 BMM_UR1T_STA &= ~0x04; //清标志位 56 2 } 57 1 58 1 if (BMM_UR1R_STA & 0x01) //接收完成 59 1 { 60 2 BMM_UR1R_STA &= ~0x01; //清标志位 61 2 BmmRx1Flag = 1; 62 2 } 63 1 if (BMM_UR1R_STA & 0x02) //数据丢弃 64 1 { 65 2 BMM_UR1R_STA &= ~0x02; //清标志位 66 2 } 67 1 68 1 //---------- BMM SPI ------------- 69 1 if(BMM_SPI_STA & 0x01) //通信完成 70 1 { 71 2 BMM_SPI_STA &= ~0x01; //清标志位 72 2 if(SPCTL & 0x10) 73 2 { //主机模式 74 3 SpiTxFlag = 1; 75 3 SPI_SS_2 = 1; 76 3 } 77 2 else 78 2 { //从机模式 79 3 SpiRxFlag = 1; 80 3 } 81 2 } 82 1 if(BMM_SPI_STA & 0x02) //数据丢弃 83 1 { 84 2 BMM_SPI_STA &= ~0x02; //清标志位 85 2 } 86 1 if(BMM_SPI_STA & 0x04) //数据覆盖 87 1 { 88 2 BMM_SPI_STA &= ~0x04; //清标志位 89 2 } 90 1 91 1 P_SW2 = store; 92 1 } MODULE INFORMATION: STATIC OVERLAYABLE CODE SIZE = 153 ---- CONSTANT SIZE = ---- ---- XDATA SIZE = ---- ---- PDATA SIZE = ---- ---- DATA SIZE = ---- ---- IDATA SIZE = ---- ---- BIT SIZE = ---- ---- EDATA SIZE = ---- ---- HDATA SIZE = ---- ---- XDATA CONST SIZE = ---- ---- FAR CONST SIZE = ---- ---- END OF MODULE INFORMATION. C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)