Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: spelling

...

  • Global (to the app) variables are declared in a struct for easy debugging.
  • CLI commands are defined.
  • p2_init (init process 2) is the entry point for your code - you can initialize memory and semaphores here, and start your tasks.  See proper use of p2_init() for further details.
  • tasks - If you are relying on task priority to coordinate activity, you're probably doing it wrong.  To be low power, tasks need to be sleepy, idling most of the time by pending on a semaphore (or similar mechanism) and only waking to perform short tasks.  Polling wastes a lot of CPU time - it is far better to use an OS timer that than a busy while loop to manage timing. 
  • functions - functions should be kept as short as possible to avoid blocking tasks unnecessarily. This includes your Rx Callback function (if applicable).  For example, when sending a packet, it is often better (particularly as your applications grow more complex) to store the packet in a global variable, and use a semaphore to signal an aysnchronous asynchronous "send task" that a packet is available.
  • kernel header - the kernel header provides version information about your application for the stack. By default it contains the OCSDK version.

...