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
101
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,465
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.
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
22,999
Helped
4,714
Reputation
9,444
Reaction score
5,080
Trophy points
1,393
Activity points
152,384
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
 

BradtheRad

Super Moderator
Staff member
Joined
Apr 1, 2011
Messages
14,688
Helped
2,867
Reputation
5,744
Reaction score
2,876
Trophy points
1,393
Location
Minneapolis, Minnesota, USA
Activity points
109,735
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.
 

G4BCH

Advanced Member level 1
Joined
May 10, 2006
Messages
437
Helped
133
Reputation
268
Reaction score
123
Trophy points
1,323
Activity points
5,425
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

Top