aboutsummaryrefslogtreecommitdiffstats
path: root/demos/modules/gdisp
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/gdisp
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/gdisp')
-rw-r--r--demos/modules/gdisp/gdisp_basics/gfxconf.h9
-rw-r--r--demos/modules/gdisp/gdisp_basics/main.c10
-rw-r--r--demos/modules/gdisp/gdisp_circles/gfxconf.h9
-rw-r--r--demos/modules/gdisp/gdisp_circles/main.c10
-rw-r--r--demos/modules/gdisp/gdisp_images/gfxconf.h16
-rw-r--r--demos/modules/gdisp/gdisp_images/main.c10
-rw-r--r--demos/modules/gdisp/gdisp_images_animated/gfxconf.h16
-rw-r--r--demos/modules/gdisp/gdisp_images_animated/main.c14
-rw-r--r--demos/modules/gdisp/gdisp_text/gfxconf.h9
-rw-r--r--demos/modules/gdisp/gdisp_text/main.c10
10 files changed, 38 insertions, 75 deletions
diff --git a/demos/modules/gdisp/gdisp_basics/gfxconf.h b/demos/modules/gdisp/gdisp_basics/gfxconf.h
index f64884a0..b632f6e0 100644
--- a/demos/modules/gdisp/gdisp_basics/gfxconf.h
+++ b/demos/modules/gdisp/gdisp_basics/gfxconf.h
@@ -28,12 +28,13 @@
#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 FALSE
-#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/gdisp/gdisp_basics/main.c b/demos/modules/gdisp/gdisp_basics/main.c
index 134f2473..d7a1b5e3 100644
--- a/demos/modules/gdisp/gdisp_basics/main.c
+++ b/demos/modules/gdisp/gdisp_basics/main.c
@@ -25,20 +25,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "ch.h"
-#include "hal.h"
#include "gfx.h"
int main(void) {
coord_t width, height;
coord_t i, j;
- halInit();
- chSysInit();
-
/* Initialize and clear the display */
- gdispInit();
- gdispClear(Black);
+ gfxInit();
// Get the screen size
width = gdispGetWidth();
@@ -53,7 +47,7 @@ int main(void) {
gdispDrawPixel (i, j, White);
while(TRUE) {
- chThdSleepMilliseconds(500);
+ gfxSleepMilliseconds(500);
}
}
diff --git a/demos/modules/gdisp/gdisp_circles/gfxconf.h b/demos/modules/gdisp/gdisp_circles/gfxconf.h
index cc60c46b..cd7515d9 100644
--- a/demos/modules/gdisp/gdisp_circles/gfxconf.h
+++ b/demos/modules/gdisp/gdisp_circles/gfxconf.h
@@ -28,12 +28,13 @@
#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 FALSE
-#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/gdisp/gdisp_circles/main.c b/demos/modules/gdisp/gdisp_circles/main.c
index 395af009..3a9675bb 100644
--- a/demos/modules/gdisp/gdisp_circles/main.c
+++ b/demos/modules/gdisp/gdisp_circles/main.c
@@ -25,19 +25,13 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "ch.h"
-#include "hal.h"
#include "gfx.h"
int main(void) {
coord_t width, height;
- halInit();
- chSysInit();
-
/* Initialize and clear the display */
- gdispInit();
- gdispClear(Black);
+ gfxInit();
// Get the screen size
width = gdispGetWidth();
@@ -52,7 +46,7 @@ int main(void) {
gdispFillArc(width/8, height/8, 30, 10, 70, Gray);
while(TRUE) {
- chThdSleepMilliseconds(500);
+ gfxSleepMilliseconds(500);
}
}
diff --git a/demos/modules/gdisp/gdisp_images/gfxconf.h b/demos/modules/gdisp/gdisp_images/gfxconf.h
index e76ddd72..866f3ba7 100644
--- a/demos/modules/gdisp/gdisp_images/gfxconf.h
+++ b/demos/modules/gdisp/gdisp_images/gfxconf.h
@@ -28,12 +28,13 @@
#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 FALSE
-#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
@@ -65,11 +66,4 @@
#define GDISP_NEED_IMAGE_JPG FALSE
#define GDISP_NEED_IMAGE_PNG FALSE
-/* Features for the GWIN sub-system. */
-#define GWIN_NEED_BUTTON FALSE
-#define GWIN_NEED_CONSOLE FALSE
-
-/* Features for the GINPUT sub-system. */
-#define GINPUT_NEED_MOUSE FALSE
-
#endif /* _GFXCONF_H */
diff --git a/demos/modules/gdisp/gdisp_images/main.c b/demos/modules/gdisp/gdisp_images/main.c
index a6fa58d8..3fc20490 100644
--- a/demos/modules/gdisp/gdisp_images/main.c
+++ b/demos/modules/gdisp/gdisp_images/main.c
@@ -25,8 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "ch.h"
-#include "hal.h"
#include "gfx.h"
#ifdef WIN32
@@ -44,11 +42,7 @@ static gdispImage myImage;
int main(void) {
coord_t swidth, sheight;
- halInit(); // Initialize the Hardware
- chSysInit(); // Initialize the OS
- gdispInit(); // Initialize the display
-
- gdispClear(Black);
+ gfxInit(); // Initialize the display
// Get the display dimensions
swidth = gdispGetWidth();
@@ -66,7 +60,7 @@ int main(void) {
gdispImageClose(&myImage);
while(1) {
- chThdSleepMilliseconds(1000);
+ gfxSleepMilliseconds(1000);
}
return 0;
diff --git a/demos/modules/gdisp/gdisp_images_animated/gfxconf.h b/demos/modules/gdisp/gdisp_images_animated/gfxconf.h
index cd368e95..9a734924 100644
--- a/demos/modules/gdisp/gdisp_images_animated/gfxconf.h
+++ b/demos/modules/gdisp/gdisp_images_animated/gfxconf.h
@@ -9,12 +9,13 @@
#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 FALSE
-#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
@@ -47,11 +48,4 @@
#define GDISP_NEED_IMAGE_PNG FALSE
#define GDISP_NEED_IMAGE_ACCOUNTING FALSE
-/* Features for the GWIN sub-system. */
-#define GWIN_NEED_BUTTON FALSE
-#define GWIN_NEED_CONSOLE FALSE
-
-/* Features for the GINPUT sub-system. */
-#define GINPUT_NEED_MOUSE FALSE
-
#endif /* _GFXCONF_H */
diff --git a/demos/modules/gdisp/gdisp_images_animated/main.c b/demos/modules/gdisp/gdisp_images_animated/main.c
index d5c3d712..8502dcf9 100644
--- a/demos/modules/gdisp/gdisp_images_animated/main.c
+++ b/demos/modules/gdisp/gdisp_images_animated/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"
#define USE_IMAGE_CACHE FALSE // Only if you want to get performance at the expense of RAM
@@ -51,11 +49,9 @@ static gdispImage myImage;
*/
int main(void) {
coord_t swidth, sheight;
- systime_t delay;
+ delaytime_t delay;
- halInit(); // Initialize the Hardware
- chSysInit(); // Initialize the OS
- gdispInit(); // Initialize the display
+ gfxInit(); // Initialize the display
gdispClear(MY_BG_COLOR);
@@ -67,7 +63,7 @@ int main(void) {
#if USE_MEMORY_FILE
gdispImageSetMemoryReader(&myImage, testanim);
#else
- gdispImageSetSimulFileReader(&myImage, "testanim.gif");
+ gdispImageSetFileReader(&myImage, "testanim.gif");
#endif
if (gdispImageOpen(&myImage) == GDISP_IMAGE_ERR_OK) {
@@ -87,14 +83,14 @@ int main(void) {
}
SHOW_ERROR(Yellow);
if (delay != TIME_IMMEDIATE)
- chThdSleepMilliseconds(delay);
+ gfxSleepMilliseconds(delay);
}
gdispImageClose(&myImage);
} else
SHOW_ERROR(Red);
while(1) {
- chThdSleepMilliseconds(1000);
+ gfxSleepMilliseconds(1000);
}
return 0;
diff --git a/demos/modules/gdisp/gdisp_text/gfxconf.h b/demos/modules/gdisp/gdisp_text/gfxconf.h
index 007de8e4..01fc2749 100644
--- a/demos/modules/gdisp/gdisp_text/gfxconf.h
+++ b/demos/modules/gdisp/gdisp_text/gfxconf.h
@@ -28,12 +28,13 @@
#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 FALSE
-#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/gdisp/gdisp_text/main.c b/demos/modules/gdisp/gdisp_text/main.c
index 4062e07c..042ccc5b 100644
--- a/demos/modules/gdisp/gdisp_text/main.c
+++ b/demos/modules/gdisp/gdisp_text/main.c
@@ -25,8 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "ch.h"
-#include "hal.h"
#include "gfx.h"
int main(void) {
@@ -34,12 +32,8 @@ int main(void) {
font_t font1, font2, font3, font4;
const char *msg;
- halInit();
- chSysInit();
-
/* Initialize and clear the display */
- gdispInit();
- gdispClear(Black);
+ gfxInit();
// Get the screen size
width = gdispGetWidth();
@@ -73,7 +67,7 @@ int main(void) {
// Wait forever
while(TRUE) {
- chThdSleepMilliseconds(500);
+ gfxSleepMilliseconds(500);
}
}