From 8896255d6fe6aa1028acc4a62e1a7bc20fe5a02a Mon Sep 17 00:00:00 2001 From: tecodev Date: Tue, 13 Mar 2007 09:41:19 +0000 Subject: [PATCH] * 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 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4684 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 11 +++++++++++ device/include/pic16/pic18f2221.h | 22 +++++++++++----------- device/include/pic16/pic18f2321.h | 22 +++++++++++----------- device/include/pic16/pic18f2331.h | 24 ++++++++++++------------ device/include/pic16/pic18f4221.h | 22 +++++++++++----------- device/include/pic16/pic18f4321.h | 22 +++++++++++----------- device/include/pic16/pic18f4331.h | 24 ++++++++++++------------ support/scripts/inc2h-pic16.pl | 19 +++++++++++-------- 8 files changed, 90 insertions(+), 76 deletions(-) diff --git a/ChangeLog b/ChangeLog index 34a06ac6..925a69c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2007-03-13 Raphael Neider + + * 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 * src/Makefile.in, sim/ucsim/avr.src/Makefile.in, diff --git a/device/include/pic16/pic18f2221.h b/device/include/pic16/pic18f2221.h index 6fd2de39..e848f4a3 100644 --- a/device/include/pic16/pic18f2221.h +++ b/device/include/pic16/pic18f2221.h @@ -14,17 +14,17 @@ // 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 diff --git a/device/include/pic16/pic18f2321.h b/device/include/pic16/pic18f2321.h index 0ac9db52..cbd1abf5 100644 --- a/device/include/pic16/pic18f2321.h +++ b/device/include/pic16/pic18f2321.h @@ -14,17 +14,17 @@ // 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 diff --git a/device/include/pic16/pic18f2331.h b/device/include/pic16/pic18f2331.h index 177abebc..c9aeadaf 100644 --- a/device/include/pic16/pic18f2331.h +++ b/device/include/pic16/pic18f2331.h @@ -14,18 +14,18 @@ // 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 diff --git a/device/include/pic16/pic18f4221.h b/device/include/pic16/pic18f4221.h index 54f8cf65..d5b8d150 100644 --- a/device/include/pic16/pic18f4221.h +++ b/device/include/pic16/pic18f4221.h @@ -14,17 +14,17 @@ // 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 diff --git a/device/include/pic16/pic18f4321.h b/device/include/pic16/pic18f4321.h index 4ab9264b..7be1c532 100644 --- a/device/include/pic16/pic18f4321.h +++ b/device/include/pic16/pic18f4321.h @@ -14,17 +14,17 @@ // 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 diff --git a/device/include/pic16/pic18f4331.h b/device/include/pic16/pic18f4331.h index aa503db0..d7abf368 100644 --- a/device/include/pic16/pic18f4331.h +++ b/device/include/pic16/pic18f4331.h @@ -14,18 +14,18 @@ // 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 diff --git a/support/scripts/inc2h-pic16.pl b/support/scripts/inc2h-pic16.pl index 5910f720..fca9ccc2 100755 --- a/support/scripts/inc2h-pic16.pl +++ b/support/scripts/inc2h-pic16.pl @@ -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"); -- 2.30.2