]> rtime.felk.cvut.cz Git - sysless.git/commitdiff
Added blink test for MCB1760 development board with lpc17cmsis
authorJiri Kubias <jiri.kubias@addat.cz>
Fri, 25 Feb 2011 15:52:28 +0000 (16:52 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 25 Feb 2011 21:33:28 +0000 (22:33 +0100)
board/arm/lpc17cmsis-mbed/test/mcb1760/Makefile [new file with mode: 0644]
board/arm/lpc17cmsis-mbed/test/mcb1760/Makefile.omk [new file with mode: 0644]
board/arm/lpc17cmsis-mbed/test/mcb1760/main.c [new file with mode: 0644]

diff --git a/board/arm/lpc17cmsis-mbed/test/mcb1760/Makefile b/board/arm/lpc17cmsis-mbed/test/mcb1760/Makefile
new file mode 100644 (file)
index 0000000..76b56fd
--- /dev/null
@@ -0,0 +1,14 @@
+# Generic directory or leaf node makefile for OCERA make framework
+
+ifndef MAKERULES_DIR
+MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
+endif
+
+ifeq ($(MAKERULES_DIR),)
+all : default
+.DEFAULT::
+       @echo -e "\nThe Makefile.rules has not been found in this or parent directory\n"
+else
+include $(MAKERULES_DIR)/Makefile.rules
+endif
+
diff --git a/board/arm/lpc17cmsis-mbed/test/mcb1760/Makefile.omk b/board/arm/lpc17cmsis-mbed/test/mcb1760/Makefile.omk
new file mode 100644 (file)
index 0000000..c7b0f44
--- /dev/null
@@ -0,0 +1,3 @@
+# -*- makefile -*-
+bin_PROGRAMS = mcb1760_blink
+mcb1760_blink_SOURCES =  main.c
diff --git a/board/arm/lpc17cmsis-mbed/test/mcb1760/main.c b/board/arm/lpc17cmsis-mbed/test/mcb1760/main.c
new file mode 100644 (file)
index 0000000..da9d516
--- /dev/null
@@ -0,0 +1,31 @@
+#include <LPC17xx.h>
+
+#define LED1 (1<<2)
+#define LED2 (1<<3)
+#define LED3 (1<<4)
+#define LED4 (1<<5)
+
+
+void delay(void)
+{
+  volatile unsigned int i = 50000;
+  while(--i);
+}
+
+int main(void)
+{
+  
+  
+  //LPC_PINCON->PINSEL3 &= ~(3 << 4);
+  LPC_GPIO2->FIODIR |=LED1;
+
+
+while(1)
+    {
+       delay();sdsdsd
+       LPC_GPIO2->FIOSET = LED1;
+       delay();
+       LPC_GPIO2->FIOCLR = LED1;
+    };
+
+}