-
Notifications
You must be signed in to change notification settings - Fork 109
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
Add gpio:set_int/4
for ESP32 and STM32
#837
Conversation
134e7d7
to
c885897
Compare
4ff1271
to
76f17c6
Compare
76f17c6
to
8376f88
Compare
5d0d821
to
f5858ae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A potential memory issue in the STM32 driver, some trivial indentation changes, and a suggestion for error returns in the ESP32 driver.
@@ -581,44 +602,37 @@ static term nif_gpio_digital_read(Context *ctx, int argc, term argv[]) | |||
return gpio_digital_read(argv[0]); | |||
} | |||
|
|||
static const struct Nif gpio_set_pin_mode_nif = | |||
{ | |||
static const struct Nif gpio_set_pin_mode_nif = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this an editor doing auto-indent? We should probably restore this to the convention of curly braces on new lines for struct declarations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I had a CI format failure and ran clang-format-16 on the file... this was the result. I hadn't noticed that, I'll fix it.
f5858ae
to
d68cb76
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one request for a TODO in the code, and maybe reference issue #894 in GitHub
dd54017
to
e23d60d
Compare
Done. And I added a TODO to move the GPIO atoms from platform_defaultatoms into the gpio_driver. |
7d0025f
to
bec6698
Compare
bec6698
to
61e8d49
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind squashing all the changes here?
Allows setting the pid() or registered name of the process to receive GPIO interrupt messages as the fourth parameter of `gpio:set_int/4`, for both ESP32 and STM32 GPIO port drivers. Signed-off-by: Winford <winford@object.stream>
61e8d49
to
520c616
Compare
Not at all. Done. |
Allows setting the
pid()
or registered name of the process to receivegpio_interrupt
messages as the fourth parameter ofgpio:set_int/4
, with both ESP32 and STM32 GPIO port drivers.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