Bug fixes and comments in audio recording demo
This commit is contained in:
parent
c354639f7b
commit
9919aeac89
2 changed files with 11 additions and 6 deletions
|
@ -144,10 +144,10 @@ void gwinScopeWaitForTrace(GHandle gh) {
|
||||||
scopemin = 0;
|
scopemin = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for(i = paud->len/(gfxSampleFormatBits(gs->format)/8); i; i--) {
|
for(i = paud->len/((gfxSampleFormatBits(gs->format)+7)/8); i; i--) {
|
||||||
|
|
||||||
/* Calculate the new scope value - re-scale using simple shifts for efficiency, re-center and y-invert */
|
/* Calculate the new scope value - re-scale using simple shifts for efficiency, re-center and y-invert */
|
||||||
if (gs->format <= 8)
|
if (gfxSampleFormatBits(gs->format) <= 8)
|
||||||
y = yoffset - (((coord_t)(*pa8++ ) << shr) >> (16-SCOPE_Y_BITS));
|
y = yoffset - (((coord_t)(*pa8++ ) << shr) >> (16-SCOPE_Y_BITS));
|
||||||
else
|
else
|
||||||
y = yoffset - (((coord_t)(*pa16++) << shr) >> (16-SCOPE_Y_BITS));
|
y = yoffset - (((coord_t)(*pa16++) << shr) >> (16-SCOPE_Y_BITS));
|
||||||
|
|
|
@ -55,10 +55,15 @@ int main(void) {
|
||||||
|
|
||||||
gfxInit();
|
gfxInit();
|
||||||
|
|
||||||
// Allocate audio buffers - 4 x 128 byte buffers.
|
/**
|
||||||
// You may need to increase this for slower cpu's.
|
* Allocate audio buffers - eg. 4 x 128 byte buffers.
|
||||||
// You may be able to decrease this for low latency operating systems.
|
* You may need to increase this for slower cpu's.
|
||||||
gfxBufferAlloc(4, 128);
|
* You may be able to decrease this for low latency operating systems.
|
||||||
|
* 16 x 256 seems to work on the really slow Olimex SAM7EX256 board (display speed limitation) @8kHz
|
||||||
|
* If your oscilloscope display stops then it is likely that your driver has stalled due to running
|
||||||
|
* out of free buffers. Increase the number of buffers..
|
||||||
|
*/
|
||||||
|
gfxBufferAlloc(16, 256);
|
||||||
|
|
||||||
/* Get the screen dimensions */
|
/* Get the screen dimensions */
|
||||||
swidth = gdispGetWidth();
|
swidth = gdispGetWidth();
|
||||||
|
|
Loading…
Add table
Reference in a new issue