SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions on how to get your MSP JTAG programmer up and running.
By alexx
#74490
I'm connecting multiple external interrupt sources to port1. How do I differentiate these sources in port1 ISR?

Another question: in msp430xxxx.h, PORT1_VECTOR is defined as:
#define PORT1_VECTOR (47 * 2u)

What does this mean, especially the 'u' here?

Thx.
By OldCow
#74498
There is an 8 bit register called P1IFG. Each of the 8 bit of this register indicates an interrupt from one of the 8 pins of P1.

The u following a number means the number is an unsigned number.
#define PORT1_VECTOR (47 * 2u)
means the same thing as
#define PORT1_VECTOR (94)
which in turn means
"from now on, when I say PORT1_VECTOR, I actually mean (94).
(That is the way c programmer talks.)