]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
eb_demo: Use port numbers defines from the eb_ebb lib.
authorMichal Vokac <vokac.m@gmail.com>
Fri, 25 Nov 2011 10:34:18 +0000 (11:34 +0100)
committerMichal Vokac <vokac.m@gmail.com>
Fri, 25 Nov 2011 10:34:18 +0000 (11:34 +0100)
src/eb_demo/def.h
src/eb_demo/main.c

index cd434dcae966d4e84e0f00661fe86158d86c4fe6..2a6b4228040f35a86ad7cadfd48e58b70660e0f3 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef DEFH
 #define DEFH
 
+#include <expansion.h>
+
 #define        CAN_SPEED       1000000         /* CAN bus speed */
 #define CAN_ISR                0
 
 #define START_SEND_PRIOD_SLOW  300     /* [miliseconds] */
 #define START_SEND_FAST_COUNT  10      /* How many times to send start with small period (after a change) */
 
-#define START_PIN               2       /* start pin */
-#define SWITCH_STRATEGY_PIN     3       /* strategy pin */
-#define BUMPER_REAR_PIN         8       /* bumper pin */
-#define BUMPER_LEFT_PIN         9       /* left bumper */
-#define BUMPER_RIGHT_PIN        15      /* right bumper */
+#define START_PIN               EXPPORT_8       /* start pin */
+#define SWITCH_STRATEGY_PIN     EXPPORT_4       /* strategy pin */
+#define BUMPER_REAR_PIN         EXPPORT_5       /* bumper pin */
+#define BUMPER_LEFT_PIN         EXPPORT_6       /* left bumper */
+#define BUMPER_RIGHT_PIN        EXPPORT_7       /* right bumper */
 
 extern volatile uint32_t timer_msec;
 extern volatile uint32_t timer_usec;  /* incremented by 10 @100kHz */
index d0d4b34eb40dacaa3defb8eb8d8b7b21de159380..ececd61d486207728e567f38bf1e78a3bad4b652 100644 (file)
@@ -395,11 +395,11 @@ int main(void)
 
         init_periphery();
 
-        SET_PIN(PINSEL0, START_PIN, PINSEL_0);
+        SET_PIN(PINSEL1, (START_PIN - 16), PINSEL_0);
         SET_PIN(PINSEL0, SWITCH_STRATEGY_PIN, PINSEL_0);
-        SET_PIN(PINSEL0, BUMPER_LEFT_PIN, PINSEL_0);
+        SET_PIN(PINSEL1, (BUMPER_LEFT_PIN - 16), PINSEL_0);
         SET_PIN(PINSEL0, BUMPER_RIGHT_PIN, PINSEL_0);
-        SET_PIN(PINSEL0, BUMPER_REAR_PIN, PINSEL_0);
+        SET_PIN(PINSEL1, (BUMPER_REAR_PIN - 16), PINSEL_0);
 
         IO0DIR &= ~(1<<START_PIN);
         IO0DIR &= ~((1<<BUMPER_REAR_PIN) | (1<<BUMPER_LEFT_PIN) | (1<<BUMPER_RIGHT_PIN));