lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] FreeRTOS/lwIP Win32 simulator project now hosted


From: FreeRTOS Info
Subject: Re: [lwip-users] FreeRTOS/lwIP Win32 simulator project now hosted
Date: Mon, 25 Jul 2011 09:38:47 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.18) Gecko/20110616 Lightning/1.0b2 Thunderbird/3.1.11

Hi Paul,

Thanks, that is exactly the sort of feedback I was hoping for.

> A bug that I have spotted with the stats tracking in sys_arch.c
> 
> When stats for 'used' counter is tracked, the macro
> SYS_STATS_INC_USED(x) should be used.
> 
> So for example in
> err_t sys_mbox_new(sys_mbox_t *mbox, int size)
> 
> #if SYS_STATS
> 
>               SYS_STATS_INC(mbox.used);
> 
> #endif /* SYS_STATS */
> 
> Should be replaced with
> SYS_STATS_INC_USED(mbox.used);


Done - although I think it should be SYS_STATS_INC_USED( mbox ) /*
without the .used on the mbox. */

I could not see that there was a SYS_STATS_DEC_USED equivalent.


> There is no need for the #if SYS_STATS as the macro takes care of that for 
> you.

I have also removed all #if SYS_STATS conditional compilations, except
in one place where there is an if() statement inside the #if #endif,
which might cause a compiler warning when the if() has no conditionally
executed code.

> 
> When using a SYS_STATS_INC_USED macro, it also keeps track of the
> maximum allocated at one time.
> 

I have attached my current file.  It has also been bent into the
FreeRTOS coding style since I posed it up, as it is FreeRTOS specific file.

To demonstrate sockets use, the current plan is to add in a simple
telnet "like" console (just single connection to keep it really simple),
and command interpreter (to return the same information that is already
being returned by the web server).  Then it will just be a case of
adding in a sockets client side demo.

Regards,
Richard.

+ http://www.FreeRTOS.org
Designed for Microcontrollers.
More than 7000 downloads per month.

Attachment: sys_arch.c
Description: Text document


reply via email to

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