We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
gpio:close/0
1 parent 82b4e7c commit 6b3c835Copy full SHA for 6b3c835
libs/eavmlib/src/gpio.erl
@@ -146,7 +146,12 @@ close(GPIO) ->
146
%%-----------------------------------------------------------------------------
147
-spec stop() -> ok | {error, Reason :: atom()} | error.
148
stop() ->
149
- close(whereis(gpio)).
+ case whereis(gpio) of
150
+ undefined ->
151
+ ok;
152
+ Port when is_port(Port) ->
153
+ close(Port)
154
+ end.
155
156
157
%% @param GPIO pid that was returned from gpio:start/0
0 commit comments