 
   bool last_gate;
   uint8_t last_stage;
+  bool last_diradd_mode;
+  bool last_reverse;
 
   bool display_changed[6];
 

#include <avr/pgmspace.h>
#include <util/atomic.h>

#define DIGITAL_THRESH 1.25 // V

enum GateMode {
  GATE_NONE = 0,

    update_clock();

    // draw global elements
    for(uint8_t i = 0; i < 6; ++i)
    {
      display->draw_vline(2 + i, 18 - i, i + 1, DUINO_SSD1306::White);
    }
    display->draw_char(10, 12, '0' + params.vals.stage_count, DUINO_SSD1306::White);
    display->draw_char(22, 12, params.vals.diradd_mode ? 'A' : 'D', DUINO_SSD1306::White);
    display->draw_char(30, 12, 0x10, DUINO_SSD1306::White);
    for(uint8_t i = 0; i < 2; ++i)
    {
      display->draw_vline(59 + i * 25, 12, 7, DUINO_SSD1306::White);
