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

Hang if no pull-up present #97

Open
xross opened this issue Oct 1, 2024 · 2 comments
Open

Hang if no pull-up present #97

xross opened this issue Oct 1, 2024 · 2 comments

Comments

@xross
Copy link
Contributor

xross commented Oct 1, 2024

The lib includes a wait on SCL high, this is either an event or a polling loop, dependent on implementation.

If this is called on a system where the pull up isn't present then the project can hang forever - not ideal.

If would be better if this error was detected and reported to the developer.

This could be done with timeouts or a simple check for pull-up present at init time.

Real world use case is running USB Audio project on a custom board - we ideally don't want it to hang.

@XMOS-JoeG
Copy link

Example:

p_scl when pinseq(1) :> void;

in release_clock_and_wait function. Yes function should wait until clock goes high, but not forever!

Should timeout and report error or similar.

@xross
Copy link
Contributor Author

xross commented Oct 1, 2024

Polling loop example:

while (!(val & SCL_HIGH)) {

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

No branches or pull requests

2 participants