|
Revision 571, 392 bytes
(checked in by conrad, 4 years ago)
|
add all files from syre-blink release
|
| Line | |
|---|
| 1 |
#include <stdio.h> |
|---|
| 2 |
#include <math.h> |
|---|
| 3 |
|
|---|
| 4 |
#include "syre.h" |
|---|
| 5 |
|
|---|
| 6 |
/*bit16 sawtooth[1024];*/ |
|---|
| 7 |
bit16 sinwave[1024]; |
|---|
| 8 |
|
|---|
| 9 |
/* |
|---|
| 10 |
void generate_sawtooth(void) |
|---|
| 11 |
{ |
|---|
| 12 |
int i; |
|---|
| 13 |
|
|---|
| 14 |
for(i=0; i<512; i++) { |
|---|
| 15 |
sawtooth[i] = sawtooth[1024-i] = (i*(1<<6))-(1<<14); |
|---|
| 16 |
} |
|---|
| 17 |
} |
|---|
| 18 |
*/ |
|---|
| 19 |
|
|---|
| 20 |
void generate_sinwave(void) |
|---|
| 21 |
{ |
|---|
| 22 |
int i; |
|---|
| 23 |
|
|---|
| 24 |
for(i=0; i<1024; i++) { |
|---|
| 25 |
sinwave[i] = (bit16)(32768.0*sin(2.0 * M_PI * i / 1024)); |
|---|
| 26 |
} |
|---|
| 27 |
} |
|---|
| 28 |
|
|---|