Project

General

Profile

Revision f5d1f56a

IDf5d1f56aef806f0605b9efd49ef2758368ea238d
Parent 215b2fa6
Child 420df25b

Added by Thomas Mullins over 11 years ago

Added tool state TS_DENY, with red LED until card is removed

View differences:

toolbox/main.c
12 12
  TS_INIT,
13 13
  TS_OFF,
14 14
  TS_WAIT_ACCESS,
15
  TS_DENY,
15 16
  TS_REQ_DIS,
16 17
  TS_MISSING_ID,
17 18
  TS_ON
......
69 70
      break;
70 71

  
71 72
    case TS_OFF:
72
      led_red();
73
      led_off();
73 74
      if (serno_is_nonzero(latest_reading)) {
74 75
        serno_cpy(current_user, latest_reading);
75 76
        set_coil(MB_COIL_NEW, 1);
......
83 84
        tool_enable();
84 85
        toolstate = TS_ON;
85 86
      } else if (!get_coil(MB_COIL_NEW)) {
86
        toolstate = TS_OFF;
87
        toolstate = TS_DENY;
87 88
      }
88 89
      break;
89 90

  
91
    case TS_DENY:
92
      led_red();
93
      if (!serno_equal(current_user, latest_reading)) {
94
        toolstate = TS_OFF;
95
        serno_zero(current_user);
96
      }
97

  
90 98
    case TS_REQ_DIS:
91 99
      if (!get_coil(MB_COIL_EN)) {
92 100
        tool_disable();

Also available in: Unified diff