projects
/
oweals
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
68c81fb
)
sound: Correct data output in sound_create_square_wave()
author
Simon Glass
<sjg@chromium.org>
Fri, 16 Nov 2018 02:56:12 +0000
(19:56 -0700)
committer
Simon Glass
<sjg@chromium.org>
Thu, 29 Nov 2018 16:30:05 +0000
(09:30 -0700)
This function currently outputs twice as much data as it should and
overwrites its buffer as a result. Fix it.
Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/sound/sound.c
patch
|
blob
|
history
diff --git
a/drivers/sound/sound.c
b/drivers/sound/sound.c
index 969408186fd8f1a2c0bf049a1fc5c113ed8c3df5..6c1eb4c19cc3fad00f727241544213ceaec99507 100644
(file)
--- a/
drivers/sound/sound.c
+++ b/
drivers/sound/sound.c
@@
-25,12
+25,10
@@
void sound_create_square_wave(unsigned short *data, int size, uint32_t freq)
for (i = 0; size && i < half; i++) {
size -= 2;
*data++ = amplitude;
- *data++ = amplitude;
}
for (i = 0; size && i < period - half; i++) {
size -= 2;
*data++ = -amplitude;
- *data++ = -amplitude;
}
}
}