NetBurner 3.5.6
PDF Version |
Additional instructions if the overload directory is used in an NBEclipse project:
This example demonstrates how to use the NetBurner overload directory feature to override system files in a project-specific manner. The overload directory allows developers to modify system configuration files without affecting other projects or the original NNDK installation.
The Overload Directory Example is a basic demonstration of the overload directory in a project. The overload directory is used to override any system file by including local copies of system source files or headers. This allows the user to make changes to system files exclusively for a project. The overload directory provides an alternative to modifying the original system files, which would affect all projects.
To use this feature, the file to be overloaded should be placed in the overload directory under a directory structure that matches the file's location relative to the NNDK install directory.
This example application utilizes the overload directory to override predef.h (a NetBurner configuration header file). The overloaded predef.h defines the macro NBRTOS_TIME
, which is not defined by default.
To overload the predef.h header, the directory structure is replicated inside the overload directory. For example, predef.h is located in the following directory in the NNDK install:
`/nburn/nbrtos/include/predef.h`
Therefore, the directory structure is replicated inside the overload directory with the following structure:
`<project root>/overload/nbrtos/include/predef.h`
The Overload Directory Example is a simple NetBurner application that showcases the overload directory functionality by:
ShowTaskTimes()
function, which is only available when the NBRTOS_TIME
macro is definedThe overload directory provides a mechanism to override any system file by including local copies of system source files or headers. This approach offers several advantages:
This project demonstrates overloading the predef.h
system header file to define the NBRTOS_TIME
macro, which enables the ShowTaskTimes()
function.
The overload directory must replicate the directory structure of the file being overridden relative to the NNDK install directory.
The main application file that:
ShowTaskTimes()
function (available due to overloaded predef.h
)Contains the overloaded configuration that defines:
This macro enables the compilation of task timing functionality in the NetBurner system library.
The original documentation explaining the overload directory concept and usage instructions.
If using this example in an NBEclipse project, additional configuration is required:
After adding an overload folder to the "Include paths" list or adding new files to the overload folder:
Once properly configured, modifying overloaded files (like predef.h
) will automatically rebuild the necessary NetBurner Library files when the project builds.
When running the application:
ShowTaskTimes()
ShowTaskTimes()
function is only available when NBRTOS_TIME
is defined in predef.h