aboutsummaryrefslogtreecommitdiffstats
path: root/demos/console/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'demos/console/main.c')
-rwxr-xr-xdemos/console/main.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/demos/console/main.c b/demos/console/main.c
new file mode 100755
index 00000000..c629e2cd
--- /dev/null
+++ b/demos/console/main.c
@@ -0,0 +1,30 @@
+#include "ch.h"
+#include "hal.h"
+#include "glcd.h"
+#include "test.h"
+#include "console.h"
+
+static GLCDDriver GLCDD1;
+static GLCDConsole CON1;
+
+int main(void) {
+ halInit();
+ chSysInit();
+
+ // init LCD and clear it
+ lcdInit(&GLCDD1);
+ lcdClear(Black);
+
+ // init console
+ lcdConsoleInit(&CON1, 0, 0, lcdGetWidth(), lcdGetHeight(), font_Small, Black, White);
+
+ // use test thread for console output
+ TestThread((BaseSequentialStream*)&CON1);
+
+ while (TRUE) {
+
+ chThdSleepMilliseconds(200);
+ }
+
+ return 0;
+}