From b53b7ca998f1ae39a58c20eea19a7ff3d7961f94 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= Date: Fri, 19 Nov 2010 01:34:03 +0000 Subject: [PATCH] Make it blink with D7 and D8 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Asbjørn Sloth Tønnesen --- new_cmsis/LPC1768-flash.ld | 2 +- new_cmsis/Makefile | 3 ++- new_cmsis/main.c | 10 +++++++--- new_cmsis/startup.c | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/new_cmsis/LPC1768-flash.ld b/new_cmsis/LPC1768-flash.ld index 68d07ed..cebf954 100644 --- a/new_cmsis/LPC1768-flash.ld +++ b/new_cmsis/LPC1768-flash.ld @@ -26,7 +26,7 @@ SECTIONS { .text : { _stext = .; - KEEP(*(.cs3.interrupt_vector)) + KEEP(*(.isr_vector)) *(.text*) *(.rodata*) . = ALIGN(4); diff --git a/new_cmsis/Makefile b/new_cmsis/Makefile index efcf2d9..f320ab3 100644 --- a/new_cmsis/Makefile +++ b/new_cmsis/Makefile @@ -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 diff --git a/new_cmsis/main.c b/new_cmsis/main.c index 2c70737..efd10ef 100644 --- a/new_cmsis/main.c +++ b/new_cmsis/main.c @@ -46,7 +46,7 @@ __inline static void Delay (uint32_t dlyTicks) { *------------------------------------------------------------------------------*/ __inline static void LED_Config(void) { - GPIO1->FIODIR = 0xB0000000; /* LEDs PORT1 are Output */ + GPIO1->FIODIR = (1<<29)|(1<<18); /* LEDs on PORT1 18 & 29 are Output */ } /*------------------------------------------------------------------------------ @@ -79,9 +79,13 @@ int main (void) { LED_Config(); while(1) { - LED_On ((1<<28)); /* Turn on the LED. */ + LED_On ((1<<29)); /* Turn on the LED. */ + LED_On ((1<<18)); /* Turn on the LED. */ Delay (100); /* delay 100 Msec */ - LED_Off ((1<<28)); /* Turn off the LED. */ + LED_Off ((1<<29)); /* Turn on the LED. */ + Delay (100); /* delay 100 Msec */ + LED_Off ((1<<18)); /* Turn on the LED. */ + LED_On ((1<<29)); /* Turn on the LED. */ Delay (100); /* delay 100 Msec */ } diff --git a/new_cmsis/startup.c b/new_cmsis/startup.c index e4867a4..3830903 100644 --- a/new_cmsis/startup.c +++ b/new_cmsis/startup.c @@ -120,7 +120,7 @@ void (* const g_pfnVectors[])(void) = MemManage_Handler, // The MPU fault handler BusFault_Handler, // The bus fault handler UsageFault_Handler, // The usage fault handler - 0, // Reserved + 0xeffff74e, // Reserved 0, // Reserved 0, // Reserved 0, // Reserved -- 1.7.10.4