]> defiant.homedns.org Git - ros_wild_thumper.git/blobdiff - avr/motor_ctrl/main.c
set tle error flags high
[ros_wild_thumper.git] / avr / motor_ctrl / main.c
index f8a5c34b95fbb81eebca2a3e7ea923610e661c19..83022cb6785bc39f87aefd9525d8bbdf37b7ba30 100644 (file)
@@ -545,19 +545,19 @@ ISR(TWI_vect)
                                        TWI_ACK;
                                        break;
                                case 0x48: // Position angle MSB
-                                       TWDR = pos_y.i>>24;
+                                       TWDR = angle.i>>24;
                                        TWI_ACK;
                                        break;
                                case 0x49: // Position angle
-                                       TWDR = pos_y.i>>16;
+                                       TWDR = angle.i>>16;
                                        TWI_ACK;
                                        break;
                                case 0x4A: // Position angle
-                                       TWDR = pos_y.i>>8;
+                                       TWDR = angle.i>>8;
                                        TWI_ACK;
                                        break;
                                case 0x4B: // Position angle LSB
-                                       TWDR = pos_y.i;
+                                       TWDR = angle.i;
                                        TWI_ACK;
                                        break;
                                case 0xA0: // Reset reason
@@ -895,6 +895,9 @@ int main(void) {
        DDRB = (1 << 3);
        DDRC = (1 << 7) | (1 << 6) | (1 << 5) | (1 << 4) | (1 << 3) | (1 << 2);
        DDRD = (1 << 7) | (1 << 5) | (1 << 4) | (1 << 3) | (1 << 2);
+       // Pullup TLEs EF
+       PORTB = (1 << 0) | (1 << 1) | (1 << 2);
+       PORTD = (1 << 6);
 
        bootloader = 0x00;
        setup_uart(9600);