From: johanknol Date: Thu, 10 May 2001 14:58:52 +0000 (+0000) Subject: updating examples X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=d85872418c79b136ab7e71f9d190997ad177dc40;p=fw%2Fsdcc updating examples git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@796 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/device/examples/ds390/clock390/Makefile b/device/examples/ds390/clock390/Makefile index caa9b3a0..a74f83fc 100644 --- a/device/examples/ds390/clock390/Makefile +++ b/device/examples/ds390/clock390/Makefile @@ -1,6 +1,6 @@ CC = sdcc -MFLAGS = -mds390 --model-flat24 --stack-10bit +MFLAGS = -mds390 LFLAGS = --xram-loc 0x100080 --code-loc 0x10000 -Wl-r OBJECTS = clock390.rel @@ -8,7 +8,7 @@ OBJECTS = clock390.rel all: clock390.hex clean: - rm -f *~ \#* *.asm *.cdb *.rel *.hex *.ihx *.lst *.map *.rst *.sym *.lnk + rm -f *~ \#* *.asm *.cdb *.rel *.hex *.ihx *.lst *.map *.rst *.sym *.lnk core *.dump* clock390.hex: $(OBJECTS) $(CC) $(MFLAGS) $(LFLAGS) $(OBJECTS) diff --git a/device/examples/ds390/hello390/Makefile b/device/examples/ds390/hello390/Makefile index e165af46..2156a639 100644 --- a/device/examples/ds390/hello390/Makefile +++ b/device/examples/ds390/hello390/Makefile @@ -1,9 +1,8 @@ hello390.hex: hello390.c - sdcc -mds390 --model-flat24 --stack-10bit \ - --xram-loc 0x100080 --code-loc 0x10000 \ + sdcc -mds390 --xram-loc 0x100080 --code-loc 0x10000 \ -Wl-r hello390.c packihx hello390.ihx >hello390.hex #tinitalk -c execute hello390.hex clean: - rm -f *~ \#* *.asm *.cdb *.rel *.hex *.ihx *.lst *.map *.rst *.sym *.lnk + rm -f *~ \#* *.asm *.cdb *.rel *.hex *.ihx *.lst *.map *.rst *.sym *.lnk core *.dump* diff --git a/device/examples/ds390/i2c390/Makefile b/device/examples/ds390/i2c390/Makefile index d077d0f5..c3bb5a8e 100644 --- a/device/examples/ds390/i2c390/Makefile +++ b/device/examples/ds390/i2c390/Makefile @@ -1,6 +1,6 @@ CC = sdcc -MFLAGS = -mds390 --model-flat24 --stack-10bit +MFLAGS = -mds390 LFLAGS = --xram-loc 0x100080 --code-loc 0x10000 -Wl-r OBJECTS = i2c390.rel ds1621.rel pcf8591.rel @@ -8,7 +8,7 @@ OBJECTS = i2c390.rel ds1621.rel pcf8591.rel all: i2c390.hex clean: - rm -f *~ \#* *.asm *.cdb *.rel *.hex *.ihx *.lst *.map *.rst *.sym *.lnk + rm -f *~ \#* *.asm *.cdb *.rel *.hex *.ihx *.lst *.map *.rst *.sym *.lnk core *.dump* i2c390.hex: $(OBJECTS) $(CC) $(MFLAGS) $(LFLAGS) $(OBJECTS) diff --git a/device/examples/ds390/ow390/Makefile b/device/examples/ds390/ow390/Makefile index b20dc5b0..6add35a7 100755 --- a/device/examples/ds390/ow390/Makefile +++ b/device/examples/ds390/ow390/Makefile @@ -30,7 +30,7 @@ sensors.lib: $(SENSOR_OBJECTS) clean: rm -f core *~ \#* *.asm *.cdb *.rel *.hex *.ihx *.lst *.map \ - *.rst *.sym *.lnk *.lib + *.rst *.sym *.lnk *.lib *.dump* %.hex: ow.lib sensors.lib $(TINI_TEST_OBJECTS) %.rel $(CC) $(MFLAGS) $(LFLAGS) $*.rel $(TINI_TEST_OBJECTS) \ diff --git a/device/examples/ds390/ow390/thermo21.c b/device/examples/ds390/ow390/thermo21.c index bc1e8851..0af9fa86 100644 --- a/device/examples/ds390/ow390/thermo21.c +++ b/device/examples/ds390/ow390/thermo21.c @@ -48,9 +48,9 @@ int fprintf (FILE *fp, xdata char *format, ...) reentrant { va_end(arg); } -int fopen(char * path, char *mode) { +FILE * fopen(char * path, char *mode) { path, mode; //hush the compiler - return 0; + return (FILE *)0; } int fclose(FILE *fp) { diff --git a/device/examples/ds390/ow390/thermo21.h b/device/examples/ds390/ow390/thermo21.h index 0f763644..675cf77a 100644 --- a/device/examples/ds390/ow390/thermo21.h +++ b/device/examples/ds390/ow390/thermo21.h @@ -42,7 +42,7 @@ #define stdout ((void *)0) #define stderr ((void *)0) int fprintf (FILE *fp, xdata char *format, ...) reentrant; -int fopen (char *, char *); +FILE *fopen (char *, char *); int fclose (FILE *); // defines diff --git a/device/examples/ds390/ow390/thermodl.c b/device/examples/ds390/ow390/thermodl.c index 1c6e68ee..0c461d79 100644 --- a/device/examples/ds390/ow390/thermodl.c +++ b/device/examples/ds390/ow390/thermodl.c @@ -57,8 +57,8 @@ char *argv[]={__FILE__, "exow"}; int main() //short argc, char **argv) { int Fahrenheit=FALSE,filenum,num,i,j; - FILE *fp; char return_msg[128]; + FILE *fp; ThermoStateType ThermoState; uchar ThermoSN[MAXDEVICES][8]; //the serial numbers for the devices int portnum=0; @@ -110,26 +110,25 @@ int main() //short argc, char **argv) fp = NULL; if (filenum > 0) { - fp = fopen(argv[filenum],"w+"); - if(fp == NULL) - { + fp = fopen(argv[filenum],"w+"); + if(fp == NULL) + { printf("ERROR, Could not open output file!\n"); exit(1); - } - else - printf("File '%s' opened to write mission results.\n", - argv[filenum]); + } + else + printf("File '%s' opened to write mission results.\n", + argv[filenum]); } // get list of Thermochron's - num = FindDevices(portnum, &ThermoSN[0],THERMO_FAM, MAXDEVICES); + num = FindDevices(portnum, &ThermoSN[0],THERMO_FAM, MAXDEVICES); // check if not present or more then 1 present if (num == 0) ExitProg("Thermochron not present on 1-Wire\n",1); // loop to download each Thermochron - for (i = 0; i < num; i++) { // set the serial number portion in the thermo state @@ -140,18 +139,17 @@ int main() //short argc, char **argv) printf("%02X",ThermoSN[i][j]); } printf("\n"); - // download the Thermochron found if (DownloadThermo(portnum,&ThermoSN[i][0],&ThermoState,stdout)) { - // interpret the results of the download - InterpretStatus(&ThermoState.MissStat); - InterpretAlarms(&ThermoState.AlarmData, &ThermoState.MissStat); - InterpretHistogram(&ThermoState.HistData); - InterpretLog(&ThermoState.LogData, &ThermoState.MissStat); + // interpret the results of the download + InterpretStatus(&ThermoState.MissStat); + InterpretAlarms(&ThermoState.AlarmData, &ThermoState.MissStat); + InterpretHistogram(&ThermoState.HistData); + InterpretLog(&ThermoState.LogData, &ThermoState.MissStat); // print the output - PrintResults(&ThermoState,fp,Fahrenheit); + PrintResults(&ThermoState,fp,Fahrenheit); } else { @@ -171,7 +169,7 @@ int main() //short argc, char **argv) } // release the 1-Wire Net - owRelease(portnum,return_msg); + //owRelease(portnum,return_msg); printf("\n%s",return_msg); ExitProg("End program normally\n",0); return 0; diff --git a/device/examples/ds390/readmac/Makefile b/device/examples/ds390/readmac/Makefile index a73a2e41..b1c88505 100644 --- a/device/examples/ds390/readmac/Makefile +++ b/device/examples/ds390/readmac/Makefile @@ -1,6 +1,6 @@ CC = sdcc -MFLAGS = -mds390 --model-flat24 --stack-10bit +MFLAGS = -mds390 LFLAGS = --xram-loc 0x180080 --code-loc 0x10000 -Wl-r OBJECTS = readmac.rel ow.rel crcutil.rel @@ -8,7 +8,7 @@ OBJECTS = readmac.rel ow.rel crcutil.rel all: readmac.hex clean: - rm -f *~ \#* *.asm *.cdb *.rel *.hex *.ihx *.lst *.map *.rst *.sym *.lnk + rm -f *~ \#* *.asm *.cdb *.rel *.hex *.ihx *.lst *.map *.rst *.sym *.lnk core *.dump* readmac.hex: readmac.ihx packihx readmac.ihx >readmac.hex diff --git a/device/examples/ds390/readmac/ow.c b/device/examples/ds390/readmac/ow.c index 7663c645..6391740b 100644 --- a/device/examples/ds390/readmac/ow.c +++ b/device/examples/ds390/readmac/ow.c @@ -31,9 +31,7 @@ // // Kevin Vigor, 11/20/2000 -#include #include -#include #include "ow.h" #include "crcutil.h" diff --git a/device/examples/ds390/readmac/readmac.c b/device/examples/ds390/readmac/readmac.c index be3b207c..eadde5f5 100644 --- a/device/examples/ds390/readmac/readmac.c +++ b/device/examples/ds390/readmac/readmac.c @@ -5,8 +5,6 @@ #include -#include -#include #include "ow.h" #include "crcutil.h" diff --git a/device/examples/ds390/rtc390/Makefile b/device/examples/ds390/rtc390/Makefile index 3be8bb78..d87c617f 100755 --- a/device/examples/ds390/rtc390/Makefile +++ b/device/examples/ds390/rtc390/Makefile @@ -1,6 +1,6 @@ CC = sdcc -MFLAGS = -mds390 --model-flat24 --stack-10bit +MFLAGS = -mds390 LFLAGS = --xram-loc 0x100080 --code-loc 0x10000 -Wl-r OBJECTS = rtc390.rel @@ -8,7 +8,7 @@ OBJECTS = rtc390.rel all: rtc390.hex clean: - rm -f *~ \#* *.asm *.cdb *.rel *.hex *.ihx *.lst *.map *.rst *.sym *.lnk + rm -f *~ \#* *.asm *.cdb *.rel *.hex *.ihx *.lst *.map *.rst *.sym *.lnk core *.dump* rtc390.hex: $(OBJECTS) $(CC) $(MFLAGS) $(LFLAGS) $(OBJECTS)