mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-11 07:40:10 +00:00
Individual I2C register reads and writes, even if to multiple bytes, are atomic. However, some i2c operations require multiple reads and writes to be strung together without interruption for them to be valid. A "mutex" is added, which if a program using I2C calls it prior to their I2C operation, it will block if another program is already using the I2C block for an uninterruptable series of operations. The caller will automatically be unblocked once the untinterruptable transactionts are completed. Note that this is a collaborative exercise, a caller can still try to initiate an I2C operation without getting a mutex first, in which case it could interrupt another block that is doing something uninterruptable. At the moment this merely generates a warning on the console, but eventually, this will become a panic. |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||