-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #181 from ConnorRigby/master
Getting ready for new release 2.0.1
- Loading branch information
Showing
17 changed files
with
170 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.0.0 | ||
2.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
defmodule FactoryReset do | ||
@reset_pin Application.get_env(:fb, :factory_reset_pin) | ||
require Logger | ||
use GenServer | ||
|
||
def init(_args) do | ||
Process.flag(:trap_exit, true) | ||
{:ok, spawn_link(fn -> Shush.start end)} | ||
end | ||
|
||
def start_link(args) do | ||
GenServer.start_link(__MODULE__, args, name: __MODULE__) | ||
end | ||
|
||
def handle_info({:EXIT, pid, reason}, state) do | ||
Logger.debug("hes dead jim") | ||
{:noreply, state} | ||
end | ||
|
||
def handle_info(event, state) do | ||
Logger.debug("got event: #{inspect event}" ) | ||
{:noreply, state} | ||
end | ||
end | ||
|
||
defmodule Shush do | ||
@reset_pin Application.get_env(:fb, :factory_reset_pin) | ||
def start do | ||
{:ok, pid} = Gpio.start_link(@reset_pin, :input) | ||
Gpio.set_int(pid, :both) | ||
do_stuff(pid) | ||
end | ||
|
||
def do_stuff(pid) do | ||
receive do | ||
{:gpio_interrupt, @reset_pin, :falling} -> IO.puts("falling") | ||
{:gpio_interrupt, @reset_pin, :rising} -> IO.puts("rising") | ||
end | ||
Process.sleep(80) | ||
do_stuff(pid) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.