]> rtime.felk.cvut.cz Git - sysless.git/blob - board/lpceurobot/libs/hwinit/hwinit.c
Upravy po odstraneni souboru
[sysless.git] / board / lpceurobot / libs / hwinit / hwinit.c
1 #include <lpc21xx.h>                            /* LPC21xx definitions */\r
2 #include <deb_led.h>\r
3 #include "startcfg.h"\r
4 #include <stdlib.h>\r
5 #include <error.h>\r
6 \r
7 /* Called automatically from crt0.S before main() */\r
8 /* void __hardware_init(void) __attribute__ ((used)); */\r
9 void __hardware_init(void)\r
10 {\r
11         int err = SUCCESS;\r
12 \r
13         if ((void*)&__hardware_init > (void*)0x40000000) {\r
14                 /* We are running from RAM */\r
15                 MEMMAP = 0x2;   /* Remap interrupt vectors */\r
16         }\r
17 \r
18         deb_led_init();\r
19         \r
20         err = init_PLL(PLL_MUL_4 ,PLL_DIV_2 ,PLL_MODE_ENABLE);   //58.98MHz\r
21         if (err) error(err);\r
22                                           \r
23         err = init_MAM(MAM_FULL);   //58.98MHz\r
24         if (err) error(err);\r
25 \r
26         set_APB(APB_DIV_2);\r
27         
28 \r
29 }\r
30 \r
31 /* Put a pointer to this function in .init_array section */\r
32 void (*fp) (void) __attribute__ ((section (".init_array"))) = __hardware_init;\r