summaryrefslogtreecommitdiff
path: root/firmware/test/uart/uarttest.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/test/uart/uarttest.c')
-rw-r--r--firmware/test/uart/uarttest.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/firmware/test/uart/uarttest.c b/firmware/test/uart/uarttest.c
new file mode 100644
index 0000000..fb6822c
--- /dev/null
+++ b/firmware/test/uart/uarttest.c
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/***************************************************************************
+ * uarttest.c
+ *
+ * Sun Dec 21 20:46:19 CET 2014
+ * Copyright 2014 Bent Bisballe Nyeng
+ * deva@aasimon.org
+ ****************************************************************************/
+
+/*
+ * This file is part of Pedal2Metal.
+ *
+ * Pedal2Metal is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Pedal2Metal is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Pedal2Metal; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+#include "../test.h"
+
+// For SystemCoreClock
+#include <LPC17xx.h>
+
+//#include <uart.h>
+#include <cli.h>
+/*
+volatile unsigned int temp;
+static void _delay(unsigned int del)
+{
+ for(unsigned int i = 0; i < del; i++) temp = i;
+}
+*/
+int main (void)
+{
+ //led_init();
+
+ cli_init();
+
+ cli_printf("\rWelcome to the amazing Pedal 2 Metal version zero dot dut!\n");
+ //cli_printf("clk: %d\n", SystemCoreClock);
+
+ int cnt = 0;
+ while(1) {
+ char cmd[256];
+ int sz = sizeof(cmd);
+ while(sz == sizeof(cmd)) {
+ cli_printf("# ");
+ sz = cli_readline(cmd, sizeof(cmd));
+ }
+ cli_printf("\n");
+
+ cli_printf("command %d: '%s' (%d)\n", cnt++, cmd, sz);
+ //for(int i = 0; i < sz; i++) cli_printf("%c\t(%d)\n", cmd[i], (int)cmd[i]);
+ }
+}