  */
 #define INMASK (SDIN)
 
+#ifdef USE_CLASS
 SALT_JX coreJ2 (2);
 //SALT_JX coreJ3 (3);
 //SALT_JX coreJ4 (4);
+#else
+extern void J2_update (void);
+extern void J3_update (void);
+extern void J4_update (void);
+extern struct J_data J2_data, J3_data, J4_data;
+#endif
+
+SALT_FETs coreFETs (1);
 
 Systronix_PCA9557 coreJ2reg(I2C_J2);
 Systronix_PCA9557 coreJ3reg(I2C_J3);
 Systronix_PCA9557 coreJ4reg(I2C_J4);
 
-Systronix_PCA9557 coreFET(I2C_FET);
+
 
 // TODO: move to common .h file as #defines;
 uint8_t periph_rst = 22;	// peripheral reset asserted LOW to PCA9557, etc on board
 uint8_t ether_rst = 8;		// Wiznet module reset LOW
 
-struct J_data
-	{
-	uint32_t	DC_data_in;			// data read from the DC board '165 shift register
-	uint16_t	AC_data_out;		// data sent to the AC board; send this before sending DC
-	uint16_t	DC_data_out;		// data sent to the DC board
-	} J2_data , J3_data, J4_data;
+//struct J_data
+//	{
+//	uint32_t	DC_data_in;			// data read from the DC board '165 shift register
+//	uint16_t	AC_data_out;		// data sent to the AC board; send this before sending DC
+//	uint16_t	DC_data_out;		// data sent to the DC board
+//	} J2_data , J3_data, J4_data;
 
 	
 //---------------------------< S E T U P >--------------------------------------------------------------------

 *  2016 May 26 bboyes moved into Systronix_PCA9557 examples folder
 *				Changed name to PCA9557_J2
 *  2016 May 15 bboyes Start with new SALT 2v0 board
 *	2016 Jul 4	wsk		complete thrash of this example used as a test bed for SALT_JX class
 */


#include <Arduino.h>
#include <Systronix_PCA9557.h>
#include <SALT_JX.h>
#include <NAP_pod_load_defs.h>

/**

	coreJ2reg.begin();
	coreJ3reg.begin();
	coreJ4reg.begin();
//	coreFETreg.begin();
	
	// outmask, outdata, inputinvert
//	coreJ2reg.init(OUTMASK, (SCLK | RCLK595 | LED), 0);
//	coreJ3reg.init(OUTMASK, (SCLK | RCLK595 | LED), 0);
//	coreJ4reg.init(OUTMASK, (SCLK | RCLK595 | LED), 0);

	coreFETs.init ();

#ifdef USE_CLASS
	coreJ2.AC_data_out = 0;				// clear DC and AC 595 registers
	coreJ2.DC_data_out = 0;
//	coreJ3.AC_data_out = 0;				// clear DC and AC 595 registers
