class Mkduino::Probe

Constants

BOARDS
DEVICES

Attributes

options[RW]
probe_options[RW]

Public Class Methods

new(probe_options = {}) click to toggle source
# File lib/probe.rb, line 62
def initialize probe_options = {}
  @probe_options = probe_options
  @options = {}
end

Public Instance Methods

probe() click to toggle source
# File lib/probe.rb, line 67
def probe
  probe_device
  probe_variant
end
probe_device() click to toggle source
# File lib/probe.rb, line 80
def probe_device
  @options[:device] = DEVICES[0]
  DEVICES.each do |d|
    if File.exist?(d)
      @options[:device] = d
      break
    end
  end
end
probe_variant() click to toggle source
# File lib/probe.rb, line 72
def probe_variant
  if @options[:device] && @options[:device] =~ /ACM[0-9]/
    @options[:variant] = "mega"
  else
    @options[:variant] = "standard"
  end
end