#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 */
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));