 }
 
 void StatePressTargetButton::handle() {
-  const int t = time_in_state.time_millis();
+  const int t = time_in_current_state.time_millis();
 
   // TODO: make these numbers consts.
   //

}

void StateIsLongPress::handle() {
  const int t = time_in_state.time_millis();

  // Handle the case were decouncing has not stabalized yet.
  if (!io_button.hasStableValue()) {


// The program is modeled as a finite state machine. This timer tracks the time in
//  millis the program is in the current state.
static PassiveTimer time_in_current_state;

// Utility function to initialize a new state. 
// TODO: why making the arg State instead of int does not compile?
void enterState(int state) {
  current_state = (State) state;
  time_in_current_state.restart(); 
  led_pattern = 0x00000000;
}

