Skip to content

Best Practice for RIOT Programming

Oleg Hahm edited this page May 26, 2015 · 5 revisions

Some "Dos" and "Don'ts" for RIOT development:

Dos

  • Use static memory. See also Static vs. Dynamic Memory.
  • Select the priorities carefully.
  • Minimize stack usage with DEVELHELP and CREATE_STACKTEST.
  • Use threads to increase flexibility, modularity, and robustness by leveraging IPC.

Don'ts

  • Don't use too many threads. Try not to use more than one thread per module. Don't create threads for one-time tasks.
  • Don't use the POSIX wrapper if implementing something from scratch.
  • Don't allocate big chunks of memory (for instance the IPC message queue) on the stack, but use rather static memory for that.
Clone this wiki locally