lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] sys.c - sys_msleep


From: Martin Velek
Subject: [lwip-users] sys.c - sys_msleep
Date: Wed, 23 Nov 2011 07:58:21 +0100

Hi,

I have defined sys_msleep() to vTaskDelay() - (1 tick == 1 ms) in
sys_arch.h, because the default implementation is quite tricky.
However the compiler complains about vTaskDelay() redefinition thus I
had to modify sys.c, see below. Is this modification correct?

As I know, sys_msleep is called only from pppInputThread(void *arg)
and there is not need to do define it but ...

Thank you for your answers

Martin
---------------------------------------------------------
#ifndef sys_msleep
void
sys_msleep(u32_t ms)
{
  if (ms > 0) {
    sys_sem_t delaysem;
    err_t err = sys_sem_new(&delaysem, 0);
    if (err == ERR_OK) {
      sys_arch_sem_wait(&delaysem, ms);
      sys_sem_free(&delaysem);
    }
  }
}
#endif



reply via email to

[Prev in Thread] Current Thread [Next in Thread]