diff --git a/PWM echantillonage b/PWM echantillonage deleted file mode 100644 index e69de29..0000000 diff --git a/src/Sound4Calc.c b/src/Sound4Calc.c index 95bb9a9..67a4e3a 100755 --- a/src/Sound4Calc.c +++ b/src/Sound4Calc.c @@ -9,7 +9,7 @@ //#define PI 3.141592653584 -char bincod[12] = {0}; +char bincod[25] = {0}; char place = 0; unsigned char range = 0; @@ -21,13 +21,13 @@ void lect() if(bincod[range%place] != bincod[(range+1)%place]) { if(isSH3()) - { - *(volatile unsigned char*)SH7337_SCPDR ^= 0x01; - } + { + *(volatile unsigned char*)SH7337_SCPDR ^= 0x01; + } else - { - *(volatile unsigned char*)SH7305_PJDR ^= 0x04; - } + { + *(volatile unsigned char*)SH7305_PJDR ^= 0x04; + } } range++; } @@ -46,16 +46,18 @@ int main(void) while(1) { - dclear(); + dclear(); - dprint(1, 1, "%d", freq); - dprint(1, 10, "%s , %d", bincod, place); + dprint(1, 1, "%d", freq); + dprint(1, 10, "%s", bincod); + dprint(1, 20, "%d", place); + dtext(1, 50, "F1 _ F2 -"); - dupdate(); + dupdate(); - key=getkey(); + key=getkey(); - switch(key) + switch(key) { case KEY_RIGHT : freq+=1; break; case KEY_LEFT : freq-=1; break; @@ -67,11 +69,11 @@ int main(void) case KEY_DEL : place=(place>0 ? place - 1 : 0); *(bincod+place) = 0; range = 0; break; case KEY_EXE : - timer_start(TIMER_USER, freq*place, Clock_Hz, lect, 2*freq*place); + timer_start(TIMER_USER, freq*place, Clock_Hz, lect, 2*freq*place); break; case KEY_EXIT : - timer_stop(TIMER_USER); + timer_stop(TIMER_USER); return 1; }