You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2022/03/10 08:45:59 UTC

[GitHub] [mynewt-core] kasjer commented on a change in pull request #2790: hw: Updates for new HCI transport

kasjer commented on a change in pull request #2790:
URL: https://github.com/apache/mynewt-core/pull/2790#discussion_r823474477



##########
File path: hw/drivers/ipc_nrf5340/src/ipc_nrf5340.c
##########
@@ -452,3 +459,40 @@ ipc_nrf5340_consume(int channel, uint16_t len)
 
     return ipc_nrf5340_shm_read(&shms[channel], NULL, NULL, len);
 }
+
+#if MYNEWT_VAL(BLE_TRANSPORT_INT_FLOW_CTL)
+int
+ble_transport_int_flow_ctl_get(void)
+{
+    int ret = 0;
+
+    __asm__ volatile (".syntax unified              \n"
+                      "1: ldrexb r1, [%[addr]]      \n"
+                      "   mov %[ret], r1            \n"
+                      "   cmp r1, #0                \n"
+                      "   it ne                     \n"
+                      "   subne r1, r1, #1          \n"
+                      "   strexb r2, r1, [%[addr]]  \n"
+                      "   cmp r2, #0                \n"
+                      "   bne 1b                    \n"
+    : [ret] "+r" (ret)

Review comment:
       I this was changed to:
   ```
   : [ret] "=&r" (ret)
   ```
   unnecessary initialization of ret could be omitted




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org