/***************************************************/**函數(shù)名稱:void PCA_Capture_Int();**功能描述:PCA捕獲中斷函數(shù),擴(kuò)展32位計數(shù)**說 明:中斷發(fā)生后,計數(shù)器將32計數(shù)結(jié)果高位寫入/***************************************************/void PCA_Capture_Int(){//PCA捕獲中斷if(CR){//如果計數(shù)器溢出PCA_0.Dou_L++; //模塊0高位臨時變量自加PCA_1.Dou_L++; //模塊1高位臨時變量自加}if(CCF0){//如果模塊0引腳接受中斷CCF0 = 0; //清中斷PCA_0.Match = CCAP0H;PCA_0.Match <<= 8;PCA_0.Match &= CCAP0L; //低位保存PCA_0.Dou_H = PCA_0.Dou_L; //高位保存PCA_0.Dou_L = 0; //清空高位自加容器}if(CCF1){//如果模塊1引腳接受中斷CCF1 = 0; //清中斷PCA_1.Match = CCAP1H;PCA_1.Match <<= 8;PCA_1.Match &= CCAP1L; //低位保存PCA_1.Dou_H = PCA_1.Dou_L; //高位保存PCA_1.Dou_L = 0; //清空高位自加容器}}
評論