   STATE_END           //6
 } STATE;
 
-byte sticky = 0;
-boolean seenReg = false;
-byte row = 0;
-byte card[CARD_ROWS];
-//unsigned int adc[NUM_CHANNELS];
-STATE state = STATE_NOCARD;
-STATE prev = STATE_NOCARD;
-
+//===== LOCAL DATA ===============================================================================
+
+static byte sticky = 0;
+static boolean seenReg = false;
+static byte row = 0;
+static byte card[CARD_ROWS];
+static STATE state = STATE_NOCARD;
+static STATE prev = STATE_NOCARD;
+
+
+//------------------------------------------------------------------------------------------------
 
 void setup()
 {

}


void sendCardReport(byte type, byte* pData, byte len)
{
  Serial.write(":"); // Start char

}


//------------------------------------------------------------------------------------------------
// Show card data on feedback LEDs

void writeLEDs(byte reg, byte data)
{
  digitalWrite(LED_REG, reg?HIGH:LOW);

  //TODO: Consider putting data LEDs on an 8 bit port to allow a single write
  //TODO: Consider running through crossbar if pins need remapping
  digitalWrite(LED_D7,  (data&(1<<7))?HIGH:LOW);
  //digitalWrite(LED_D6,  data&(1<<6));
  //digitalWrite(LED_D5,  data&(1<<5));
