mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
sound: Correct data output in sound_create_square_wave()
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>
This commit is contained in:
parent
68c81fb665
commit
03f11e87a8
1 changed files with 0 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue