?? isr.c
字號:
///////////////////////////////////////////////////////////////////////////////
//
//
// Experiment 4.5_BF537 Adaptive line enhancer (ALE) with BF537 EZ-KIT
// FILE name: ISR.c
//
// Description: Perform real-time ALE to remove noisy signal.
// Interrupt service routine to handle real-world signal.
//
// For the book "Embedded Signal Processing with the Micro Signal Architecture"
// By Woon-Seng Gan and Sen M. Kuo
// Publisher: John Wiley and Sons, Inc.
//
// Tools used: VisualDSP++ v4.0 (running on BF537 EZ-KIT)
//
///////////////////////////////////////////////////////////////////////////////
#include "ALE.h"
EX_INTERRUPT_HANDLER(Sport0_RX_ISR)
{
int i;
static short j=0,k=0;
// confirm interrupt handling
*pDMA3_IRQ_STATUS = 0x0001;
for (i = 0; i < INPUT_SIZE; i++)
{
// copy input data from dma input buffer into variables
sCh0LeftIn[i] = iRxBuffer1[INTERNAL_ADC_L0+j] >> 8;
sCh0RightIn[i] = iRxBuffer1[INTERNAL_ADC_R0+j] >> 8;
// use the builtin circular buffer to update the index
j = __builtin_circindex(j, 2, 2*INPUT_SIZE*TOTAL_FRAME);
}
// call function that contains user code
Process_Data();
for (i = 0; i < INPUT_SIZE; i++)
{
// copy processed data from variables into dma output buffer
iTxBuffer1[INTERNAL_DAC_L0+k] = sCh0LeftOut[i] << 8;
iTxBuffer1[INTERNAL_DAC_R0+k] = sCh0RightOut[i] << 8;
// use the builtin circular buffer to update the index
k = __builtin_circindex(k, 2, 2*INPUT_SIZE*TOTAL_FRAME);
}
}
EX_INTERRUPT_HANDLER(Switch_ISR)
{
int i;
if (*pPORTFIO & PF2)
{
*pPORTFIO_CLEAR = PF2;
}
if (*pPORTFIO & PF3)
{
*pPORTFIO_CLEAR = PF3;
ucMode = OUT3;
}
if (*pPORTFIO & PF4)
{
*pPORTFIO_CLEAR = PF4;
ucMode = OUT2;
}
if (*pPORTFIO & PF5)
{
*pPORTFIO_CLEAR = PF5;
ucMode = OUT1;
// reset
for (i = 0; i < TAPS; i++)
{
coefL[i] = 0;
firdelayL[i] = 0;
lmsdelayL[i] = 0;
coefR[i] = 0;
firdelayR[i] = 0;
lmsdelayR[i] = 0;
}
for (i=TAPS; i<TAPS+INPUT_SIZE+DELAY_SIZE-1; i++)
{
lmsdelayL[i] = 0;
lmsdelayR[i] = 0;
}
}
*pPORTFIO_CLEAR = 0x0FC0;
*pPORTFIO_SET = ucMode << 4;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -