aboutsummaryrefslogtreecommitdiffstats
path: root/demos/modules/gaudio/oscilloscope/gwinosc.c
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@unormal.org>2014-04-20 10:41:53 +0200
committerJoel Bodenmann <joel@unormal.org>2014-04-20 10:41:53 +0200
commitc88e25b84fa8d18942df56592cec68f8371a8d41 (patch)
tree0c13a89e07560b79ea0092a25f75b7cf630a903f /demos/modules/gaudio/oscilloscope/gwinosc.c
parentad1d70d2957d95161c831e764c6f81c84c332458 (diff)
parent33babb4c1a5b749faac6969681e8deff481c4344 (diff)
downloaduGFX-c88e25b84fa8d18942df56592cec68f8371a8d41.tar.gz
uGFX-c88e25b84fa8d18942df56592cec68f8371a8d41.tar.bz2
uGFX-c88e25b84fa8d18942df56592cec68f8371a8d41.zip
Merge branch 'master' of https://bitbucket.org/Tectu/ugfx into gwin
Diffstat (limited to 'demos/modules/gaudio/oscilloscope/gwinosc.c')
-rw-r--r--demos/modules/gaudio/oscilloscope/gwinosc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/demos/modules/gaudio/oscilloscope/gwinosc.c b/demos/modules/gaudio/oscilloscope/gwinosc.c
index 21a83760..6b51232b 100644
--- a/demos/modules/gaudio/oscilloscope/gwinosc.c
+++ b/demos/modules/gaudio/oscilloscope/gwinosc.c
@@ -96,7 +96,7 @@ GHandle gwinGScopeCreate(GDisplay *g, GScopeObject *gs, GWindowInit *pInit, uint
void gwinScopeWaitForTrace(GHandle gh) {
#define gs ((GScopeObject *)(gh))
- GAudioData *paud;
+ GDataBuffer *paud;
int i;
coord_t x, y;
coord_t yoffset;
@@ -144,10 +144,10 @@ void gwinScopeWaitForTrace(GHandle gh) {
scopemin = 0;
#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 */
- if (gs->format <= 8)
+ if (gfxSampleFormatBits(gs->format) <= 8)
y = yoffset - (((coord_t)(*pa8++ ) << shr) >> (16-SCOPE_Y_BITS));
else
y = yoffset - (((coord_t)(*pa16++) << shr) >> (16-SCOPE_Y_BITS));
@@ -216,6 +216,6 @@ void gwinScopeWaitForTrace(GHandle gh) {
gs->scopemin = scopemin;
#endif
- gaudioReleaseBuffer(paud);
+ gfxBufferRelease(paud);
#undef gs
}