The code is for a heartbeat sensor using the MSP430. Which part is responsible for actually counting the pulses?
@@ak96 Nothing wrong with preferring bare metal, my preference as well
Take a look at the innards of the counter library, even if you don't plan to use Energia. It basically sets up a timer to count up when a pin changes from 0 to 1. Using the timer, you don't need an interrupt for the counting itself.
The source code of the library may look a bit cryptic, because it tries to accommodate many different MSP430s. The gist is:
1. Set GPIO pin as input and select it's function (PxSEL) a