]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
eb_vidle: Negate bumper level (1 = pressed)
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 29 Apr 2010 15:05:01 +0000 (17:05 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 29 Apr 2010 15:05:01 +0000 (17:05 +0200)
src/eb_vidle/main.c

index e7599308c2c7ba42814527813c43abada43f0f75..8e44b271f42a4772fdbbbe1a5722f2475a2de1f9 100644 (file)
@@ -169,7 +169,7 @@ void CAN_rx(can_msg_t *msg) {
                        deb_led_on(LEDB);
                        req = ((rx_msg.data[0]<<8) | (rx_msg.data[1]));
                        
-                       if (req >= 0x140 && req <= 0x3f0) { /* TODO: Check the bounds */
+                       if (req >= 0x150 && req <= 0x3e0) {
                                fsm_vidle.flags &= ~CAN_VIDLE_OUT_OF_BOUNDS;
                                fsm_vidle.can_req_position = req;// save new req position of lift
                        } else
@@ -272,13 +272,13 @@ void handle_bumper()
                        
                if (IO0PIN & (1<<BUMPER_PIN))
                {    
-                       tx_msg.data[0] = 1;
-                       deb_led_on(LEDR);
+                       tx_msg.data[0] = 0;
+                       deb_led_off(LEDR);
                }
                else
                {
-                       tx_msg.data[0] = 0;
-                       deb_led_off(LEDR);
+                       tx_msg.data[0] = 1;
+                       deb_led_on(LEDR);
                }
                        
                can_tx_msg(&tx_msg);