rewrite
This commit is contained in:
parent
ba8f072d23
commit
2c935df494
110 changed files with 1350 additions and 8011 deletions
18
eisrom_firmware/lib/eisrom_firmware.ex
Normal file
18
eisrom_firmware/lib/eisrom_firmware.ex
Normal file
|
@ -0,0 +1,18 @@
|
|||
defmodule EisromFirmware do
|
||||
@moduledoc """
|
||||
Documentation for EisromFirmware.
|
||||
"""
|
||||
|
||||
@doc """
|
||||
Hello world.
|
||||
|
||||
## Examples
|
||||
|
||||
iex> EisromFirmware.hello
|
||||
:world
|
||||
|
||||
"""
|
||||
def hello do
|
||||
:world
|
||||
end
|
||||
end
|
44
eisrom_firmware/lib/eisrom_firmware/application.ex
Normal file
44
eisrom_firmware/lib/eisrom_firmware/application.ex
Normal file
|
@ -0,0 +1,44 @@
|
|||
defmodule EisromFirmware.Application do
|
||||
# See https://hexdocs.pm/elixir/Application.html
|
||||
# for more information on OTP Applications
|
||||
@moduledoc false
|
||||
|
||||
use Application
|
||||
|
||||
@impl true
|
||||
def start(_type, _args) do
|
||||
# See https://hexdocs.pm/elixir/Supervisor.html
|
||||
# for other strategies and supported options
|
||||
opts = [strategy: :one_for_one, name: EisromFirmware.Supervisor]
|
||||
|
||||
children =
|
||||
[
|
||||
# Children for all targets
|
||||
# Starts a worker by calling: EisromFirmware.Worker.start_link(arg)
|
||||
# {EisromFirmware.Worker, arg},
|
||||
] ++ children(target())
|
||||
|
||||
Supervisor.start_link(children, opts)
|
||||
end
|
||||
|
||||
# List all child processes to be supervised
|
||||
def children(:host) do
|
||||
[
|
||||
# Children that only run on the host
|
||||
# Starts a worker by calling: EisromFirmware.Worker.start_link(arg)
|
||||
# {EisromFirmware.Worker, arg},
|
||||
]
|
||||
end
|
||||
|
||||
def children(_target) do
|
||||
[
|
||||
# Children for all targets except host
|
||||
# Starts a worker by calling: EisromFirmware.Worker.start_link(arg)
|
||||
# {EisromFirmware.Worker, arg},
|
||||
]
|
||||
end
|
||||
|
||||
def target() do
|
||||
Application.get_env(:eisrom_firmware, :target)
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue