You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by vi...@apache.org on 2018/11/19 17:07:51 UTC

[mynewt-core] 04/07: fix address compare for transact_end

This is an automated email from the ASF dual-hosted git repository.

vipulrahane pushed a commit to branch dma_i2c_new_api
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 29b3078afb7621d58970d48a214df88b2b10b11b
Author: Vipul Rahane <vi...@runtime.io>
AuthorDate: Mon Oct 22 16:21:03 2018 -0700

    fix address compare for transact_end
---
 hw/mcu/nordic/nrf52xxx/src/hal_i2c.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_i2c.c b/hw/mcu/nordic/nrf52xxx/src/hal_i2c.c
index 133e330..5a81e86 100644
--- a/hw/mcu/nordic/nrf52xxx/src/hal_i2c.c
+++ b/hw/mcu/nordic/nrf52xxx/src/hal_i2c.c
@@ -396,7 +396,7 @@ hal_i2c_handle_transact_end(NRF_TWIM_Type *regs, uint8_t op, uint32_t start,
                             os_time_t abs_timo, uint8_t last_op)
 {
     int rc;
-    uint32_t evt;
+    volatile uint32_t *evt;
     os_time_t now;
 
     while(1) {
@@ -405,13 +405,13 @@ hal_i2c_handle_transact_end(NRF_TWIM_Type *regs, uint8_t op, uint32_t start,
          * monitored
          */
         if (last_op) {
-            evt = regs->EVENTS_STOPPED;
+            evt = &regs->EVENTS_STOPPED;
         } else {
-            evt = regs->EVENTS_SUSPENDED;
+            evt = &regs->EVENTS_SUSPENDED;
         }
 
-        if (evt) {
-            if (&evt == &regs->EVENTS_STOPPED) {
+        if (*evt) {
+            if (evt == &regs->EVENTS_STOPPED) {
 #if MYNEWT_VAL(NRF52_HANDLE_ANOMALY_109)
                 if (regs->FREQUENCY) {
                     regs->FREQUENCY = 0;