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 driver usage of ports #1470

Merged
merged 1 commit into from
Jan 19, 2025

Conversation

pguyot
Copy link
Collaborator

@pguyot pguyot commented Jan 14, 2025

  • Fix i2c and spi esp32 native code to use ports
  • Fix whereis/1 and register/2 to work with ports
  • Fix specifications related to ports
  • Fix documentation of register/2

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

@UncleGrumpy
Copy link
Collaborator

There are also some cases of is_pid(Term) in eavmlib/src/spi.erl that need to be changed to is_port(Term).

Copy link
Collaborator

@bettio bettio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking this as "request changes" to avoid any accidental merge.

@pguyot pguyot force-pushed the w03/fix-spi-driver branch from c2e099d to 2475a66 Compare January 18, 2025 07:42
@pguyot pguyot changed the title Fix i2c and spi esp32 drivers with ports Fix driver usage of ports Jan 18, 2025
@pguyot pguyot force-pushed the w03/fix-spi-driver branch 2 times, most recently from 8e398d6 to 2a9280d Compare January 18, 2025 07:59
Copy link
Collaborator

@bettio bettio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a warning message should be updated, everything else is perfect.

src/platforms/esp32/components/avm_builtins/i2c_driver.c Outdated Show resolved Hide resolved
@pguyot pguyot force-pushed the w03/fix-spi-driver branch from 2a9280d to 9b6b02b Compare January 18, 2025 09:48
@pguyot pguyot force-pushed the w03/fix-spi-driver branch 4 times, most recently from fa056ed to e2cb90b Compare January 18, 2025 14:51
- Fix i2c and spi esp32 native code to use ports
- Fix `whereis/1` and `register/2` to work with ports
- Fix specifications related to ports
- Fix documentation of `register/2`

Signed-off-by: Paul Guyot <pguyot@kallisys.net>
@pguyot pguyot force-pushed the w03/fix-spi-driver branch from e2cb90b to af32e12 Compare January 18, 2025 19:50
Copy link
Collaborator

@UncleGrumpy UncleGrumpy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fantastic. It looks like you found a lot more places that needed updating in the erlang sources than just the spi case that I was aware of.

@pguyot
Copy link
Collaborator Author

pguyot commented Jan 18, 2025

This is fantastic. It looks like you found a lot more places that needed updating in the erlang sources than just the spi case that I was aware of.

It's based on our conversation on whereis/1 and register/2. Hopefully with #1473 and #1474 transition to ports should be achieved.

@bettio bettio merged commit 6cdbb3d into atomvm:feature/distributed-erlang Jan 19, 2025
107 checks passed
@pguyot pguyot deleted the w03/fix-spi-driver branch January 19, 2025 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants