Class: EmbedUtils::RakeTask

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/embed_utils/rake_task.rb

Constant Summary collapse

BUILD_DIR =
'build'
HEX_FILE =
"#{BUILD_DIR}/main.hex"
ELF_FILE =
"#{BUILD_DIR}/main.elf"
LIBS_ARCHIVE =
"#{BUILD_DIR}/libcore.a"
LIBRARIES =
%w[arduino]
LIBRARIES_DIR =
'libraries'
SRC_DIR =
'src'
ARDUINO_DIR =
'/usr/local/arduino'
CC =
'avr-gcc'
CXX =
'avr-g++'
AR =
'avr-ar'
OBJCOPY =
'avr-objcopy'
SIZE =
'avr-size'
CXXFLAGS =
%w[
  -std=c++11
  -fno-exceptions
  -fno-threadsafe-statics
]
PORT =

FIXME: for default one, sort /dev/cuaU? by date and pick last one

ENV.fetch 'PORT', '/dev/cuaU1'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ RakeTask

Returns a new instance of RakeTask.

Yields:

  • (_self)

Yield Parameters:



37
38
39
40
41
42
43
44
45
46
# File 'lib/embed_utils/rake_task.rb', line 37

def initialize
  @board        = Board[:uno]
  @libs_archive = LIBS_ARCHIVE
  @libraries    = LIBRARIES
  @src_dir      = SRC_DIR
  @arduino_dir  = ARDUINO_DIR
  @options      = [*ENV['OPTIONS']&.split].compact
  yield self if block_given?
  define
end

Instance Attribute Details

#arduino_dirObject

Returns the value of attribute arduino_dir.



35
36
37
# File 'lib/embed_utils/rake_task.rb', line 35

def arduino_dir
  @arduino_dir
end

#boardObject

Returns the value of attribute board.



34
35
36
# File 'lib/embed_utils/rake_task.rb', line 34

def board
  @board
end

#librariesObject

Returns the value of attribute libraries.



35
36
37
# File 'lib/embed_utils/rake_task.rb', line 35

def libraries
  @libraries
end

#libs_archiveObject

Returns the value of attribute libs_archive.



35
36
37
# File 'lib/embed_utils/rake_task.rb', line 35

def libs_archive
  @libs_archive
end

#optionsObject

Returns the value of attribute options.



35
36
37
# File 'lib/embed_utils/rake_task.rb', line 35

def options
  @options
end

#src_dirObject

Returns the value of attribute src_dir.



35
36
37
# File 'lib/embed_utils/rake_task.rb', line 35

def src_dir
  @src_dir
end