]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
make change, define input gpio, not work
authorehiker <ehiker@ubuntu.(none)>
Thu, 20 May 2010 22:00:25 +0000 (00:00 +0200)
committerehiker <ehiker@ubuntu.(none)>
Thu, 20 May 2010 22:00:25 +0000 (00:00 +0200)
src/eb_vidle/main.c

index 65c12f7e6394c914bcdedf51cf1a4aca3a0fac39..8a45442d72bd9499b24ebbdacc7fce3f323c2179 100644 (file)
@@ -248,11 +248,11 @@ void blink_led()
 }
 
 
-#define BUMPER_PIN     17              // bumper pin  (SCK1)
-#define COLOR_PIN      8               // bumper pin  (SDA/P0.3)
+#define BUMPER_PIN     17              // bumper pin  (SCK1/P0_17)
+#define COLOR_PIN      3               // change color of dress pin  (SDA1/P0_3)
 
-#define BUMPER_LEFT 21         // Port 1
-#define BUMPER_RIGHT 23                // Port 1
+#define BUMPER_LEFT 19         // left bumper MOSI1/P0_19
+#define BUMPER_RIGHT 9         // right bumper RXD1/P0_9       
 
 void handle_bumper()
 {
@@ -267,7 +267,7 @@ void handle_bumper()
                
                        
                        
-               if (IO0PIN & (1<<BUMPER_PIN))
+               if (IO1PIN & (1<<BUMPER_PIN))
                        sw &= ~CAN_SWITCH_BUMPER;
                else
                        sw |= CAN_SWITCH_BUMPER;
@@ -282,7 +282,7 @@ void handle_bumper()
                else
                        sw |= CAN_SWITCH_LEFT;
 
-               if (IO1PIN & (1<<BUMPER_RIGHT))
+               if (IO0PIN & (1<<BUMPER_RIGHT))
                        sw &= ~CAN_SWITCH_RIGHT;
                else
                        sw |= CAN_SWITCH_RIGHT;
@@ -373,14 +373,14 @@ int main(void)
        SET_PIN(PINSEL0, COLOR_PIN, PINSEL_0);
        SET_PIN(PINSEL1, 1, PINSEL_0);          // inicializace bumper pinu (FIXME SET_PIN je BLBA implemetace, musim ji nekdy opravit)
 
-/*     SET_PIN(PINSEL1, BUMPER_LEFT, PINSEL_0); */
-/*     SET_PIN(PINSEL1, BUMPER_RIGHT, PINSEL_0); */
+       SET_PIN(PINSEL1, 3, PINSEL_0); 
+       SET_PIN(PINSEL0, BUMPER_RIGHT, PINSEL_0); 
 
        
-       IO0DIR &= ~((1<<START_PIN) | (1<<BUMPER_PIN) | (1 << COLOR_PIN));
-       IO1DIR &= ~((1<<BUMPER_LEFT) | (1<<BUMPER_RIGHT));
+       IO0DIR &= ~((1<<START_PIN) | (1<<BUMPER_RIGHT) | (1 << COLOR_PIN));
+       IO1DIR &= ~((1<<BUMPER_PIN) | (1<<BUMPER_LEFT));
        
-       IO1DIR &= ~(3<<20);
+       //IO1DIR &= ~(3<<20);
 
        send_rs_str("Vidle started\n");
        // The above send_rs_str is importat - we wait for the first AD conversion to be finished