From 7fbfde42aabbcd30cffba2fba35158236c0a6c6c Mon Sep 17 00:00:00 2001 From: inmarket Date: Sat, 25 May 2013 01:26:52 +1000 Subject: GOS module, for operating system independance GMISC fast floating point trig GMISC fast fixed point trig --- demos/modules/gaudin/gwinosc.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'demos/modules/gaudin/gwinosc.c') diff --git a/demos/modules/gaudin/gwinosc.c b/demos/modules/gaudin/gwinosc.c index 5a2867c1..82ed4b44 100644 --- a/demos/modules/gaudin/gwinosc.c +++ b/demos/modules/gaudin/gwinosc.c @@ -37,10 +37,7 @@ * correctly if we were really building something generic. */ -#include "ch.h" -#include "hal.h" #include "gfx.h" - #include "gwinosc.h" /* Include internal GWIN routines so we can build our own superset class */ @@ -62,11 +59,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(NULL, 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(NULL, AUDIOBUFSZ * sizeof(adcsample_t)))) return 0; #if TRIGGER_METHOD == TRIGGER_POSITIVERAMP gs->lasty = gs->gwin.height/2; @@ -100,7 +97,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 -- cgit v1.2.3