|
|
|
|
@ -3,6 +3,7 @@
|
|
|
|
|
#include <avr/interrupt.h>
|
|
|
|
|
|
|
|
|
|
#include "ringbuf_small.h"
|
|
|
|
|
#include "ringbuf_small.c"
|
|
|
|
|
#include "mmc.h"
|
|
|
|
|
|
|
|
|
|
#include "gg.h"
|
|
|
|
|
@ -31,6 +32,7 @@ uint32_t mmc_position;/* current reading position on mmc */
|
|
|
|
|
|
|
|
|
|
uint8_t overflows = 1;/* remaining counter overflows until next sample */
|
|
|
|
|
#define SAMPLE_BITS 11
|
|
|
|
|
ringbuf_t rb;
|
|
|
|
|
|
|
|
|
|
#define BUFFER_SIZE 32
|
|
|
|
|
uint16_t buffer[BUFFER_SIZE];/* buffer for mmc data */
|
|
|
|
|
@ -57,7 +59,7 @@ ISR(TIMER1_OVF1_vect){
|
|
|
|
|
uint16_t next;
|
|
|
|
|
|
|
|
|
|
if(--cnt_to_next){
|
|
|
|
|
next = ringbuf_get(ringbuf);
|
|
|
|
|
ringbuf_get(&rb, &next);
|
|
|
|
|
OCR1A = next>>8;
|
|
|
|
|
cnt_to_ocr_incr = 7-(next & 0x7);
|
|
|
|
|
cnt_to_next = 7;
|
|
|
|
|
@ -75,7 +77,6 @@ ISR(TIMER1_OVF1_vect){
|
|
|
|
|
int main(void) __attribute__((noreturn));
|
|
|
|
|
int main(void)
|
|
|
|
|
{
|
|
|
|
|
ringbuf_t rb;
|
|
|
|
|
ringbuf_init(&rb, buffer, BUFFER_SIZE);
|
|
|
|
|
if(mmc_init() != 0) {/* mmc fail */;}
|
|
|
|
|
|
|
|
|
|
|