 
 
 int active_player = NONE;
-volatile int button_pressed = NONE;
+
+class Button {
+public:
+  static volatile int button_pressed;
+
+  Button(int interrupt_number, void (*interrupt_handler)()) {
+    attachInterrupt(interrupt_number, interrupt_handler, RISING);
+  }
+};
+volatile int Button::button_pressed = NONE;
 
 inline void handle_button_interrupt(int button) {
-  button_pressed = button;
+  Button::button_pressed = button;
 }
 
 void handle_button_interrupt_0() {

    players[active_player]->update_display();
  }

  if ((active_player == NONE || button_pressed == active_player) && button_pressed != NONE)   {
    handle_button_press(button_pressed);
  }     

}


Player *players[2] = { 
  new Player(
    new Button(0, handle_button_interrupt_0),
    new Screen(4,5,6)
  ),
  new Player(
    new Button(1, handle_button_interrupt_1),
    new Screen(7,8,9)
  )
};

void handle_button_press(int button) {
  serprintf("button %d pressed\r\n", button);
  serprintf("before: active_player=%d, button_pressed=%d\r\n", active_player, Button::button_pressed);
  active_player = (Button::button_pressed + 1) % 2;
  players[active_player]->clock->last_update_ms = millis();
  Button::button_pressed = NONE;
  serprintf("after:  active_player=%d, button_pressed=%d\r\n", active_player, Button::button_pressed);
}

void setup(void) {
