[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] mutex API in system layer is necessary ?
From: |
FreeRTOS Info |
Subject: |
Re: [lwip-users] mutex API in system layer is necessary ? |
Date: |
Tue, 08 May 2012 09:53:03 +0100 |
User-agent: |
Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 |
On 08/05/2012 06:20, Simon Goldschmidt wrote:
> vincent cui <address@hidden> wrote:
>> I had port latest lwip1.4.0 to my system, it works well . but I found some
>> additional api about mutex are defined in 1.4.0
>>
>> I want to know that are they necessary ?
>
> No, as it says in sys.h: "Define LWIP_COMPAT_MUTEX if the port has no mutexes
> and binary semaphores should be used instead". The only disadvantage of using
> binary semaphores (in this case, the sys_mutex_* functions are defined to
> their sys_sem_* substitute) is that you can get priority inversion (mutextes
> are only used for communication between API tasks using netconn or sockets
> and the tcpip_thread).
>
> Simon
Trying to keep everything in the same place and out of my own personal
email (FreeRTOS support questions should use the support forum please!),
from a private email:
> For lwIP 1.4.0 with add mutex api in system layer. They are following. I
> write them with freertos mutex api, but it can’t work, once I remove
> those code, lwIP works again .
>
> Who know why ?
>
>
>
> err_t sys_mutex_new(sys_mutex_t *mutex)
>
> {
>
> // *mutex = xSemaphoreCreateMutex();
<snip a lot>
There are example FreeRTOS port layers for lwIP in a few places from
which the mutex implementation can just be cut and paste.
A recent(ish) demo is here:
http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_IO/Demo_Applications/LPCXpresso_LPC1769/NXP_LPC1769_Demo_Description.shtml
An older(ish) demo that uses a Windows simulated environment (and now
has an out of date CLI implementation) can be found here:
http://interactive.freertos.org/entries/20290712-freertos-win32-project-with-lwip-web-server
Regards,
Richard.
+ http://www.FreeRTOS.org
Designed for microcontrollers. More than 7000 downloads per month.
+ http://www.FreeRTOS.org/trace
15 interconnected trace views. An indispensable productivity tool.
Re: [lwip-users] mutex API in system layer is necessary ?,
FreeRTOS Info <=
Re: [lwip-users] mutex API in system layer is necessary ?, Mason, 2012/05/10