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.
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
This C tutorial explains how to use the #ifdef preprocessor directive in the C language. In the C Programming Language, the #ifdef directive allows for conditional compilation.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.