📄 process_data.c
字号:
#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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -