mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-30 15:30:30 +00:00
The function was missing the case when the stack was used completely,
and didn't return a value then.
This commit is contained in:
parent
d60f3449ea
commit
1d4db3e2cc
@ -28,7 +28,7 @@
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* @(#)$Id: mtarch.c,v 1.3 2006/09/26 20:56:56 adamdunkels Exp $
|
||||
* @(#)$Id: mtarch.c,v 1.4 2007/09/14 20:21:01 nvt-se Exp $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@ -139,10 +139,13 @@ int
|
||||
mtarch_stack_usage(struct mt_thread *t)
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i = 0; i < MTARCH_STACKSIZE; ++i) {
|
||||
if(t->thread.stack[i] != (unsigned short)i) {
|
||||
return MTARCH_STACKSIZE - i;
|
||||
}
|
||||
}
|
||||
|
||||
return MTARCH_STACKSIZE;
|
||||
}
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
Loading…
Reference in New Issue
Block a user