diff options
Diffstat (limited to 'demos/modules/gaudin')
-rw-r--r-- | demos/modules/gaudin/gfxconf.h | 5 | ||||
-rw-r--r-- | demos/modules/gaudin/gwinosc.c | 11 | ||||
-rw-r--r-- | demos/modules/gaudin/gwinosc.h | 2 | ||||
-rw-r--r-- | demos/modules/gaudin/main.c | 7 |
4 files changed, 11 insertions, 14 deletions
diff --git a/demos/modules/gaudin/gfxconf.h b/demos/modules/gaudin/gfxconf.h index d9db73a5..01981087 100644 --- a/demos/modules/gaudin/gfxconf.h +++ b/demos/modules/gaudin/gfxconf.h @@ -33,6 +33,11 @@ #ifndef _GFXCONF_H #define _GFXCONF_H +/* The operating system to use - one of these must be defined */ +#define GFX_USE_OS_CHIBIOS TRUE +#define GFX_USE_OS_WIN32 FALSE +#define GFX_USE_OS_POSIX FALSE + /* GFX sub-systems to turn on */ #define GFX_USE_GDISP TRUE #define GFX_USE_TDISP FALSE 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 diff --git a/demos/modules/gaudin/gwinosc.h b/demos/modules/gaudin/gwinosc.h index 9c51e548..d696e276 100644 --- a/demos/modules/gaudin/gwinosc.h +++ b/demos/modules/gaudin/gwinosc.h @@ -63,7 +63,7 @@ typedef struct GScopeObject_t { GWindowObject gwin; // Base Class coord_t *lastscopetrace; // To store last scope trace - BinarySemaphore bsem; // We get signalled on this + gfxSem bsem; // We get signalled on this audin_sample_t *audiobuf; // To store audio samples GEventAudioIn myEvent; // Information on received samples coord_t nextx; // Where we are up to diff --git a/demos/modules/gaudin/main.c b/demos/modules/gaudin/main.c index f532b324..a647d4af 100644 --- a/demos/modules/gaudin/main.c +++ b/demos/modules/gaudin/main.c @@ -31,8 +31,6 @@ * * It also demonstrates how to write your own custom GWIN window type. */ -#include "ch.h" -#include "hal.h" #include "gfx.h" /* Include our custom gwin audio oscilloscope */ @@ -52,10 +50,7 @@ int main(void) { GHandle ghScope; coord_t swidth, sheight; - halInit(); - chSysInit(); - gdispInit(); - gdispClear(Black); + gfxInit(); /* Get the screen dimensions */ swidth = gdispGetWidth(); |