fix: pitlane response missing

Sat, 10 Dec 2011 10:51:24 +0100

author
Malte Bayer <mbayer@neo-soft.org>
date
Sat, 10 Dec 2011 10:51:24 +0100
changeset 68
c3460121ad8b
parent 67
369487be7c65
child 69
27c0c0095e26

fix: pitlane response missing

pitlane/main.c file | annotate | diff | comparison | revisions
--- a/pitlane/main.c	Fri Dec 09 22:30:55 2011 +0100
+++ b/pitlane/main.c	Sat Dec 10 10:51:24 2011 +0100
@@ -342,10 +342,15 @@
             }
         } sens[1].car = 0;
 
+        // TODO: At the moment, all "inside" cars gets exit response, but probably only the last response will be sent
+        // we have to detect which car is passing sensor2 - but at the moment we are lack of external interrupt source
         if ( (PIN(SENS2_PORT) & _BV(SENS2_PIN)) != 0 ) {
                 // set inside status
                 for (tmp=0; tmp<MAX_SLOTS; tmp++)
+                    if (slot[tmp].inside) {
+                    response = (1 | ((tmp)<<1) | (4 << 4));
                     slot[tmp].inside = 0;
+                }
                 RS232_puts_p(PSTR("PIT:EXIT\n"));
         }
 

mercurial