aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@unormal.org>2012-12-20 19:50:02 +0100
committerJoel Bodenmann <joel@unormal.org>2012-12-20 19:50:02 +0100
commit2df6eaf2fdd5064b410369cc67b614362a63dde2 (patch)
treeb4f66b8d698bb350caf3f9da4b16db16a3cc8dc6 /demos
parentbee9002fcc323e76c9e243424c48f52847f72b67 (diff)
downloaduGFX-2df6eaf2fdd5064b410369cc67b614362a63dde2.tar.gz
uGFX-2df6eaf2fdd5064b410369cc67b614362a63dde2.tar.bz2
uGFX-2df6eaf2fdd5064b410369cc67b614362a63dde2.zip
small demo code cleanup
Diffstat (limited to 'demos')
-rw-r--r--demos/modules/gdisp_basics/main.c7
-rw-r--r--demos/modules/gdisp_circles/main.c1
-rw-r--r--demos/modules/gdisp_text/main.c3
3 files changed, 6 insertions, 5 deletions
diff --git a/demos/modules/gdisp_basics/main.c b/demos/modules/gdisp_basics/main.c
index e18b0e9e..fa0bef45 100644
--- a/demos/modules/gdisp_basics/main.c
+++ b/demos/modules/gdisp_basics/main.c
@@ -39,9 +39,10 @@ int main(void) {
// Code Here
gdispDrawBox(10, 10, width/2, height/2, Yellow);
- gdispFillArea (width/2, height/2, width/2-10, height/2-10, Blue);
- gdispDrawLine (5, 30, width-50, height-40, Red);
- for(i=5, j=0; i < width && j < height; i+=7, j+=i/20)
+ gdispFillArea(width/2, height/2, width/2-10, height/2-10, Blue);
+ gdispDrawLine(5, 30, width-50, height-40, Red);
+
+ for(i = 5, j = 0; i < width && j < height; i += 7, j += i/20)
gdispDrawPixel (i, j, White);
while(TRUE) {
diff --git a/demos/modules/gdisp_circles/main.c b/demos/modules/gdisp_circles/main.c
index d682a6ff..45764d4f 100644
--- a/demos/modules/gdisp_circles/main.c
+++ b/demos/modules/gdisp_circles/main.c
@@ -44,7 +44,6 @@ int main(void) {
gdispDrawArc(width-width/8, height/8, 30, 10, 70, Gray);
gdispFillArc(width/8, height/8, 30, 10, 70, Gray);
-
while(TRUE) {
chThdSleepMilliseconds(500);
}
diff --git a/demos/modules/gdisp_text/main.c b/demos/modules/gdisp_text/main.c
index 907e84be..4dc45f71 100644
--- a/demos/modules/gdisp_text/main.c
+++ b/demos/modules/gdisp_text/main.c
@@ -25,7 +25,7 @@
int main(void) {
coord_t width, height;
font_t font1, font2, font3, font4;
- const char *msg;
+ const char *msg;
halInit();
chSysInit();
@@ -47,6 +47,7 @@ int main(void) {
// Display large numbers on the right (measuring the string)
msg = "123456";
gdispDrawString(width-gdispGetStringWidth(msg, font4)-3, 3, msg, font4, Green);
+
// Display the font name under it.
msg = gdispGetFontName(font4);
gdispDrawString(width-gdispGetStringWidth(msg, font1)-3, 20, msg, font1, Green);