X-Git-Url: http://git.asbjorn.biz/?p=rapper.git;a=blobdiff_plain;f=bitbucket_lpc1768%2Fmain.c;fp=bitbucket_lpc1768%2Fmain.c;h=0000000000000000000000000000000000000000;hp=66325af3ad878fb645bfe0bc74afbab95a20cfb0;hb=7964505b5eaf8be846f82c6c3c5a3f6c9dc84ede;hpb=dddaffd50b66ca9c149601a71673a66b90924b52 diff --git a/bitbucket_lpc1768/main.c b/bitbucket_lpc1768/main.c deleted file mode 100644 index 66325af..0000000 --- a/bitbucket_lpc1768/main.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * LED blinking example for the mbed LPC1768-based board. - * - * See also: http://bitbucket.org/jpc/lpc1768/ - * - * Copyright (c) 2010 LoEE - Jakub Piotr Cłapa - * This program is released under the new BSD license. - */ -#include "CMSIS/LPC17xx.h" -#include "io-pin.h" - -// For mbed-005.1 -#define LED1 P1+18 -#define LED2 P1+20 -#define LED3 P1+21 -#define LED4 P1+29 - -// Helper macros -#define LED_ON(i) (pin_write (LED##i, 1)) -#define LED_OFF(i) (pin_write (LED##i, 0)) - -volatile uint32_t current_time; - -void SysTick_Handler (void) -{ - current_time++; -} - -void delay (uint32_t interval) -{ - uint32_t start = current_time; - while (current_time - start < interval); -} - -int main (void) -{ - // Setup SysTick interrupts at 1kHz (1ms) - SysTick_Config (SystemCoreClock / 1000); - - // Configure as output pins. - pin_dir (LED1, PIN_OUT); - pin_dir (LED2, PIN_OUT); - pin_dir (LED3, PIN_OUT); - pin_dir (LED4, PIN_OUT); - - // Twinkle! - while(1) { - LED_OFF(1); delay (120); LED_ON(1); - LED_ON(2); delay (120); LED_OFF(2); - LED_ON(3); delay (120); LED_OFF(3); - LED_ON(4); delay (120); LED_OFF(4); - LED_ON(3); delay (120); LED_OFF(3); - LED_ON(2); delay (120); LED_OFF(2); - } -}