summaryrefslogtreecommitdiff
path: root/library.rb
diff options
context:
space:
mode:
authorJulian Blake Kongslie2022-06-06 13:27:42 -0700
committerJulian Blake Kongslie2022-06-06 13:27:42 -0700
commitb3a13e5845b92ae9520b93113c4030114b2d6331 (patch)
treefb1fbb5fa2e7881e8db3778541db9d0ab75fec79 /library.rb
parentNamed pins on subcomponents. (diff)
downloadlace-b3a13e5845b92ae9520b93113c4030114b2d6331.tar.xz
Automatically define a method for ICs.
Diffstat (limited to 'library.rb')
-rw-r--r--library.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/library.rb b/library.rb
index bddcdea..71377dc 100644
--- a/library.rb
+++ b/library.rb
@@ -26,7 +26,7 @@ $ic = "TSSOP"
26 26
27def define_ic(name, value, pincount, *subparts, &automatic) 27def define_ic(name, value, pincount, *subparts, &automatic)
28 parts = [] 28 parts = []
29 proc do 29 define_singleton_method(name, lambda do
30 if parts.size < 1 30 if parts.size < 1
31 ic = comp("U", "#{$ic}-#{pincount}", name, value) 31 ic = comp("U", "#{$ic}-#{pincount}", name, value)
32 automatic.call(ic) 32 automatic.call(ic)
@@ -46,7 +46,7 @@ def define_ic(name, value, pincount, *subparts, &automatic)
46 end 46 end
47 end 47 end
48 parts.shift 48 parts.shift
49 end 49 end)
50end 50end
51 51
52def stock_ic(name, value, &automatic) 52def stock_ic(name, value, &automatic)