Commit 2bc45153 authored by Adam Wujek's avatar Adam Wujek

proto-ext-whiterabbit/state-wr-s-lock: sleep in locking_poll during polling

Sleep in locking_poll when polling. In WRPC it takes 6 more seconds (twice),
to lock due to the waiting for timeouts to expire. For WRS added usleep to
reduce the CPU load when waiting for HAL.
Signed-off-by: 's avatarAdam Wujek <adam.wujek@creotech.pl>
parent 253fac9d
......@@ -47,5 +47,5 @@ int wr_s_lock(struct pp_instance *ppi, void *buf, int len, int new_state)
WRH_OPER()->locking_enable(ppi);
}
return 100 ;/* 100ms : We check every 100ms if the PLL is locked */
return 0; /* 0ms : If needed we yeld in locking_poll during waiting for the PLL to lock */
}
......@@ -308,6 +308,9 @@ int wrs_locking_poll(struct pp_instance *ppi)
char *pp_diag_msg;
char text[128];
/* Wait 10ms between checks when polling */
usleep(10 * 1000);
ret = minipc_call(hal_ch, DEFAULT_TO, &__rpcdef_lock_cmd,
&rval, ppi->iface_name, HEXP_LOCK_CMD_CHECK, 0);
if ( ret<0 ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment