mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
Replace nxsem_timedwait_uninterruptible with nxsem_tickwait_uninterruptible
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Petro Karashchenko
parent
816ce73ab4
commit
1fb8c13e5e
@@ -125,7 +125,6 @@ static int uartwriteconf(FAR const struct btuart_lowerhalf_s *lower,
|
||||
int ret;
|
||||
int gotlen = 0;
|
||||
FAR uint8_t *din;
|
||||
struct timespec abstime;
|
||||
|
||||
DEBUGASSERT(lower != NULL);
|
||||
|
||||
@@ -149,22 +148,7 @@ static int uartwriteconf(FAR const struct btuart_lowerhalf_s *lower,
|
||||
din = kmm_malloc(maxl);
|
||||
while (gotlen < maxl)
|
||||
{
|
||||
ret = clock_gettime(CLOCK_REALTIME, &abstime);
|
||||
if (ret < 0)
|
||||
{
|
||||
goto exit_uartwriteconf;
|
||||
}
|
||||
|
||||
/* Add the offset to the time in the future */
|
||||
|
||||
abstime.tv_nsec += NSEC_PER_SEC / 10;
|
||||
if (abstime.tv_nsec >= NSEC_PER_SEC)
|
||||
{
|
||||
abstime.tv_nsec -= NSEC_PER_SEC;
|
||||
abstime.tv_sec++;
|
||||
}
|
||||
|
||||
ret = nxsem_timedwait_uninterruptible(rxsem, &abstime);
|
||||
ret = nxsem_tickwait_uninterruptible(rxsem, MSEC2TICK(100));
|
||||
if (ret < 0)
|
||||
{
|
||||
/* We didn't receive enough message, so fall out */
|
||||
|
||||
Reference in New Issue
Block a user