SAE Teensy ECU
IIT SAE Microcontroller programming
|
This script preprocesses source files for use with Log_t. More...
Go to the source code of this file.
This script preprocesses source files for use with Log_t.
This script works by first duplicating source files to the build folder.
Then it scans each file for calls to a Log function and modifies them as follows.
If the call has a string for LOG_TAG
parameter, give that string a unique integer ID and replace it with that integer.
If the ID is not a string, leave the variable alone.
Replace the call's LOG_MSG
string with a unique ID as well.
NOTE: The LOG_MSG
parameter must always be an inline string.
LOG_TAG
s and LOG_MSG
s do not share IDs.
Eg.
Calls to Log functions also have the option to send a number with a third parameter.
Eg.
Declarations of LOG_TAG
also have their strings replaced with a unique ID.
NOTE: Definition of LOG_TAG
s must always be an inline string.
Eg.
A special case has been made to also allocate and replace string that call the following macro
Where x is the string, it will be given a unique ID and replaced with said ID as if it were being called by a Logging function. This is useful where one wishes to generate log functions using the C preprocessor. Note, however, if this script is not run the macro should still allow everything to compile normally, leaving the string untouched
Definition in file Pre_Build.py.