did stuff

This commit is contained in:
twobit 2012-07-26 02:19:59 +02:00
parent 36cca6cfcf
commit 8896169bb2

View File

@ -8,12 +8,6 @@
volatile uint8_t sample_pending;
//25kHz
ISR(TIMER0_OVF_vect)
{
ICR1 = synth.output;
sample_pending = 1;
}
// sample rate is 8M / (5 * 64) = 25000
@ -34,6 +28,14 @@ typedef struct {
static synth_t synth;
//25kHz
ISR(TIMER0_OVF_vect)
{
PORTC ^= 0b1;
ICR1 = synth.output;
sample_pending = 1;
}
static void synth_init(void)
{
// some test values
@ -52,7 +54,7 @@ static inline void synth_mix(void)
synth_channel_t *chan = &synth.channels[i];
chan->phase += chan->speed;
synth.output += (chan->phase >> 16) & 0xff;
synth.output += (chan->phase >> 8) & 0xff;
}
}