summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMateusz Maciaś <ursereg@gmail.com>2011-12-19 08:17:34 +0100
committerMateusz Maciaś <ursereg@gmail.com>2011-12-19 08:17:34 +0100
commit511296b8d91f84f20f0250a4cf4248cc56455dbc (patch)
treeaf2c331b883c24cc77e41677e8c92f392c917670
parent3ab40684e06bf4c8d85fd399d4e8d577d642c543 (diff)
downloaddoorman-511296b8d91f84f20f0250a4cf4248cc56455dbc.tar.gz
doorman-511296b8d91f84f20f0250a4cf4248cc56455dbc.tar.bz2
doorman-511296b8d91f84f20f0250a4cf4248cc56455dbc.tar.xz
doorman-511296b8d91f84f20f0250a4cf4248cc56455dbc.zip
Bugfix by fixxer - keyboard hang ups fixed.
-rw-r--r--arduino/arduino.pde8
1 files changed, 4 insertions, 4 deletions
diff --git a/arduino/arduino.pde b/arduino/arduino.pde
index 3b9746f..35cdbf3 100644
--- a/arduino/arduino.pde
+++ b/arduino/arduino.pde
@@ -674,7 +674,8 @@ boolean keypad_pin_get(unsigned long * p_pin){
switch (keypad_state){
case SEND:
//ask for pin
- keypad.print("#P");
+ keypad.print("#P");
+ byte_cntr=0;//clear input buffer
keypad_state=WAIT_RESP;
break;
@@ -686,9 +687,8 @@ boolean keypad_pin_get(unsigned long * p_pin){
byte_cntr++;
if(byte_cntr==KEYPAD_RESP_SIZE){
- //resp. received - store pin and clear input buffer
+ //resp. received - store pin
k=sscanf(keypad_bytes,"#%d",p_pin);
- byte_cntr=0;
keypad_state=SEND;
if(k==1)
//scanf successful - pin read
@@ -710,4 +710,4 @@ boolean keypad_pin_get(unsigned long * p_pin){
void keypad_off(void) {
keypad.print("XX");
keypad_state=SEND;
-}
+}