Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! 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

Advanced Member level 4
Joined
Oct 30, 2014
Messages
108
Helped
0
Reputation
0
Reaction score
1
Trophy points
1,298
Activity points
2,536
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.
 

Hi,

I don't understand the question.

If you don't want the function to be processed, then simply don't call it.
And if you don't need the function at all then delete it in the source code.

Klaus
 

Is your question about unknown operations going on by default? It requires detailed knowledge of the programming language, and the device.

Example, how it decides whether a variable is stored as an integer or floating point, if not specifically dimensioned.

Whether arithmetic is done in floating point or fixed point or integer, based on what symbol you use for a math operation.

Whether it polls automatically and how often, to detect a keypress or mouse event.

Whether it polls automatically and how often, to notice if a peripheral was connected/disconnected.
 

If this software is going to be used in a vehicle (the project title implies this) then it will hve to follow a coding standard and be subject to some kind of approval process (MISRA?). I have only been involved in one project that requiered a design assurance level, and any unused code, even if switched out at complie time was not allowed.
For development purposes you could use a conditional compiler directive to switch code in and out. Your IDE should have examples.
It will be something like

#define DEBUG
#ifdef DEBUG
Code that you only want for debugging

To stop the debug code form compling comment out #define DEBUG

From the above you can see why leaving such code in any safety critical software, well any sofware is a bad idea. Forget to remove the define or accidentally delete the #ifdef and bad things happen.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top