Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nif declarations in esp_adc module #1354

Merged
merged 1 commit into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [0.6.6] - Unreleased

### Fixed

- Fixed specifications of nifs from `esp_adc` module

## [0.6.5] - 2024-10-15

### Added
Expand Down
10 changes: 5 additions & 5 deletions libs/eavmlib/src/esp_adc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
%%-----------------------------------------------------------------------------
-spec init() -> {ok, ADCUnit :: adc_rsrc()} | {error, Reason :: term()}.
init() ->
throw(nif_error).
erlang:nif_error(undefined).

%%-----------------------------------------------------------------------------
%% @param UnitResource returned from init/0
Expand All @@ -134,7 +134,7 @@ init() ->
%%-----------------------------------------------------------------------------
-spec deinit(UnitResource :: adc_rsrc()) -> ok | {error, Reason :: term()}.
deinit(_UnitResource) ->
throw(nif_error).
erlang:nif_error(undefined).

%%-----------------------------------------------------------------------------
%% @param Pin Pin to configure as ADC
Expand Down Expand Up @@ -185,7 +185,7 @@ acquire(Pin, UnitHandle) ->
Attenuation :: attenuation()
) -> {ok, Channel :: adc_rsrc()} | {error, Reason :: term()}.
acquire(_Pin, _UnitHandle, _BitWidth, _Attenuation) ->
throw(nif_error).
erlang:nif_error(undefined).

%%-----------------------------------------------------------------------------
%% @param ChannelResource of the pin returned from acquire/4
Expand All @@ -204,7 +204,7 @@ acquire(_Pin, _UnitHandle, _BitWidth, _Attenuation) ->
%%-----------------------------------------------------------------------------
-spec release_channel(ChannelResource :: adc_rsrc()) -> ok | {error, Reason :: term()}.
release_channel(_ChannelResource) ->
throw(nif_error).
erlang:nif_error(undefined).

%%-----------------------------------------------------------------------------
%% @param ChannelResource of the pin returned from acquire/4
Expand Down Expand Up @@ -256,7 +256,7 @@ sample(ChannelResource, UnitResource) ->
ChannelResource :: adc_rsrc(), UnitResource :: adc_rsrc(), ReadOptions :: read_options()
) -> {ok, Result :: reading()} | {error, Reason :: term()}.
sample(_ChannelResource, _UnitResource, _ReadOptions) ->
throw(nif_error).
erlang:nif_error(undefined).

%%-----------------------------------------------------------------------------
%% @returns {ok, Pid}
Expand Down
Loading