* device/include/pic16/pic18f2221.h,
authortecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 13 Mar 2007 09:41:19 +0000 (09:41 +0000)
committertecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 13 Mar 2007 09:41:19 +0000 (09:41 +0000)
* device/include/pic16/pic18f2321.h,
* device/include/pic16/pic18f2331.h,
* device/include/pic16/pic18f4221.h,
* device/include/pic16/pic18f4321.h,
* device/include/pic16/pic18f4331.h: fixed config byte location names
* support/scripts/inc2h-pic16.pl: removed debug output, emit
  consistently named config byte locations

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4684 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
device/include/pic16/pic18f2221.h
device/include/pic16/pic18f2321.h
device/include/pic16/pic18f2331.h
device/include/pic16/pic18f4221.h
device/include/pic16/pic18f4321.h
device/include/pic16/pic18f4331.h
support/scripts/inc2h-pic16.pl

index 34a06ac660dd497fe3f83062dca22e4580a54547..925a69c41d79cf90521fd9e272935c6ca63e4e4c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2007-03-13 Raphael Neider <rneider AT web.de>
+
+       * device/include/pic16/pic18f2221.h,
+       * device/include/pic16/pic18f2321.h,
+       * device/include/pic16/pic18f2331.h,
+       * device/include/pic16/pic18f4221.h,
+       * device/include/pic16/pic18f4321.h,
+       * device/include/pic16/pic18f4331.h: fixed config byte location names
+       * support/scripts/inc2h-pic16.pl: removed debug output, emit
+         consistently named config byte locations
+
 2007-03-13 Borut Razem <borut.razem AT siol.net>
 
        * src/Makefile.in, sim/ucsim/avr.src/Makefile.in, 
index 6fd2de3900ccfbda6e29bf5c72dfdaf219e9dc89..e848f4a3b766ed83ca62240368e8382f6d1e9e43 100644 (file)
 
 
 // Configuration Bits
-#define        _CONFIG1H               0x300001
-#define        _CONFIG2L               0x300002
-#define        _CONFIG2H               0x300003
-#define        _CONFIG3H               0x300005
-#define        _CONFIG4L               0x300006
-#define        _CONFIG5L               0x300008
-#define        _CONFIG5H               0x300009
-#define        _CONFIG6L               0x30000A
-#define        _CONFIG6H               0x30000B
-#define        _CONFIG7L               0x30000C
-#define        _CONFIG7H               0x30000D
+#define        __CONFIG1H              0x300001
+#define        __CONFIG2L              0x300002
+#define        __CONFIG2H              0x300003
+#define        __CONFIG3H              0x300005
+#define        __CONFIG4L              0x300006
+#define        __CONFIG5L              0x300008
+#define        __CONFIG5H              0x300009
+#define        __CONFIG6L              0x30000A
+#define        __CONFIG6H              0x30000B
+#define        __CONFIG7L              0x30000C
+#define        __CONFIG7H              0x30000D
 
 // CONFIG1H Options
 #define        _OSC_LP_1H              0xF0     // LP Oscillator
index 0ac9db5267992b637e500ac052356415d651a548..cbd1abf58142645a0bd33d8780e3c57c03676bc3 100644 (file)
 
 
 // Configuration Bits
-#define        _CONFIG1H               0x300001
-#define        _CONFIG2L               0x300002
-#define        _CONFIG2H               0x300003
-#define        _CONFIG3H               0x300005
-#define        _CONFIG4L               0x300006
-#define        _CONFIG5L               0x300008
-#define        _CONFIG5H               0x300009
-#define        _CONFIG6L               0x30000A
-#define        _CONFIG6H               0x30000B
-#define        _CONFIG7L               0x30000C
-#define        _CONFIG7H               0x30000D
+#define        __CONFIG1H              0x300001
+#define        __CONFIG2L              0x300002
+#define        __CONFIG2H              0x300003
+#define        __CONFIG3H              0x300005
+#define        __CONFIG4L              0x300006
+#define        __CONFIG5L              0x300008
+#define        __CONFIG5H              0x300009
+#define        __CONFIG6L              0x30000A
+#define        __CONFIG6H              0x30000B
+#define        __CONFIG7L              0x30000C
+#define        __CONFIG7H              0x30000D
 
 // CONFIG1H Options
 #define        _OSC_LP_1H              0xF0     // LP Oscillator
index 177abebc3c6ef0ca21d4ef72f41209e3cb151f1b..c9aeadafaa805b42801acd68a223bce2c456a261 100644 (file)
 
 
 // Configuration Bits
-#define        _CONFIG1H               0x300001
-#define        _CONFIG2L               0x300002
-#define        _CONFIG2H               0x300003
-#define        _CONFIG3L               0x300004
-#define        _CONFIG3H               0x300005
-#define        _CONFIG4L               0x300006
-#define        _CONFIG5L               0x300008
-#define        _CONFIG5H               0x300009
-#define        _CONFIG6L               0x30000A
-#define        _CONFIG6H               0x30000B
-#define        _CONFIG7L               0x30000C
-#define        _CONFIG7H               0x30000D
+#define        __CONFIG1H              0x300001
+#define        __CONFIG2L              0x300002
+#define        __CONFIG2H              0x300003
+#define        __CONFIG3L              0x300004
+#define        __CONFIG3H              0x300005
+#define        __CONFIG4L              0x300006
+#define        __CONFIG5L              0x300008
+#define        __CONFIG5H              0x300009
+#define        __CONFIG6L              0x30000A
+#define        __CONFIG6H              0x30000B
+#define        __CONFIG7L              0x30000C
+#define        __CONFIG7H              0x30000D
 
 // CONFIG1H Options
 #define        _OSC_LP_1H              0xF0     // LP
index 54f8cf658ad2a3ed4dedb92182fbb06081510838..d5b8d15048f77425e57b2be5b1aa914dfc589696 100644 (file)
 
 
 // Configuration Bits
-#define        _CONFIG1H               0x300001
-#define        _CONFIG2L               0x300002
-#define        _CONFIG2H               0x300003
-#define        _CONFIG3H               0x300005
-#define        _CONFIG4L               0x300006
-#define        _CONFIG5L               0x300008
-#define        _CONFIG5H               0x300009
-#define        _CONFIG6L               0x30000A
-#define        _CONFIG6H               0x30000B
-#define        _CONFIG7L               0x30000C
-#define        _CONFIG7H               0x30000D
+#define        __CONFIG1H              0x300001
+#define        __CONFIG2L              0x300002
+#define        __CONFIG2H              0x300003
+#define        __CONFIG3H              0x300005
+#define        __CONFIG4L              0x300006
+#define        __CONFIG5L              0x300008
+#define        __CONFIG5H              0x300009
+#define        __CONFIG6L              0x30000A
+#define        __CONFIG6H              0x30000B
+#define        __CONFIG7L              0x30000C
+#define        __CONFIG7H              0x30000D
 
 // CONFIG1H Options
 #define        _OSC_LP_1H              0xF0     // LP Oscillator
index 4ab9264bce2da2a3c3739c67327080c8802555a9..7be1c53243d6c54d7714a613d725d0fa791c95f1 100644 (file)
 
 
 // Configuration Bits
-#define        _CONFIG1H               0x300001
-#define        _CONFIG2L               0x300002
-#define        _CONFIG2H               0x300003
-#define        _CONFIG3H               0x300005
-#define        _CONFIG4L               0x300006
-#define        _CONFIG5L               0x300008
-#define        _CONFIG5H               0x300009
-#define        _CONFIG6L               0x30000A
-#define        _CONFIG6H               0x30000B
-#define        _CONFIG7L               0x30000C
-#define        _CONFIG7H               0x30000D
+#define        __CONFIG1H              0x300001
+#define        __CONFIG2L              0x300002
+#define        __CONFIG2H              0x300003
+#define        __CONFIG3H              0x300005
+#define        __CONFIG4L              0x300006
+#define        __CONFIG5L              0x300008
+#define        __CONFIG5H              0x300009
+#define        __CONFIG6L              0x30000A
+#define        __CONFIG6H              0x30000B
+#define        __CONFIG7L              0x30000C
+#define        __CONFIG7H              0x30000D
 
 // CONFIG1H Options
 #define        _OSC_LP_1H              0xF0     // LP Oscillator
index aa503db0c3adf4993484771add0e9ad780b85885..d7abf368e88f6d715c3d0d0f8e897fcd61f3ef5a 100644 (file)
 
 
 // Configuration Bits
-#define        _CONFIG1H               0x300001
-#define        _CONFIG2L               0x300002
-#define        _CONFIG2H               0x300003
-#define        _CONFIG3L               0x300004
-#define        _CONFIG3H               0x300005
-#define        _CONFIG4L               0x300006
-#define        _CONFIG5L               0x300008
-#define        _CONFIG5H               0x300009
-#define        _CONFIG6L               0x30000A
-#define        _CONFIG6H               0x30000B
-#define        _CONFIG7L               0x30000C
-#define        _CONFIG7H               0x30000D
+#define        __CONFIG1H              0x300001
+#define        __CONFIG2L              0x300002
+#define        __CONFIG2H              0x300003
+#define        __CONFIG3L              0x300004
+#define        __CONFIG3H              0x300005
+#define        __CONFIG4L              0x300006
+#define        __CONFIG5L              0x300008
+#define        __CONFIG5H              0x300009
+#define        __CONFIG6L              0x30000A
+#define        __CONFIG6H              0x30000B
+#define        __CONFIG7L              0x30000C
+#define        __CONFIG7H              0x30000D
 
 // CONFIG1H Options
 #define        _OSC_LP_1H              0xF0     // LP
index 5910f7204e87976f24fd3577ae7a961c3f0d4753..fca9ccc2406cc73ac49f4e4d2bdf7e897b4d1abe 100755 (executable)
@@ -150,7 +150,7 @@ while (<>) {
     
     if (/IFNDEF _*(18.*[0-9]+)/i) {
        $processor = lc($1);
-       LOG "Found processor: $processor.\n";
+       #LOG "Found processor: $processor.\n";
        setup($processor);
        next;
     }
@@ -200,7 +200,7 @@ while (<>) {
        my $addr = oct("0x" . $2);
        #LOG sprintf("Found device ID $1 at 0x%X.\n", $addr);
        if ($state != 6) {
-           print "\n// device IDs\n";
+           #print "\n// device IDs\n";
            $state = 6;
        }
        DEFINE ($1, sprintf ("0x%X", $addr));
@@ -211,7 +211,7 @@ while (<>) {
        my $addr = oct("0x" . $2);
        #LOG sprintf("Found ID location: $1 at 0x%X.\n", $addr);
        if ($state != 5) {
-           print "\n// ID locations\n";
+           #print "\n// ID locations\n";
            $state = 5;
        }
        DEFINE ($1, sprintf ("0x%X", $addr));
@@ -221,7 +221,7 @@ while (<>) {
     # extract configuration bits
     if (/Configuration Bits/i) {
        $state = 3;
-       printf "\n\n// Configuration Bits\n";
+       #print "\n\n// Configuration Bits\n";
        header "\n\n// Configuration Bits\n";
        next;
     }
@@ -229,6 +229,9 @@ while (<>) {
     if ($state == 3 and /(_\w+) EQU H'([0-9a-f]+)/i) {
        $name = $1;
        my $addr = oct("0x" . $2);
+       # convert to double underscore form for SDCC internal consistency
+       $name =~ s/^_//g;
+       $name = "__".$name;
        #LOG sprintf("Found config word $1 at 0x%X.\n", $addr);
        DEFINE ($name, sprintf ("0x%X", $addr));
        next;
@@ -237,7 +240,7 @@ while (<>) {
     if (($state == 3 or $state == 4) and /;--+ ((\w+) Options) --/i) {
        $name = uc($2);
        $state = 4;
-       print "\n// $1\n";
+       #print "\n// $1\n";
        header "\n// $1\n";
        next;
     }
@@ -269,7 +272,7 @@ while (<>) {
        );
        next;
     } elsif ($state == 2 and /(\w+) EQU ([0-9]+)/i) {
-       print "@@@@ FOUND $1 $2 for $name\n";
+       #print "@@@@ FOUND $1 $2 for $name\n";
        my $bit = 0+$2;
        #LOG "Found bit declaration: $1 as bit $bit in reg $name.\n";
        push @{$sfrs->{"$name"}->{"bit$bit"}}, $1;
@@ -281,7 +284,7 @@ while (<>) {
     }
 
     # unknown/unhandled line
-    print "// $_\n";
+    #print "// $_\n";
 }
 
 header "\n";
@@ -301,7 +304,7 @@ foreach my $idx (sort keys %$namelut) {
        header sprintf ("extern __sfr __at (0x%03X) %s;\n", $idx, $reg);
        library sprintf (      "__sfr __at (0x%03X) %s;\n", $idx, $reg);
 
-       print sprintf ("$reg @ %X (<= %d bit names)\n", $sfrs->{"$reg"}->{"addr"}, $names);
+       #print sprintf ("$reg @ %X (<= %d bit names)\n", $sfrs->{"$reg"}->{"addr"}, $names);
        if ($names > 0) {
            header sprintf ("typedef union {\n");