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.

reverse #define name, in CCS

Status
Not open for further replies.

erpgc82

Junior Member level 1
Joined
Mar 21, 2021
Messages
17
Helped
0
Reputation
0
Reaction score
1
Trophy points
3
Activity points
228
Hello friends, how do I invert pin names, depending on the value of a variable or a memory address?
==> CCS COMPILER


Example:
if a condition is X:
#define SENSOR_E PIN_A1
#define SENSOR_S PIN_A2

If a condition is Y:
#define SENSOR_E PIN_A2
#define SENSOR_S PIN_A1

Can someone help me?
 

The way you describe is as good as any other way. It makes it clear exactly what happens, in case you (or anyone else) examines your code someday.

The aim is to account for all possible conditions and thus be certain all assignments are done. Therefore it might pay to check afterward that all assignments received a legitimate value, and if not then display an alert.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top