From f383427b4b644f3d9c67ca921243dd5561a0b0c2 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 21 Aug 2012 00:59:49 -0700 Subject: [PATCH] Rename nRESET net as \_reset\_ so it looks nicer in the schematic This notation provides an overbar. Signed-off-by: Keith Packard --- gnet-partslist-keithp.scm | 86 +++++++++++++++++++++++++++++++++++++++ micropeak.pcb | 12 +++--- micropeak.sch | 4 +- 3 files changed, 94 insertions(+), 8 deletions(-) create mode 100644 gnet-partslist-keithp.scm diff --git a/gnet-partslist-keithp.scm b/gnet-partslist-keithp.scm new file mode 100644 index 0000000..2d01305 --- /dev/null +++ b/gnet-partslist-keithp.scm @@ -0,0 +1,86 @@ +; Copyright (C) 2001-2010 MIYAMOTO Takanori +; gnet-partslist-keithp.scm +; +; This program is free software; you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 2 of the License, or +; (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program; if not, write to the Free Software +; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +; The /'s may not work on win32 +(load (string-append gedadata "/scheme/gnet-partslist-common.scm")) + +(define partslist-keithp:write-top-header + (lambda (port) + (display ".START\n" port) + (display "..device\tvalue\tfootprint\t\tvendor\tvendor_part_number\tquantity\trefdes\n" port))) + +(define (partslist-keithp:write-partslist ls port) + (if (null? ls) + '() + (begin (write-one-row (cdar ls) "\t" "\t" port) + (write-one-row (caar ls) " " "\n" port) + (partslist-keithp:write-partslist (cdr ls) port)))) + +(define partslist-keithp:write-bottom-footer + (lambda (port) + (display ".END" port) + (newline port))) + +(define (count-same-parts ls) + (if (null? ls) + (append ls) + (let* ((parts-table-no-uref (let ((result '())) + (for-each (lambda (l) (set! result (cons (cdr l) result))) (reverse ls)) + (append result))) + (first-ls (car parts-table-no-uref)) + (match-length (length (member first-ls (reverse parts-table-no-uref)))) + (rest-ls (list-tail ls match-length)) + (match-ls (list-tail (reverse ls) (- (length ls) match-length))) + (uref-ls (let ((result '())) + (for-each (lambda (l) (set! result (cons (car l) result))) match-ls) + (append result)))) + (cons (cons uref-ls (append first-ls (list match-length))) (count-same-parts rest-ls))))) + +(define get-vendor + (lambda (package) + (gnetlist:get-package-attribute package "vendor"))) + +(define get-vendor-part-number + (lambda (package) + (gnetlist:get-package-attribute package "vendor_part_number"))) + +(define get-footprint + (lambda (package) + (gnetlist:get-package-attribute package "footprint"))) + +(define (get-parts-table-keithp packages) + (if (null? packages) + '() + (let ((package (car packages))) + (if (string=? (get-device package) "include") + (get-parts-table-keithp (cdr packages)) + (cons (list package + (get-device package) + (get-value package) + (get-footprint package) + (get-vendor package) + (get-vendor-part-number package)) ;; sdb change + (get-parts-table-keithp (cdr packages))))))) + +(define partslist-keithp + (lambda (output-filename) + (let ((port (open-output-file output-filename)) + (parts-table (marge-sort-with-multikey (get-parts-table-keithp packages) '(1 2 3 0)))) + (set! parts-table (count-same-parts parts-table)) + (partslist-keithp:write-top-header port) + (partslist-keithp:write-partslist parts-table port) + (close-output-port port)))) diff --git a/micropeak.pcb b/micropeak.pcb index 3ff06c5..44883af 100644 --- a/micropeak.pcb +++ b/micropeak.pcb @@ -6,7 +6,7 @@ FileVersion[20070407] PCB["MicroPeak" 70000 56000] Grid[100.0 0 0 0] -Cursor[0 9000 0.000000] +Cursor[1800 11400 0.000000] PolyArea[200000000.000000] Thermal[0.500000] DRC[500 1000 500 500 1500 650] @@ -1105,6 +1105,11 @@ NetList() Connect("U1-15") Connect("U2-1") ) + Net("\\_reset\\_" "(unknown)") + ( + Connect("J1-4") + Connect("U1-1") + ) Net("clk" "(unknown)") ( Connect("J1-2") @@ -1146,11 +1151,6 @@ NetList() Connect("U1-11") Connect("U2-7") ) - Net("nRESET" "(unknown)") - ( - Connect("J1-4") - Connect("U1-1") - ) Net("unnamed_net1" "(unknown)") ( Connect("R1-1") diff --git a/micropeak.sch b/micropeak.sch index 94ed40f..a515103 100644 --- a/micropeak.sch +++ b/micropeak.sch @@ -151,7 +151,7 @@ N 48600 43500 48600 43400 4 N 47500 45000 47800 45000 4 { T 47500 45100 5 10 1 1 0 0 1 -netname=nRESET +netname=\_reset\_ } C 48900 45500 1 270 0 led-2.sym { @@ -272,7 +272,7 @@ netname=mosi N 50500 43200 51100 43200 4 { T 50500 43200 5 10 1 1 0 0 1 -netname=nRESET +netname=\_reset\_ } N 50500 42800 51100 42800 4 C 50400 42500 1 0 0 gnd-1.sym -- 2.30.2