* as/link/lkar.h: sgetl and sputl are independent of endianness
[fw/sdcc] / support / scripts / inc2h-pic16.pl
index fca9ccc2406cc73ac49f4e4d2bdf7e897b4d1abe..d6ca92f92878a2291df571921ae27f81acbf684e 100755 (executable)
@@ -2,6 +2,7 @@
 
 use strict;
 
+#
 # Parse MPASM include files to extract SDCC header/device library files
 # This script is (c) 2007 by Raphael Neider <rneider AT web.de>,
 # it is licensed under the terms of the GPL v2.
@@ -16,15 +17,23 @@ use strict;
 # 2. mv picDEVICE.h $SDCC/device/include/pic16
 # 3. mv picDEVICE.c $SDCC/device/lib/pic16/libdev
 # 4. add DEVICE to $SDCC/device/lib/pic16/pics.all (and .build)
-# 5. adjust $SDCC/device/lib/pic16/libio/*.ignore if the device
-#    does not support ADC, I2C, or USART
+# 5. either
+#    (a) adjust $SDCC/device/lib/pic16/libio/*.ignore
+#        if the device does not support ADC, I2C, or USART
+#        OR
+#    (b) adjust $SDCC/device/include/pic16/adc.h
+#        adding the new device to the correct ADC style class
 # 6. edit $SDCC/device/include/pic16/pic18fregs.h
-# 7. edit $SDCC/src/pic16/devices.inc
+# 7. edit $SDCC/device/include/pic16/pic16devices.txt
 #
 # The file format of steps 6 and 7 is self explanatory, in most
 # if not all cases you can copy and paste another device's records
 # and adjust them to the newly added device.
 #
+# Please try to add device families (with a common datasheet) rather
+# than a single device and use the .h and .c files of the largest
+# device for all (using #include "largest.c" and #include "largest.h").
+#
 
 my $SCRIPT = $0;
 $SCRIPT =~ s/.*\///g; # remove path prefix
@@ -58,7 +67,7 @@ sub setup
     $proc = uc($proc);
 
     print HEADER <<"HEREDOC"
-/* 
+/*
  * $header - device specific declarations
  *
  * This file is part of the GNU PIC library for SDCC,
@@ -103,7 +112,7 @@ HEREDOC
     print LIBRARY <<HEREDOC
 
 HEREDOC
-;    
+;
     close HEADER;
     close LIBRARY;
 }
@@ -147,7 +156,7 @@ while (<>) {
     chomp;
     s/\s+/ /g;
     next if (/^\s*$/);
-    
+
     if (/IFNDEF _*(18.*[0-9]+)/i) {
        $processor = lc($1);
        #LOG "Found processor: $processor.\n";