This addresses a bug visible as a sudden frequency shift while transmitting. A bug in the blocking behavior of i2c_write corrupts the I2C transaction to the DAC such that the VCTCXO VCTL is adjusted, skewing the transmit frequency. The issue stems from using the byte count as an indication of bytes sent, when in fact this is off by one. This sets up a race condition where future I2C transactions may be started before the current one completes. Adding an explicit TX done flag, set when the stop condition is asserted, resolves this issue. Note that the entry to i2c_write checks that the stop condition has finished, preventing another race.
This addresses a bug visible as a sudden frequency shift while transmitting. A bug in the blocking behavior of
i2c_write
corrupts the I2C transaction to the DAC such that the VCTCXO VCTL is adjusted, skewing the transmit frequency. The issue stems from using the byte count as an indication of bytes sent, when in fact this is off by one. This sets up a race condition where future I2C transactions may be started before the current one completes. Adding an explicit TX done flag, set when the stop condition is asserted, resolves this issue. Note that the entry toi2c_write
checks that the stop condition has finished, preventing another race.