Skip to content

Commit

Permalink
Merge pull request #1332 from UncleGrumpy/stm32_fixup
Browse files Browse the repository at this point in the history
Fix bug in STM32 GPIO driver

There was an incorrect case of passing the pointer to the atom string, instead
of the atom index itself in the gpiodriver_set_int function.

On more recent versions of arm-none-eabi compiler this is a compiler error, on
some previous versions it was a warning, that must have been overlooked.

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
  • Loading branch information
bettio committed Oct 14, 2024
2 parents 7c86cc8 + be10e50 commit 6bfa91e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/platforms/stm32/src/lib/gpio_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ static term gpiodriver_set_int(Context *ctx, int32_t target_pid, term cmd)
term pid = term_get_tuple_element(cmd, 3);
if (UNLIKELY(!term_is_pid(pid) && !term_is_atom(pid))) {
AVM_LOGE(TAG, "Invalid listener parameter, must be a pid() or registered process!");
return create_pair(ctx, ERROR_ATOM, invalid_listener_atom);
return create_pair(ctx, ERROR_ATOM, globalcontext_make_atom(ctx->global, invalid_listener_atom));
}
if (term_is_pid(pid)) {
target_local_pid = term_to_local_process_id(pid);
Expand Down

0 comments on commit 6bfa91e

Please sign in to comment.