diff --git a/include/sound4calc.h b/include/sound4calc.h index c9d213c..73ee0a1 100644 --- a/include/sound4calc.h +++ b/include/sound4calc.h @@ -1,14 +1,15 @@ #ifndef _SOUND4CALC_H #define _SOUND4CALC_H -extern char wave_signal[25]; // simple waveform* -extern unsigned short duration; // equivalent as 2000 ms duration sound +extern char wave_signal[25]; +extern unsigned short duration; extern unsigned int freq; void CallSequence(); void PutPinState(char level); void PlayNote(); void InitPorts(); +void StopTimer(); //SH4 addresses #define SH7305_PJCR 0xA4050110 diff --git a/src/main.c b/src/main.c index 7aa12c1..7b5b4fc 100644 --- a/src/main.c +++ b/src/main.c @@ -44,7 +44,7 @@ int main(void) case KEY_F2 : CallSequence(); break; case KEY_EXIT : - timer_stop(TIMER_USER); + StopTimer(); return 1; } } diff --git a/src/sound4calc.c b/src/sound4calc.c index 78e4e3f..6a4b3fe 100644 --- a/src/sound4calc.c +++ b/src/sound4calc.c @@ -49,6 +49,10 @@ void CallNote() timer_start(TIMER_USER, freq * wavelength, Clock_Hz, PlayNote, freq * duration / 1000); } +void StopTimer() +{ + timer_stop(TIMER_USER); +} /* PlayNote() allow to make different waveforms with '-' and '_'