X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=pkernel%2Fmain.c;h=89fc2c85f0a415eb04839d99c4a7a0b86e154905;hb=ccf858667cbb6492aeb2f8ec5d6c05492e926ec3;hp=a001e876ee8970803dcbe9f1f5843f4a7486583c;hpb=941d772e9fd7d430bc960475c4a10e93d97fa2e2;p=pyfrprog.git diff --git a/pkernel/main.c b/pkernel/main.c index a001e87..89fc2c8 100644 --- a/pkernel/main.c +++ b/pkernel/main.c @@ -1,8 +1,14 @@ #include "mb91465k.h" -#include "vectors.h" -#include "rlt.h" #include "flash.h" +#pragma section CODE=IRAM,attr=CODE + +void increaseled(void) +{ + PDR14 = (PDR14+1)%256; + HWWD_CL = 0; +} + void main(void) { unsigned char error = 0; @@ -18,14 +24,6 @@ void main(void) 0x1656, 0xe0fb}; //len = 9 - /* Enable Clock Monitor */ - CSCFG_MONCKI = 1; - CMCFG = 0x0D; - - __EI(); /* enable interrupts */ - __set_il(31); /* allow all levels */ - InitIrqLevels(); /* init interrupts */ - PORTEN = 0x3; /* enable I/O Ports */ /* This feature is not supported by MB91V460A */ /* For all other devices the I/O Ports must be enabled*/ @@ -34,12 +32,6 @@ void main(void) DDR14 = 0xFF; PDR14 = 0xff; - /* Initialize Reload Timer Channel 0 */ - RLT_InitializeTimer(0, RLT_RUMMODE_RELOAD, RLT_CLOCKMODE_DIV32, RLT_TRIGGER_SOFTWARE, RLT_OUTOUTMODE_HIGHLEVEL); - RLT_SetReloadValue(0,0xfffe); - RLT_TriggerTimer(0); - RLT_EnableInterrupt(0, 1); - /* Initialize UART4 */ InitUart4(); @@ -47,7 +39,7 @@ void main(void) Puts4(" \n\n"); Puts4("\n\n********** Welcome to FUJITSU FLASH Programming Demo **********\n"); -#if 0 +#if 1 i = 0; baseaddr = 0xf4000; for (; i <0x30; i+=4) { @@ -65,7 +57,7 @@ void main(void) i++; if( (i % 0x10) == 0 ) Puts4("\n"); } - Puts4("\n"); + Puts4("\n"); i = 0; @@ -73,24 +65,13 @@ void main(void) for(; i<9; i++) { Puts4("\nwrite: "); error = FLASH_WriteHalfWord(baseaddr + (2*i), toflash[i]); - Puts4(error == 1 ? "[sucess] " : "[failed] "); + Puts4(error == 1 ? "[sucess] " : "[failed] "); Puts4("0x"); Puthex4(toflash[i], 4); Puts4(" @0x"); Puthex4(baseaddr + (2*i), 6); } - i=0; - Puts4("\nCurrent Content of FLASH at 0xf4000 ... 0xf401F:\n"); - while(i < 0x20) - { - Puts4("0x"); Puthex4( *(unsigned char *)(0xf4000 + i), 2); Puts4(" "); - i++; - if( (i % 0x10) == 0 ) Puts4("\n"); - } - Puts4("\n"); - - /* Output Ready Meassage */ if( global_error != 0 ) { @@ -101,8 +82,6 @@ void main(void) Puts4("\n********* FLASH Programming Demo done **********\n"); } - RLT_EnableInterrupt(0, 0); - while(1) {