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.
Activity
XMOS-JoeG commentedon Oct 1, 2024
Example:
lib_i2c/lib_i2c/src/i2c_master.xc
Line 58 in 648351b
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 commentedon Oct 1, 2024
Polling loop example:
lib_i2c/lib_i2c/src/i2c_master_single_port.xc
Line 69 in 82e82f2
xross commentedon Jul 9, 2025
Suggested implementation: