?? 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 + -