removed some uart strings and functions
authorBernhard Urban <lewurm@gmx.net>
Mon, 14 Dec 2009 01:20:45 +0000 (02:20 +0100)
committerBernhard Urban <lewurm@gmx.net>
Mon, 14 Dec 2009 01:20:58 +0000 (02:20 +0100)
-rw-r--r-- 1 lewurm lewurm 5206 2009-12-14 02:21 pkernel/pkernel.mhx

pkernel/main.c
pkernel/uart.c

index 37501b282b8f2f98a3d6cc9d294e7eb1fc3ec1d2..f3b7fb7b0b006e254d6ae35dac629ac7f873330e 100644 (file)
@@ -11,7 +11,6 @@ void increaseled(void)
 
 void main(void)
 {
-       unsigned char error = 0;
        unsigned int i, baseaddr;
        unsigned int toflash[] = {0x9b00, 0x0d4e, 0xcff1, 0x1601, 0x9b05, 0x04c7, 0xc106, 0x1656, 0xe0fb}; //len = 9
        
@@ -28,35 +27,16 @@ void main(void)
        i = 0;
        baseaddr = 0xf4000;
        for (; i <0x30; i+=4) {
-               error = FLASH_SectorErase(baseaddr + i);
-               Puts4("\nerased: ");
-               Puts4(error == 1 ? "[success] " : "[failed] ");
-               Puthex4(baseaddr + i, 6);
+               (void) FLASH_SectorErase(baseaddr + i);
                increaseled();
        }
 #endif
-       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");
-
 
        i = 0;
        baseaddr = 0xf4000;
        for(; i<9; i++) {
                increaseled();
-               Puts4("\nwrite: ");
-               error = FLASH_WriteHalfWord(baseaddr + (2*i), toflash[i]);
-               Puts4(error == 1 ? "[sucess] " : "[failed] ");
-               Puts4("0x");
-               Puthex4(toflash[i], 4);
-               Puts4(" @0x");
-               Puthex4(baseaddr + (2*i), 6);
+               (void) FLASH_WriteHalfWord(baseaddr + (2*i), toflash[i]);
        }
 
        while(1) {
index 71eb44ba8f6dd33610c584a7c03686c6c0b934fc..ec6f97ddb55cdf51b4ba8cbf3ba6c29945e3596f 100644 (file)
@@ -1,7 +1,6 @@
 #include "mb91465k.h"
 
 #pragma section CODE=IRAM,attr=CODE
-const char ASCII[] = "0123456789ABCDEF";
 
 void InitUart4(void)
 {
@@ -36,54 +35,3 @@ unsigned char Getch4(void) /* waits for and returns incomming char   */
        }
 }
 
-
-void Puts4(const char *Name2)
-{
-       volatile int i,len;
-       len = strlen(Name2);
-       
-       for(i=0; i<strlen(Name2); i++) {
-       if(Name2[i] == 10)
-               Putch4(13);
-       Putch4(Name2[i]);
-       }
-}
-
-
-void Puthex4(unsigned long n, unsigned char digits)
-{
-       unsigned char digit=0,div=0,i;
-
-       div=(4*(digits-1));     /* init shift divisor */
-       for (i=0;i<digits;i++) {
-               digit = ((n >> div)&0xF); /* get hex-digit value */
-               Putch4(digit + ((digit < 0xA) ? '0' : 'A' - 0xA));
-               div-=4; /* next digit shift */
-       }
-}
-
-void Putdec4(unsigned long x, int digits)
-{
-       int i;
-       char buf[10],sign=1;
-       
-       if (digits < 0) {     /* should be print of zero? */
-               digits *= (-1);
-               sign =1;
-       }  
-       buf[digits]='\0';                       /* end sign of string */
-       
-       for (i=digits; i>0; i--) {
-               buf[i-1] = ASCII[x % 10]; // + '0' enough? :o
-               x = x/10;
-       }
-
-       if (sign) {
-               for (i=0; buf[i]=='0'; i++) { /* no print of zero */
-                       if ( i<digits-1)
-                               buf[i] = ' ';
-               }
-       }
-       Puts4(buf); /* send string */
-}
-