+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,
// 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
// 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
// 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
// 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
// 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
// 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
if (/IFNDEF _*(18.*[0-9]+)/i) {
$processor = lc($1);
- LOG "Found processor: $processor.\n";
+ #LOG "Found processor: $processor.\n";
setup($processor);
next;
}
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));
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));
# 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;
}
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;
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;
}
);
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;
}
# unknown/unhandled line
- print "// $_\n";
+ #print "// $_\n";
}
header "\n";
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");