- mention Uncrustify instead of GNU Indent
- add a missing argument of code_style_example_function()
- make the function return 0 or 1 as per doxygen comment
- replace tab with spaces
- correct case() to switch() in a comment
- add an indentation example for switch statement
in case of compiling any example that contains the definition of UIP_CONF_RECEIVE_WINDOW over Z1 mote.
i receive this warning:
In file included from ../../../core/./contiki.h:38:0,
from ../../../core/./contiki-net.h:37,
from httpd-simple.c:43:
../../../platform/z1/./contiki-conf.h:225:0: warning: "UIP_CONF_RECEIVE_WINDOW" redefined
./project-conf.h:60:0: note: this is the location of the previous definition
This includes support for preemption ready to be integrated into
exception handlers.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
Preemption was supposed to be supported, but it had no means of safely
updating the state of a thread, so mt_exec() could fail to resume a
preempted thread.
mt_exec() is allowed to be called only from the main Contiki thread, so
the mt threads passed to it may be only ready or exited, not running.
Consequently, there is no need for a distinction between the ready and
running states, so merge them as a started state, which avoids having to
update the state of a thread upon preemption.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
If mt_yield() needs it, then mt_exit() too. A thread could indeed be
preempted while calling mt_exit().
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
Compiling examples/er-rest-example for the avr-raven gives:
integer overflow in expression [-Woverflow]
On the AVR int is 16 bit and some calculations may overflow.
This happens for example with multiplications involving
CLOCK_SECOND where all the operands are of type int.
Casting one of the operands to clock_time_t forces
the arithmetic to clock_time_t without increasing the size
of the program (the calculation is performed at compile time).
Some arguments passed to the functions disabled with
LPM_CONF_ENABLE == 0 could trigger build warnings because they became
unused with this configuration option. Disable these functions by using
empty static inline functions instead of empty macros, so that the
function arguments are always considered by the compiler as used,
without having to #if-out code in many places.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>