diff options
| author | Julian Blake Kongslie | 2022-06-06 13:27:42 -0700 |
|---|---|---|
| committer | Julian Blake Kongslie | 2022-06-06 13:27:42 -0700 |
| commit | b3a13e5845b92ae9520b93113c4030114b2d6331 (patch) | |
| tree | fb1fbb5fa2e7881e8db3778541db9d0ab75fec79 /library.rb | |
| parent | Named pins on subcomponents. (diff) | |
| download | lace-b3a13e5845b92ae9520b93113c4030114b2d6331.tar.xz | |
Automatically define a method for ICs.
Diffstat (limited to '')
| -rw-r--r-- | library.rb | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -26,7 +26,7 @@ $ic = "TSSOP" | |||
| 26 | 26 | ||
| 27 | def define_ic(name, value, pincount, *subparts, &automatic) | 27 | def 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) |
| 50 | end | 50 | end |
| 51 | 51 | ||
| 52 | def stock_ic(name, value, &automatic) | 52 | def stock_ic(name, value, &automatic) |
