[En-Nut-Discussion] NutHeapAvailable() question

Alexander Baranov baranov at intech21.com
Fri Sep 29 17:28:18 CEST 2006


Henrik, thank you.
I tried 
 amama = NutHeapAvailable(); 
 fprintf(uart, "\n\r%d, %d, %d\n\r", amama, amama, amama );
and  got first amama corrupted.
Then I tried
 int amama = 12;
 fprintf(uart, "\n\r%d, %d, %d\n\r", amama, amama, amama );
and also got
 -1, 12, 12
So the reason is not in NutHeapAvailable() but in some fprintf issues.
Regards
Alex.
----- Original Message ----- 
From: "Henrik Maier" <hmlists at focus-sw.com>
To: "Ethernut User Chat (English)" <en-nut-discussion at egnite.de>
Sent: Thursday, September 28, 2006 8:38 PM
Subject: Re: [En-Nut-Discussion] NutHeapAvailable() question


> Whenever these things happened to me it typically was a type mismatch 
> error due to missing prototypes (32-bit or 8-bit int passed when 16-bit 
> expected or vice versa). Any compiler warnings giving a hint? Compile 
> with -Wall.
> 
> Also try this:
> 
> int amama, ababa; /* Both should be int as %d expects an int */
> amama = NutHeapAvailable(); ababa = NutHeapAvailable();
> fprintf(uart, "\n\rHeap available = %d,  %d \r\n", amama, amama);
>                                                           ~~~~~~~
> 
> Henrik
> http://www.proconx.com
> 
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
> 
>



More information about the En-Nut-Discussion mailing list