Skip to content

Commit b892a91

Browse files
committed
CP: Fix PD poll loop after the multi-drop-only change
Since we moved to the multi-drop-only approach, we cannot move on to polling other PDs when one is still responding to a command. This patch fixes a leak from the old implementation. Signed-off-by: Siddharth Chandrasekaran <sidcha.dev@gmail.com>
1 parent 661900c commit b892a91

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/osdp_cp.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,6 +1630,15 @@ void osdp_cp_refresh(osdp_t *ctx)
16301630

16311631
state_update(pd);
16321632

1633+
/*
1634+
* On a shared multi-drop bus the CP must complete one PD's
1635+
* exchange before starting the next. Break while the channel
1636+
* is occupied with a send/reply/retry cycle.
1637+
*/
1638+
if (cp_phy_running(pd)) {
1639+
break;
1640+
}
1641+
16331642
next_pd_idx = pd->idx + 1;
16341643
if (next_pd_idx >= cp_ctx->_num_pd) {
16351644
next_pd_idx = 0;

0 commit comments

Comments
 (0)