+#if (PBTN() == P1)
+ __bic_SR_register_on_exit(LPM0_bits); // Wake up
+}
+// GPIO interrupt service routine
+#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
+#pragma vector=PORT1_VECTOR
+__interrupt void Port_1(void)
+#elif defined(__GNUC__)
+void __attribute__ ((interrupt(PORT1_VECTOR))) Port_1 (void)
+#else
+#error Compiler not supported!
+#endif
+{
+#endif /* (PBTN() == P1) */
+ if (PBTN(IFG) & BIT_BTN) {
+ irq_events |= 1<<ev_btn1;
+ PBTN(IFG) &= ~BIT_BTN; // Clear button IFG
+ }
+#ifdef HAVE_BTN2
+ if (PBTN(IFG) & BIT_BTN2) {
+ irq_events |= 1<<ev_btn2;
+ PBTN(IFG) &= ~BIT_BTN2; // Clear button 2 IFG
+ }
+#endif
+ __bic_SR_register_on_exit(LPM0_bits); // Wake up