📄 sinegen_table.c
字号:
//Sinegen_table.c Generates a sinusoid for a look-up table
#include <math.h>
#define table_size (short)10 //set table size
short sine_table[table_size]; //sine table array
short i;
interrupt void c_int11() //interrupt service routine
{
output_sample(sine_table[i]); //output each sine value
if (i < table_size - 1) ++i; //incr index until end of table
else i = 0; //reinit index if end of table
return; //return from interrupt
}
void main()
{
float pi=3.14159;
for(i = 0; i < table_size; i++)
sine_table[i]=10000*sin(2.0*pi*i/table_size); //scaled values
i = 0;
comm_intr(); //init DSK, codec, McBSP
while(1); //infinite loop
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -