From d16035660576075620ce0bbd3ae3930b1a9b1aab Mon Sep 17 00:00:00 2001 From: Paul Goeser Date: Sat, 14 Jan 2012 14:47:04 +0100 Subject: [PATCH] char-to-sound fixed --- gg.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/gg.c b/gg.c index 61b9857..35842b4 100644 --- a/gg.c +++ b/gg.c @@ -87,8 +87,9 @@ int main(void) debug=mmc_init(); // } debug = 2-debug; + timer_init_tiny26(); sei(); - _delay_ms(1) + _delay_ms(1); char_to_sound(25); debug = mmc_read_part(1, (unsigned char *) &length, 4); @@ -101,7 +102,6 @@ int main(void) char_to_sound((length>>8) & 0xff); - timer_init_tiny26(); /* unsigned long block = 0; @@ -120,12 +120,12 @@ void char_to_sound(uint8_t val){ uint8_t i=0,r,b, sound=10; uint16_t a,to; for(b=0; b<8; b++){ -/* if(val & 1){ - sound = 16; +/* if(val & 0x80){ + sound = 2; }else{ - sound = 8; - }*/ - // sound = (val&1)+1; + sound = 1; + }// */ + sound = (val&1)+1; val >>= 1; for(to=0; to<3200; to++){ i += sound*8; @@ -142,4 +142,10 @@ void char_to_sound(uint8_t val){ } } } + for(to=0; to<4000; to++){ + r=1; + while(r){ + r=ringbuf_put(&rb, 0); + } + } }