⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 process_data_2.c

📁 所用板ADSP-BF561 EZ-KIT Lite
💻 C
字号:
#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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -