char-to-sound fixed

master
Paul Goeser 14 years ago
parent a718933df0
commit d160356605

20
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);
}
}
}

Loading…
Cancel
Save