sterlinghughes closed pull request #844: Bug fix for SCL being held low after NACK on NRF52 URL: https://github.com/apache/mynewt-core/pull/844
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_i2c.c b/hw/mcu/nordic/nrf52xxx/src/hal_i2c.c index 85b54e0c4..bc98afff6 100644 --- a/hw/mcu/nordic/nrf52xxx/src/hal_i2c.c +++ b/hw/mcu/nordic/nrf52xxx/src/hal_i2c.c @@ -301,6 +301,7 @@ hal_i2c_master_write(uint8_t i2c_num, struct hal_i2c_master_data *pdata, err: if (regs && regs->EVENTS_ERROR) { rc = regs->ERRORSRC; + regs->TASKS_STOP = 1; regs->ERRORSRC = rc; } return (rc); @@ -348,6 +349,7 @@ hal_i2c_master_read(uint8_t i2c_num, struct hal_i2c_master_data *pdata, while (!regs->EVENTS_RXDREADY && !regs->EVENTS_ERROR) { if (os_time_get() - start > timo) { regs->SHORTS = TWI_SHORTS_BB_STOP_Msk; + regs->TASKS_STOP = 1; goto err; } } @@ -366,6 +368,7 @@ hal_i2c_master_read(uint8_t i2c_num, struct hal_i2c_master_data *pdata, err: if (regs && regs->EVENTS_ERROR) { rc = regs->ERRORSRC; + regs->TASKS_STOP = 1; regs->ERRORSRC = rc; } return (rc); ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services