thermferm/panel.c

changeset 427
e8e548922e31
parent 426
e54611453d29
child 645
49eb753a958b
equal deleted inserted replaced
426:e54611453d29 427:e8e548922e31
47 47
48 extern int my_shutdown; 48 extern int my_shutdown;
49 extern int debug; 49 extern int debug;
50 extern int setupmenu; 50 extern int setupmenu;
51 extern uint16_t keys; 51 extern uint16_t keys;
52 extern uint16_t leds;
53 extern int slcdHandle;
52 54
53 int Key_Enter = FALSE; 55 int Key_Enter = FALSE;
54 int Key_Enter_Long = FALSE; 56 int Key_Enter_Long = FALSE;
55 int Key_Up = FALSE; 57 int Key_Up = FALSE;
56 int Key_Down = FALSE; 58 int Key_Down = FALSE;
135 Enter++; 137 Enter++;
136 if (Enter > PRESS_NORMAL) 138 if (Enter > PRESS_NORMAL)
137 Key_Enter = TRUE; 139 Key_Enter = TRUE;
138 if (Enter > PRESS_LONG) 140 if (Enter > PRESS_LONG)
139 Key_Enter_Long = TRUE; 141 Key_Enter_Long = TRUE;
140 #ifdef HAVE_WIRINGPI_H 142 if (Enter == PRESS_LONG) {
141 if (Enter == PRESS_LONG) 143 #ifdef HAVE_WIRINGPI_H
142 digitalWrite(PANEL_LED, 1); 144 digitalWrite(PANEL_LED, 1);
143 if (Enter == (PRESS_LONG + 10)) 145 #endif
146 leds |= SLED_TFLED;
147 slcdLEDs(slcdHandle);
148 }
149 if (Enter == (PRESS_LONG + 10)) {
150 #ifdef HAVE_WIRINGPI_H
144 digitalWrite(PANEL_LED, 0); 151 digitalWrite(PANEL_LED, 0);
145 #endif 152 #endif
153 leds &= ~SLED_TFLED;
154 slcdLEDs(slcdHandle);
155 }
146 } 156 }
147 157
148 #ifdef HAVE_WIRINGPI_H 158 #ifdef HAVE_WIRINGPI_H
149 if (digitalRead(PANEL_UP) && ((keys & 0x0008) == 0)) { 159 if (digitalRead(PANEL_UP) && ((keys & 0x0008) == 0)) {
150 #else 160 #else

mercurial