Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

Latest threads

New Articles From Microcontroller Tips

Back
Top