Permalink
Browse files

hex_server:event call

  • Loading branch information...
1 parent e02d997 commit ee1f46a02698f882847355b8249f9234ea20e443 @tonyrog committed Feb 27, 2014
Showing with 3 additions and 2 deletions.
  1. +1 −1 src/hex_gpio.erl
  2. +2 −1 src/hex_gpio_server.erl
View
@@ -76,7 +76,7 @@ init_event(out,Flags) ->
end.
%%
-%% validate_event(in | out, Flags::[{atom(),term()}])
+%% validate_event(in | out, Flags::[{atom(),term()}]) -> ok | {error,Error}
%%
validate_event(Dir, Flags) ->
case lists:keytake(pin, 1, Flags) of
View
@@ -11,6 +11,7 @@
-behaviour(gen_server).
-include_lib("lager/include/log.hrl").
+-include_lib("hex/include/hex.hrl").
%% API
-export([start_link/0, stop/0]).
-export([add_event/2, del_event/1]).
@@ -160,7 +161,7 @@ handle_info({gpio_interrupt, PinReg, Pin, Value}, State) ->
lists:foreach(
fun({_Ref,EdgeMask,Signal}) ->
if EdgeMask band TriggerMask =/= 0 ->
- hex_server ! Signal;
+ hex_server:event(Signal,[{value,Value}]);
true ->
ok
end

0 comments on commit ee1f46a

Please sign in to comment.