From: kvigor Date: Thu, 10 May 2001 06:03:27 +0000 (+0000) Subject: update for tinibios X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=840493f3f08ccfcf5488e6f7251ab39e06e3e1a5;p=fw%2Fsdcc update for tinibios git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@794 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/support/tests/dhrystone/clock.c b/support/tests/dhrystone/clock.c deleted file mode 100644 index d2a759b1..00000000 --- a/support/tests/dhrystone/clock.c +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include - -#include "clock.h" - -volatile unsigned long milliSeconds=0; - -#define RELOAD_VALUE 18432000/2/CLOCKS_PER_SEC - -void Timer2Handler (void) interrupt 5 using 1 { - TF2=0; // reset overflow flag - milliSeconds++; - // that's all for now :) -} - -// we can't just use milliSeconds -unsigned long clock(void) { - unsigned long ms; - ET2=0; - ms=milliSeconds; - ET2=1; - return ms; -} - -void startTimer (void) -{ - // initialise timer - ET2=0; // disable timer interrupts initially - T2CON=0; // stop, timer mode, autoreload - T2MOD&=0xf4; - - TL2=RTL2=(-RELOAD_VALUE)&0xff; - TH2=RTH2=(-RELOAD_VALUE)>>8; - TR2=1; // run - - ET2=1; // enable timer interrupts -} - - diff --git a/support/tests/dhrystone/clock.h b/support/tests/dhrystone/clock.h deleted file mode 100644 index 2d395dca..00000000 --- a/support/tests/dhrystone/clock.h +++ /dev/null @@ -1,5 +0,0 @@ -extern void Timer2Handler (void) interrupt 5 using 1; -extern unsigned long clock(void); -extern void startTimer(void); - -#define CLOCKS_PER_SEC 1000 diff --git a/support/tests/dhrystone/dhry.c b/support/tests/dhrystone/dhry.c index e9fb7404..0f19332b 100644 --- a/support/tests/dhrystone/dhry.c +++ b/support/tests/dhrystone/dhry.c @@ -49,8 +49,9 @@ #include #ifdef SDCC_ds390 -#include "clock.h" -#include +#include +#define clock() ClockTicks() +#define CLOCKS_PER_SEC 1000 #undef PRINT_T_STATES #else /** For clock() */ @@ -71,7 +72,7 @@ void _printTStates(void); #define DEBUG 0 #if DEBUG -#define DPRINTF(_a) printf _a +#define DPRINTF(_a) printf _a #else #define DPRINTF(_a) #endif @@ -116,10 +117,6 @@ int main(void) REG int Number_Of_Runs; unsigned long runTime; -#ifdef SDCC_ds390 - startTimer(); -#endif - printf("[dhry]\n"); Next_Ptr_Glob = &_r[0]; diff --git a/support/tests/dhrystone/tini.mak b/support/tests/dhrystone/tini.mak index be9bbacc..2a7eee0c 100644 --- a/support/tests/dhrystone/tini.mak +++ b/support/tests/dhrystone/tini.mak @@ -2,9 +2,9 @@ CC = sdcc MFLAGS = -mds390 --model-flat24 --stack-10bit MFLAGS += -DREG= -DNOSTRUCTASSIGN -DNOENUM -LFLAGS = --xram-loc 0x180000 --code-loc 0x10000 -Wl-r +LFLAGS = --xram-loc 0x100080 --code-loc 0x10000 -Wl-r -OBJECTS = dhry.rel clock.rel +OBJECTS = dhry.rel all: dhry.hex