updating examples
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 10 May 2001 14:58:52 +0000 (14:58 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 10 May 2001 14:58:52 +0000 (14:58 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@796 4a8a32a2-be11-0410-ad9d-d568d2c75423

device/examples/ds390/clock390/Makefile
device/examples/ds390/hello390/Makefile
device/examples/ds390/i2c390/Makefile
device/examples/ds390/ow390/Makefile
device/examples/ds390/ow390/thermo21.c
device/examples/ds390/ow390/thermo21.h
device/examples/ds390/ow390/thermodl.c
device/examples/ds390/readmac/Makefile
device/examples/ds390/readmac/ow.c
device/examples/ds390/readmac/readmac.c
device/examples/ds390/rtc390/Makefile

index caa9b3a05b6e7a379300c8701caf9ad3758ce803..a74f83fca4d91f89734c8679250c5243184b176d 100644 (file)
@@ -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)
index e165af46e3a8d902cca5f3a474bd49ab98848b03..2156a639811095ea144f1785112d3c3638ede6c3 100644 (file)
@@ -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*
index d077d0f5bba3f2b6607ddbe36827b33301c811f0..c3bb5a8ee42905c7541a20e504d19cb0f4ada7f5 100644 (file)
@@ -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)
index b20dc5b0e0ee946636d026dd066269a8351d573a..6add35a72891667f60cac72bb577f40c469768d5 100755 (executable)
@@ -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) \
index bc1e8851f32b8a5e0cdce0b99bdde47bdfbf0406..0af9fa86f692a7fb665737c6ca07844a64acb900 100644 (file)
@@ -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) {
index 0f76364499ad6702694f86c3addaba976cc90aa5..675cf77ac9bc42b37f2695f3f448c0545d8148b3 100644 (file)
@@ -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
index 1c6e68ee218b17f13a4c73d868e8f0e39fd4283d..0c461d7930644b25d4b7b23f82b0d4fd6eca390b 100644 (file)
@@ -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;
index a73a2e410f45919f01557b523d7855c8da0b1384..b1c88505d95e55fce69e2cbf124cd0915d2da90e 100644 (file)
@@ -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
index 7663c64543866c16a90ac00dba523464442a94e8..6391740bcf0659eabf77bced420fb8cf93078244 100644 (file)
@@ -31,9 +31,7 @@
 //
 // Kevin Vigor, 11/20/2000
  
-#include <ds80c390.h>
 #include <stdio.h>
-#include <serial390.h>
 
 #include "ow.h"
 #include "crcutil.h"
index be3b207c20b7552d4d0583f72c14240833fcc325..eadde5f56315a40fcb56f0417a93851d328a6999 100644 (file)
@@ -5,8 +5,6 @@
 
 
 #include <stdio.h>
-#include <serial390.h>
-#include <ds80c390.h>
 
 #include "ow.h"
 #include "crcutil.h"
index 3be8bb782017a3216731f5f0421aeade38aa4ed6..d87c617f5f39dcf3bf19709d5c30efba29acf512 100755 (executable)
@@ -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)