aboutsummaryrefslogtreecommitdiffstats
path: root/demos/modules/gwin
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2013-05-25 01:26:52 +1000
committerinmarket <andrewh@inmarket.com.au>2013-05-25 01:26:52 +1000
commit7fbfde42aabbcd30cffba2fba35158236c0a6c6c (patch)
treee85c90a4f21974b706315d64209021e0b2bde764 /demos/modules/gwin
parent42006a67b5ccfd86f30d8a91cc474681c437eaf6 (diff)
downloaduGFX-7fbfde42aabbcd30cffba2fba35158236c0a6c6c.tar.gz
uGFX-7fbfde42aabbcd30cffba2fba35158236c0a6c6c.tar.bz2
uGFX-7fbfde42aabbcd30cffba2fba35158236c0a6c6c.zip
GOS module, for operating system independance
GMISC fast floating point trig GMISC fast fixed point trig
Diffstat (limited to 'demos/modules/gwin')
-rw-r--r--demos/modules/gwin/basic/gfxconf.h8
-rw-r--r--demos/modules/gwin/basic/main.c8
-rw-r--r--demos/modules/gwin/console/gfxconf.h8
-rw-r--r--demos/modules/gwin/console/main.c12
-rw-r--r--demos/modules/gwin/slider/gfxconf.h5
-rw-r--r--demos/modules/gwin/slider/main.c8
6 files changed, 21 insertions, 28 deletions
diff --git a/demos/modules/gwin/basic/gfxconf.h b/demos/modules/gwin/basic/gfxconf.h
index e567e5a0..dd8376bf 100644
--- a/demos/modules/gwin/basic/gfxconf.h
+++ b/demos/modules/gwin/basic/gfxconf.h
@@ -9,12 +9,14 @@
#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_GWIN TRUE
-#define GFX_USE_GEVENT FALSE
-#define GFX_USE_GTIMER FALSE
-#define GFX_USE_GINPUT FALSE
/* Features for the GDISP sub-system. */
#define GDISP_NEED_VALIDATION TRUE
diff --git a/demos/modules/gwin/basic/main.c b/demos/modules/gwin/basic/main.c
index a0326fac..624eed18 100644
--- a/demos/modules/gwin/basic/main.c
+++ b/demos/modules/gwin/basic/main.c
@@ -18,20 +18,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ch.h"
-#include "hal.h"
#include "gfx.h"
/* The handles for our two Windows */
GHandle GW1, GW2;
int main(void) {
- halInit();
- chSysInit();
coord_t i, j;
/* Initialize and clear the display */
- gdispInit();
+ gfxInit();
gdispClear(Lime);
/* Create two windows */
@@ -61,7 +57,7 @@ int main(void) {
gwinFillCircle(GW2, 20, 20, 15);
while(TRUE) {
- chThdSleepMilliseconds(500);
+ gfxSleepMilliseconds(500);
}
}
diff --git a/demos/modules/gwin/console/gfxconf.h b/demos/modules/gwin/console/gfxconf.h
index 178beb86..46361c9b 100644
--- a/demos/modules/gwin/console/gfxconf.h
+++ b/demos/modules/gwin/console/gfxconf.h
@@ -9,12 +9,14 @@
#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_GWIN TRUE
-#define GFX_USE_GEVENT FALSE
-#define GFX_USE_GTIMER FALSE
-#define GFX_USE_GINPUT FALSE
/* Features for the GDISP sub-system. */
#define GDISP_NEED_VALIDATION TRUE
diff --git a/demos/modules/gwin/console/main.c b/demos/modules/gwin/console/main.c
index 90ebf86f..d968b920 100644
--- a/demos/modules/gwin/console/main.c
+++ b/demos/modules/gwin/console/main.c
@@ -18,10 +18,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ch.h"
-#include "hal.h"
-#include "chprintf.h"
#include "gfx.h"
+#include "chprintf.h"
/* The handles for our three consoles */
GHandle GW1, GW2, GW3;
@@ -33,12 +31,8 @@ int main(void) {
uint8_t i;
font_t font1, font2;
- halInit();
- chSysInit();
-
/* initialize and clear the display */
- gdispInit();
- gdispClear(Black);
+ gfxInit();
font1 = gdispOpenFont("UI2 Double");
font2 = gdispOpenFont("Small");
@@ -81,7 +75,7 @@ int main(void) {
}
while(TRUE) {
- chThdSleepMilliseconds(500);
+ gfxSleepMilliseconds(500);
}
}
diff --git a/demos/modules/gwin/slider/gfxconf.h b/demos/modules/gwin/slider/gfxconf.h
index 947fc4c8..84698905 100644
--- a/demos/modules/gwin/slider/gfxconf.h
+++ b/demos/modules/gwin/slider/gfxconf.h
@@ -9,6 +9,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_GWIN TRUE
diff --git a/demos/modules/gwin/slider/main.c b/demos/modules/gwin/slider/main.c
index 19a56f6a..f1d4248d 100644
--- a/demos/modules/gwin/slider/main.c
+++ b/demos/modules/gwin/slider/main.c
@@ -18,8 +18,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ch.h"
-#include "hal.h"
#include "gfx.h"
#include "chprintf.h"
@@ -35,11 +33,7 @@ int main(void) {
GEventGWinSlider * pSliderEvent;
BaseSequentialStream *consout;
- halInit(); // Initialize the Hardware
- chSysInit(); // Initialize the OS
- gdispInit(); // Initialize the display
-
- gdispClear(Black);
+ gfxInit(); // Initialize the display
// Get the display dimensions
swidth = gdispGetWidth();