removed some uart strings and functions
[pyfrprog.git] / pkernel / main.c
1 #include "mb91465k.h"
2 #include "flash.h"
3
4 #pragma section CODE=IRAM,attr=CODE
5
6 void increaseled(void)
7 {
8         PDR14 = (PDR14+1)%256;
9         HWWD_CL = 0;
10 }
11
12 void main(void)
13 {
14         unsigned int i, baseaddr;
15         unsigned int toflash[] = {0x9b00, 0x0d4e, 0xcff1, 0x1601, 0x9b05, 0x04c7, 0xc106, 0x1656, 0xe0fb}; //len = 9
16         
17         PORTEN = 0x3; /* enable I/O Ports */
18
19         /*Enable LEDs*/
20         DDR14 = 0xFF;
21         PDR14 = 0xff;
22
23         /*Initialize UART4*/
24         InitUart4();
25
26 #if 1
27         i = 0;
28         baseaddr = 0xf4000;
29         for (; i <0x30; i+=4) {
30                 (void) FLASH_SectorErase(baseaddr + i);
31                 increaseled();
32         }
33 #endif
34
35         i = 0;
36         baseaddr = 0xf4000;
37         for(; i<9; i++) {
38                 increaseled();
39                 (void) FLASH_WriteHalfWord(baseaddr + (2*i), toflash[i]);
40         }
41
42         while(1) {
43                 HWWD_CL = 0;
44         }
45 }
46