the default magnitude is not initialized properly which can lead to very
quite tones (inaudible actually), so i've set the default value to 100
(since that's about half way between the min and max). i also fixed up
the headers to pull in proper ones for prototypes and such, and touched
up the usage to document the -m option and more accurately describe the
-f flag.
Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]>
---
Index: user/play/tone.c
===
RCS file: /usr/local/src/uClinux/local-cvs/,v/user/play/tone.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 tone.c
--- user/play/tone.c15 Jun 2007 05:02:14 - 1.1.1.1
+++ user/play/tone.c19 Jun 2007 23:19:00 -
@@ -14,7 +14,9 @@
#include
#include
#include
-#include
+#include
+#include
+#include
#include
@@ -143,14 +145,15 @@ char *wavnames[] = {
void usage(int rc)
{
- printf("usage: tone [-?hsqrwe] [-f replay-freq] [wave-freq]\n\n"
+ printf("usage: tone [-?hsqrwe] [-m magnitude] [-f sample-freq]
[wave-freq]\n\n"
"\t-h?\tthis help\n"
"\t-s\tsine wave output\n"
"\t-q\tsquare wave output\n"
"\t-r\tramp wave output\n"
"\t-w\tsawtooth wave output\n"
"\t-e\toutput big-endian data\n"
- "\t-f\tfrequency of replay engine\n");
+ "\t-m\tmagnitude of wave (0 <= x <= 256)\n"
+ "\t-f\tsampling frequency\n");
exit(rc);
}
@@ -161,6 +164,7 @@ int main(int argc, char *argv[])
int ofd, i, c, size, mag, endian;
int replayfreq, wavefreq, wavetyp;
+ mag = 100;
replayfreq = 48000;
wavetyp = SINE;
wavefreq = 1000;
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev