trajectories on hostsim
[aversive.git] / projects / microb2010 / mainboard / main.h
index 2fdd212..53cfe69 100755 (executable)
                        port |= _BV(bit);       \
        } while(0)
 
+#ifdef HOST_VERSION
+#define LED1_ON()
+#define LED1_OFF()
+#define LED1_TOGGLE()
+
+#define LED2_ON()
+#define LED2_OFF()
+#define LED2_TOGGLE()
+
+#define LED3_ON()
+#define LED3_OFF()
+#define LED3_TOGGLE()
+
+#define LED4_ON()
+#define LED4_OFF()
+#define LED4_TOGGLE()
+
+#define BRAKE_DDR()
+#define BRAKE_ON()
+#define BRAKE_OFF()
+
+#else
+
 #define LED1_ON()      sbi(PORTJ, 2)
 #define LED1_OFF()     cbi(PORTJ, 2)
 #define LED1_TOGGLE()  LED_TOGGLE(PORTJ, 2)
@@ -45,6 +68,7 @@
 #define BRAKE_DDR()     do { DDRJ |= 0xF0; } while(0)
 #define BRAKE_ON()      do { PORTJ |= 0xF0; } while(0)
 #define BRAKE_OFF()     do { PORTJ &= 0x0F; } while(0)
+#endif
 
 /* only 90 seconds, don't forget it :) */
 #define MATCH_TIME 89
@@ -115,7 +139,7 @@ struct genboard {
        struct pwm_ng servo2;
        struct pwm_ng servo3;
        struct pwm_ng servo4;
-       
+
        /* ax12 interface */
        AX12 ax12;
 
@@ -165,7 +189,7 @@ struct mainboard {
 
 /* state of cobboard, synchronized through i2c */
 struct cobboard {
-       uint8_t mode;   
+       uint8_t mode;
        uint8_t status;
        int16_t left_cobroller_speed;
        int16_t right_cobroller_speed;
@@ -174,7 +198,9 @@ struct cobboard {
 
 /* state of ballboard, synchronized through i2c */
 struct ballboard {
+       uint8_t mode;
        uint8_t status;
+       uint8_t ball_count;
 };
 
 extern struct genboard gen;