|
Message
From: cvs at opencores.org<cvs@o...>
Date: Thu Oct 25 18:18:21 CEST 2007
Subject: [cvs-checkins] MODIFIED: mips789 ...
Date: 00/07/10 25:18:18 Modified: mips789/bench/calc_PI_2 cal_pi.c Log: no message Revision Changes Path 1.2 mips789/bench/calc_PI_2/cal_pi.c http://www.opencores.org/cvsweb.shtml/mips789/bench/calc_PI_2/cal_pi.c.diff?r1=1.1&r2=1.2 (In the diff below, changes in quantity of whitespace are not shown.) Index: cal_pi.c =================================================================== RCS file: /cvsroot/mcupro/mips789/bench/calc_PI_2/cal_pi.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -b -r1.1 -r1.2 --- cal_pi.c 13 Oct 2007 08:41:57 -0000 1.1 +++ cal_pi.c 25 Oct 2007 16:18:21 -0000 1.2 @@ -23,7 +23,7 @@ void disp_oct4(unsigned short x); void disp_pi(void); -#define MAXFIGURE ((1024/4)+2) /* should be (N*8)+2 to display correctly */ +#define MAXFIGURE ((1100*2/4)+2) /* should be (N*8)+2 to display correctly */ unsigned short PI[MAXFIGURE]; unsigned short T1[MAXFIGURE]; @@ -35,9 +35,8 @@ /* ============= */ void main_sh(void) { - unsigned char mes[] = "Calculating.....\n"; - uart0_putstr(mes); + uart0_putstr("Calculating..... "); calc_pi(); disp_pi(); } @@ -206,8 +205,8 @@ void disp_pi(void) { int i, j; - uart0_putstr("Calculating DONE\n"); - uart0_putstr("Constant Pi = 3."); + uart0_putstr("Calculating DONE "); + uart0_putstr("Pi = 3."); /* while(1)*/ { for (i = 0; i < (MAXFIGURE - 2) / 8; i++) @@ -241,35 +240,6 @@ uart0_putc((char)(d+0x30)); uart0_putc((char)(x+0x30)); } -/* -void print_num(unsigned long num) -{ - unsigned long digit,offset ; - for(offset=1000;offset;offset/=10) - { - digit=num/offset ; - uart0_putc('0'+digit); - num-=digit*offset ; - } -} - -long a=10000,b=0,c=56,d=0,e=0,f[57]={0},g=0 ; - -void cal_PI(void) -{ - uart0_putstr("\nPI = "); - a=10000 ; - b=0 ; - c=56 ; - d=0 ; - e=0 ; - g=0 ; - for(;b-c;)f[b++]=a/5 ; - for(;d=0,g=c*2;c-=14,print_num(e+d/a),e=d%a) - for(b=c;d+=f[b]*a,f[b]=d%--g,d/=g--,--b;d*=b); - uart0_putc('\n'); -} -*/ #ifdef MIPS main2() @@ -282,13 +252,11 @@ unsigned char i=0; - uart0_putstr("Hello CPU World ,this is MIPS789..."); - uart0_putstr("Calculating.....\n"); - - for(;;) -{ calc_pi(); +{ + uart0_putstr("Hello CPU World ,this is MIPS789...\n"); +calc_pi();
disp_pi();
#ifdef MIPS
dis_byte(i++);
|
 |