How to prevent unused functions from operating?

Status
Not open for further replies.

jani12

Member
Our Advanced Drive Assist Systems(ADAS) project is based on Two identical Renesas RH850 / U2A16 Microcontrollers. Our programming language is embedded 'C'.

How to create settings so that unused functions do no operate? Please provide an example.
 
Use #IFDEF / #ENDIF around the function and each reference to it, with a DEFINE you can comment out to disable it

Code:
// Uncommenting this allows the code in matching ifdefs to be visible to the compiler
//#DEFINE FUNCT001


// Each reference to the function and its definition
#IFDEF FUNCT001
//function code or call
..
..
#ENDIF

 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…