Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

LVEmbeddedMain.c (Embedded Development Module)

LabVIEW Microprocessor SDK 2.5 Help
August 2007

NI Part Number:
372197A-01

»View Product Info

LVEmbeddedMain.c contains the main entry point for all applications the LabVIEW C Code Generator generates. This file contains functions that perform set up and tear down of common pieces, such as occurrences and FIFOs. LVEmbeddedMain.c uses #ifdefs rather than separate files for each OS. The main function in LVEmbeddedMain.c initializes all global variables and then calls the top-level VI in the project. After the top-level VI has completed, a shutdown routine is completed. The following two macros define the initialization and shutdown routines:

  • LV_PLATFORM_INIT
  • LVPLATFORM_FINI

You define these macros per target rather than per operating system. The labview\CCodeGen\libsrc\os folder hierarchy does not define LV_PLATFORM_INIT and LV_PLATFORM_FINI because a one-to-one mapping does not exist between operating systems and targets. For example, an eCos target on a Nintendo Gameboy Advanced device needs a certain LV_PLATFORM_INIT to set up the hardware, but eCos on the CMD565 does not.

If you define LV_PLATFORM_INIT as a function, LV_PLATFORM_INIT is called before any VI is called and before any other setup is performed. The target defines this function and you can implement it in any way that is appropriate for your target. If you define LV_PLATFORM_FINI as a function, LV_PLATFORM_FINI is called after all VIs have finished and any other tear down is complete.


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit