|
|
|
|
@ -40,7 +40,7 @@ uint8_t buffer[BUFFER_SIZE];/* buffer for mmc data */
|
|
|
|
|
uint8_t pos = 0;/* current playing position */
|
|
|
|
|
uint8_t refresh_buffer = 0;/* position to start buffer refreshing */
|
|
|
|
|
|
|
|
|
|
ISR(TIMER1_OVF1_vect, ISR_NAKED)
|
|
|
|
|
/*ISR(TIMER1_OVF1_vect, ISR_NAKED)
|
|
|
|
|
{
|
|
|
|
|
__asm__("in r2, 0x3f"); // save sreg
|
|
|
|
|
if(--cnt_to_ocr_incr){
|
|
|
|
|
@ -48,13 +48,34 @@ ISR(TIMER1_OVF1_vect, ISR_NAKED)
|
|
|
|
|
}
|
|
|
|
|
if(--cnt_to_next){
|
|
|
|
|
cur_ocr = next_ocr;
|
|
|
|
|
OCR1A = cur_ocr;
|
|
|
|
|
cnt_to_ocr_incr = next_cnt_to_incr;
|
|
|
|
|
cnt_to_next = 8;
|
|
|
|
|
needs_new_data_flag = 1;
|
|
|
|
|
}
|
|
|
|
|
__asm__("out 0x2f,r2"); // restore sreg
|
|
|
|
|
reti();
|
|
|
|
|
}
|
|
|
|
|
}//*/
|
|
|
|
|
|
|
|
|
|
ISR(TIMER1_OVF1_vect){
|
|
|
|
|
// next try: simplistic, not too much looking at speed
|
|
|
|
|
uint16_t next;
|
|
|
|
|
|
|
|
|
|
if(--cnt_to_next){
|
|
|
|
|
next = ringbuf_get(ringbuf);
|
|
|
|
|
OCR1A = next>>8;
|
|
|
|
|
cnt_to_ocr_incr = 7-(next & 0x7);
|
|
|
|
|
cnt_to_next = 7;
|
|
|
|
|
} else {
|
|
|
|
|
if(--cnt_to_ocr_incr){
|
|
|
|
|
OCR1A += 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|