process_data_2.c
来自「所用板ADSP-BF561 EZ-KIT Lite」· C语言 代码 · 共 30 行
C
30 行
#include "..\include\exercise_2.h"
#include "..\include\process_data_2.h"
short volume=32767; // using a float variable in this example
void reduce_volume()
{
volume *= REDUCE_FACTOR>>15; // reduce volume if larger than min.
if (volume < MIN_VOLUME)
volume = MIN_VOLUME;
}
void increase_volume()
{
volume *= INCREASE_FACTOR>>15; // increase volume if smaller than max.
volume = volume << 1;//x2
if (volume > MAX_VOLUME)
volume = MAX_VOLUME;
}
void process_data()
{
sDAC1L = sADC2L*volume>>15;
sDAC2R = sADC2R*volume>>15;
sDAC1L = sADC1L*volume>>15;
sDAC1R = sADC1R*volume>>15;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?