Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Each Include Page_def_ocsdk_def_ocsdk example includes a function sample application a p2_init() that is evaluated function that gets executed before the uC/OS-II starts.  ThereforeTherefore, only certain the following operations are permitted in p2_init():

  • Initialize global variables - e.g. by direct assignment or by using C functions such as memcpy, or or memset.
  • Create semaphores - e.g. calling OSSemCreate or OSMutexCreate() or OSMutexCreate().
  • Initialize tasks - e.g. calling OSTaskCreateExt(), OSTaskNameSet().
  • Register Installing callbacks.

Some things you should not do:

  • Call other OS functions
  • Print to the CLI
  • Interact with peripherals or the filesystem
  • Make other API calls

These need to be done in your tasks before the while(1) loop loop. If Task A requires Task B to do something, then a semaphore should be used.