|
|
|
|
@ -28,10 +28,10 @@ void timer_init_tiny26(void)
|
|
|
|
|
TIMSK = 1 << TOIE1;/* interrupt on overflow */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#define BUFFER_SIZE 32
|
|
|
|
|
#define BUFFER_SIZE 16
|
|
|
|
|
uint16_t buffer[BUFFER_SIZE];/* buffer for mmc data */
|
|
|
|
|
ringbuf_t rb;
|
|
|
|
|
uint32_t length;/* remaining samples */
|
|
|
|
|
int32_t length;/* remaining samples */
|
|
|
|
|
|
|
|
|
|
/*ISR(TIMER1_OVF1_vect, ISR_NAKED)
|
|
|
|
|
{
|
|
|
|
|
@ -58,7 +58,7 @@ ISR(TIMER1_OVF1_vect){
|
|
|
|
|
if(!--cnt_to_next){
|
|
|
|
|
ringbuf_get(&rb, &next);
|
|
|
|
|
OCR1B = next>>8;
|
|
|
|
|
cnt_to_ocr_incr = 8 - (next & 0x7);
|
|
|
|
|
cnt_to_ocr_incr = 8 - ((next>>5) & 0x7);
|
|
|
|
|
cnt_to_next = 8;
|
|
|
|
|
/* if(!--length)
|
|
|
|
|
{
|
|
|
|
|
@ -90,25 +90,19 @@ int main(void)
|
|
|
|
|
timer_init_tiny26();
|
|
|
|
|
sei();
|
|
|
|
|
_delay_ms(1);
|
|
|
|
|
char_to_sound(25);
|
|
|
|
|
|
|
|
|
|
debug = mmc_read_part(1, (unsigned char *) &length, 4);
|
|
|
|
|
debug = 1;
|
|
|
|
|
if(length==0){
|
|
|
|
|
debug = 2;
|
|
|
|
|
}
|
|
|
|
|
char_to_sound((length>>24) & 0xff);
|
|
|
|
|
mmc_read_part(0, (unsigned char *) &length, 4);
|
|
|
|
|
char_to_sound((length>>8) & 0xff);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
unsigned long block = 0;
|
|
|
|
|
for(;; block++)
|
|
|
|
|
while(length > 0)
|
|
|
|
|
{
|
|
|
|
|
//mmc_read_to_ringbuffer(block, &rb);
|
|
|
|
|
mmc_read_to_ringbuffer(0, &rb);
|
|
|
|
|
mmc_read_to_ringbuffer(block, &rb);
|
|
|
|
|
length -= 256;
|
|
|
|
|
block++;
|
|
|
|
|
} // */
|
|
|
|
|
// debug = 0;
|
|
|
|
|
|
|
|
|
|
|