Make it blink with D7 and D8
authorAsbjørn Sloth Tønnesen <asbjorn@asbjorn.biz>
Fri, 19 Nov 2010 01:34:03 +0000 (01:34 +0000)
committerAsbjørn Sloth Tønnesen <asbjorn@asbjorn.biz>
Fri, 19 Nov 2010 01:34:03 +0000 (01:34 +0000)
Signed-off-by: Asbjørn Sloth Tønnesen <asbjorn@asbjorn.biz>

new_cmsis/LPC1768-flash.ld
new_cmsis/Makefile
new_cmsis/main.c
new_cmsis/startup.c

index 68d07ed..cebf954 100644 (file)
@@ -26,7 +26,7 @@ SECTIONS {
 
   .text : {
     _stext = .;
-    KEEP(*(.cs3.interrupt_vector))
+    KEEP(*(.isr_vector))
     *(.text*)
     *(.rodata*)
     . = ALIGN(4);
index efcf2d9..f320ab3 100644 (file)
@@ -1,7 +1,8 @@
 PROJECT=rapper
 PLATFORM ?= arm-none-eabi
 LDFLAGS=--gc-sections -g -T LPC1768-flash.ld
-CFLAGS=-W -Wall -Os --std=gnu99 -fgnu89-inline -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections -I. -g
+CFLAGS=-W -Wall --std=gnu99 -fgnu89-inline -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections -I. -g
+#CFLAGS+=-Os
 
 # objects are separated by space
 OBJECTS=startup.o system_LPC17xx.o main.o core_cm3.o
index 2c70737..efd10ef 100644 (file)
@@ -46,7 +46,7 @@ __inline static void Delay (uint32_t dlyTicks) {
  *------------------------------------------------------------------------------*/\r
 __inline static void LED_Config(void) {\r
 \r
-  GPIO1->FIODIR = 0xB0000000;                   /* LEDs PORT1 are Output */\r
+  GPIO1->FIODIR = (1<<29)|(1<<18);     /* LEDs on PORT1 18 & 29 are Output */\r
 }\r
 \r
 /*------------------------------------------------------------------------------\r
@@ -79,9 +79,13 @@ int main (void) {
   LED_Config();                             \r
  \r
   while(1) {\r
-    LED_On ((1<<28));                           /* Turn on the LED. */\r
+    LED_On ((1<<29));                           /* Turn on the LED. */\r
+    LED_On ((1<<18));                           /* Turn on the LED. */\r
     Delay (100);                                /* delay  100 Msec */\r
-    LED_Off ((1<<28));                             /* Turn off the LED. */\r
+    LED_Off ((1<<29));                           /* Turn on the LED. */\r
+    Delay (100);                                /* delay  100 Msec */\r
+    LED_Off ((1<<18));                           /* Turn on the LED. */\r
+    LED_On ((1<<29));                           /* Turn on the LED. */\r
     Delay (100);                                /* delay  100 Msec */\r
   }\r
   \r
index e4867a4..3830903 100644 (file)
@@ -120,7 +120,7 @@ void (* const g_pfnVectors[])(void) =
     MemManage_Handler,                      // The MPU fault handler\r
     BusFault_Handler,                       // The bus fault handler\r
     UsageFault_Handler,                     // The usage fault handler\r
-    0,                                      // Reserved\r
+    0xeffff74e,                             // Reserved\r
     0,                                      // Reserved\r
     0,                                      // Reserved\r
     0,                                      // Reserved\r