Due I2C Driver Concept Question

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
major4x
Posts: 9
Joined: Fri Nov 07, 2014 4:12 am

Due I2C Driver Concept Question

Postby major4x » Fri Mar 18, 2016 6:01 pm

Hi,

I took the template from the I2C AVR port and this doesn't seem to work. Before I start debugging, let me post the question, maybe I don't understand something simple:

This causes the I2C driver to hang:

i2c_lld.c:

Code: Select all

OSAL_IRQ_HANDLER(TWI1_Handler) {
  OSAL_IRQ_PROLOGUE();
    .
    .
    .
  if (i2cp->errors != I2C_NO_ERROR) {
    _i2c_wakeup_error_isr(i2cp);
  }

  OSAL_IRQ_EPILOGUE();
}

msg_t i2c_lld_master_transmit_timeout(I2CDriver *i2cp, i2caddr_t addr,
                                      const uint8_t *txbuf, size_t txbytes,
                                      uint8_t *rxbuf, size_t rxbytes,
                                      systime_t timeout) {
    .
    .
  return osalThreadSuspendTimeoutS(&i2cp->thread, timeout);
}


Commenting-out "_i2c_wakeup_error_isr(i2cp);" makes the i2c timeout. What am I doing wrong or this is outside of I2C?

Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 44 guests