summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cesar/hal/phy/src/bridgedma.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/cesar/hal/phy/src/bridgedma.c b/cesar/hal/phy/src/bridgedma.c
index 31d9c20f87..1fc2490e6c 100644
--- a/cesar/hal/phy/src/bridgedma.c
+++ b/cesar/hal/phy/src/bridgedma.c
@@ -271,10 +271,11 @@ phy_bridgedma_jobs_get_ended (phy_bridgedma_t *ctx)
void
phy_bridgedma_stopped (phy_bridgedma_t *ctx)
{
- u32 expired = phy_date () + MAC_MS_TO_TCK (PHY_BRG_POLLING_WAIT_MS);
- while (_phy_bridgedma_status (ctx) && less_mod2p32 (phy_date (), expired))
+ u32 loop_date = phy_date ();
+ u32 expired = loop_date + MAC_MS_TO_TCK (PHY_BRG_POLLING_WAIT_MS);
+ for (; _phy_bridgedma_status (ctx) && less_mod2p32 (loop_date, expired);
+ loop_date = phy_date ())
;
- dbg_assert_print (_phy_bridgedma_status (ctx)
- || less_mod2p32 (phy_date (), expired),
- "Bridge DMA freezed");
+
+ dbg_assert_print (less_mod2p32 (loop_date, expired), "Bridge DMA frozen");
}