Module: Raudi::Proxy::ExternalInterrupt

Included in:
Controller
Defined in:
lib/raudi/proxy/external_interrupt.rb

Instance Method Summary collapse

Instance Method Details

#external_interrupt(*args) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/raudi/proxy/external_interrupt.rb', line 7

def external_interrupt(*args)
  set_interrupt(*args) do |arg|
    next unless arg.is_a?(Hash)
    arg.each do |pin_name, interrupt_event|
      pin = get_pin(pin_name)
      pin.int!(interrupt_event)
      pin.port.add_interrupt :int
    end
  end
end

#pc_interrupt(*args) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/raudi/proxy/external_interrupt.rb', line 18

def pc_interrupt(*args)
  set_interrupt(*args) do |arg|
    pin = get_pin(arg)
    pin.pcint!
    pin.port.add_interrupt :pcint
  end
end