-#define SAVETCLK savedtclk=P5OUT&TCLK;
-#define RESTORETCLK if(savedtclk) P5OUT|=TCLK; else P5OUT&=~TCLK
-
-
-//16-bit MSP430 JTAG commands, bit-swapped
-#define IR_CNTRL_SIG_16BIT 0xC8 // 0x13
-#define IR_CNTRL_SIG_CAPTURE 0x28 // 0x14
-#define IR_CNTRL_SIG_RELEASE 0xA8 // 0x15
-// Instructions for the JTAG Fuse
-#define IR_PREPARE_BLOW 0x44 // 0x22
-#define IR_EX_BLOW 0x24 // 0x24
-// Instructions for the JTAG data register
-#define IR_DATA_16BIT 0x82 // 0x41
-#define IR_DATA_QUICK 0xC2 // 0x43
-// Instructions for the JTAG PSA mode
-#define IR_DATA_PSA 0x22 // 0x44
-#define IR_SHIFT_OUT_PSA 0x62 // 0x46
-// Instructions for the JTAG address register
-#define IR_ADDR_16BIT 0xC1 // 0x83
-#define IR_ADDR_CAPTURE 0x21 // 0x84
-#define IR_DATA_TO_ADDR 0xA1 // 0x85
-// Bypass instruction
-#define IR_BYPASS 0xFF // 0xFF
-
+#define SAVETCLK savedtclk=SPIOUT&TCLK;
+#define RESTORETCLK if(savedtclk) SPIOUT|=TCLK; else SPIOUT&=~TCLK
+
+//JTAG commands
+#define JTAG_IR_SHIFT 0x80
+#define JTAG_DR_SHIFT 0x81
+#define JTAG_RESET_TAP 0x82
+#define JTAG_RESET_TARGET 0x83
+#define JTAG_DETECT_IR_WIDTH 0x84
+#define JTAG_DETECT_CHAIN_LENGTH 0x85
+#define JTAG_GET_DEVICE_ID 0x86
+//#define JTAG_DR_SHIFT20 0x91
+
+extern app_t const jtag_app;
+
+#endif