diff options
| author | Andrew Hannam <andrewh@inmarket.com.au> | 2013-05-24 08:41:48 -0700 |
|---|---|---|
| committer | Andrew Hannam <andrewh@inmarket.com.au> | 2013-05-24 08:41:48 -0700 |
| commit | f0569e2555b3a7f2afe05cc42e4dd0982b179167 (patch) | |
| tree | e85c90a4f21974b706315d64209021e0b2bde764 /demos/modules/gadc/gwinosc.c | |
| parent | 5f2a32714cda6bcfc8829e61895def2f627e1b8f (diff) | |
| parent | 7fbfde42aabbcd30cffba2fba35158236c0a6c6c (diff) | |
| download | uGFX-f0569e2555b3a7f2afe05cc42e4dd0982b179167.tar.gz uGFX-f0569e2555b3a7f2afe05cc42e4dd0982b179167.tar.bz2 uGFX-f0569e2555b3a7f2afe05cc42e4dd0982b179167.zip | |
Merge pull request #73 from inmarket/master
GOS module for OS independance, GMISC additions
Diffstat (limited to 'demos/modules/gadc/gwinosc.c')
| -rw-r--r-- | demos/modules/gadc/gwinosc.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/demos/modules/gadc/gwinosc.c b/demos/modules/gadc/gwinosc.c index 49d9fe22..589fdb9e 100644 --- a/demos/modules/gadc/gwinosc.c +++ b/demos/modules/gadc/gwinosc.c @@ -30,10 +30,7 @@ * * This GWIN superset implements a simple audio oscilloscope using the GADC high speed device. */ -#include "ch.h" -#include "hal.h" #include "gfx.h" - #include "gwinosc.h" /* Include internal GWIN routines so we can build our own superset class */ @@ -55,11 +52,11 @@ GHandle gwinCreateScope(GScopeObject *gs, coord_t x, coord_t y, coord_t cx, coor /* Initialise the scope object members and allocate memory for buffers */ gs->gwin.type = GW_SCOPE; - chBSemInit(&gs->bsem, TRUE); + gfxSemInit(&gs->bsem, 0, 1); gs->nextx = 0; - if (!(gs->lastscopetrace = (coord_t *)chHeapAlloc(NULL, gs->gwin.width * sizeof(coord_t)))) + if (!(gs->lastscopetrace = (coord_t *)gfxAlloc(gs->gwin.width * sizeof(coord_t)))) return 0; - if (!(gs->audiobuf = (adcsample_t *)chHeapAlloc(NULL, AUDIOBUFSZ * sizeof(adcsample_t)))) + if (!(gs->audiobuf = (adcsample_t *)gfxAlloc(AUDIOBUFSZ * sizeof(adcsample_t)))) return 0; #if TRIGGER_METHOD == TRIGGER_POSITIVERAMP gs->lasty = gs->gwin.height/2; @@ -93,7 +90,7 @@ void gwinWaitForScopeTrace(GHandle gh) { #endif /* Wait for a set of audio conversions */ - chBSemWait(&gs->bsem); + gfxSemWait(&gs->bsem, TIME_INFINITE); /* Ensure we are drawing in the right area */ #if GDISP_NEED_CLIP |
