process_data.c
来自「基于visual dsp++开发环境」· C语言 代码 · 共 37 行
C
37 行
#include "Talkthrough.h"
#include "btc.h"
int nValue;
extern int BTCLeftVolume;
extern int BTCRightVolume;
extern int iChannel0LeftIn;
extern int iChannel0RightIn;
extern int iChannel0LeftOut;
extern int iChannel0RightOut;
//--------------------------------------------------------------------------//
// Function: Process_Data() //
// //
// Description: This function is called from inside the SPORT0 ISR every //
// time a complete audio frame has been received. The new //
// input samples can be found in the variables iChannel0LeftIn,//
// iChannel0RightIn respectively. The processed data should be //
// stored in iChannel0LeftOut, iChannel0RightOut respectively. // // //
//--------------------------------------------------------------------------//
void Process_Data(void)
{
nValue = ((iChannel0LeftIn << 8) >> 8); //preserve sign
nValue = (nValue >> BTCLeftVolume); //volume
btc_write_value(0, (unsigned int*)&nValue, sizeof(nValue));
iChannel0LeftOut = nValue;
nValue = ((iChannel0RightIn << 8) >> 8); //preserve sign
nValue = (nValue >> BTCRightVolume);//volume
btc_write_value(1, (unsigned int*)&nValue, sizeof(nValue));
iChannel0RightOut = nValue;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?