Rev 1960 | Rev 1967 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1960 | Rev 1965 | ||
---|---|---|---|
Line 51... | Line 51... | ||
51 | 51 | ||
52 | #include <avr/io.h> |
52 | #include <avr/io.h> |
53 | #include <avr/interrupt.h> |
53 | #include <avr/interrupt.h> |
54 | #include <util/twi.h> |
54 | #include <util/twi.h> |
55 | #include <util/delay.h> |
- | |
56 | //#include "eeprom.h" |
55 | #include <util/delay.h> |
57 | #include "twimaster.h" |
- | |
58 | //#include "analog.h" |
56 | #include "twimaster.h" |
- | 57 | #include "configuration.h" |
|
59 | #include "configuration.h" |
58 | #include "analog.h" |
Line 60... | Line 59... | ||
60 | #include "printf_P.h" |
59 | #include "printf_P.h" |
61 | 60 | ||
62 | volatile uint8_t twi_state = TWI_STATE_MOTOR_TX; |
61 | volatile uint8_t twi_state = TWI_STATE_MOTOR_TX; |
63 | volatile uint8_t dac_channel = 0; |
62 | volatile uint8_t dac_channel = 0; |
64 | volatile uint8_t motor_write = 0; |
63 | volatile uint8_t motor_write = 0; |
65 | volatile uint8_t motor_read = 0; |
64 | volatile uint8_t motor_read = 0; |
Line 66... | Line 65... | ||
66 | volatile uint16_t I2CTimeout = 100; |
65 | volatile uint16_t I2CTimeout = 100; |
Line 67... | Line -... | ||
67 | uint8_t missingMotor = 0; |
- | |
68 | 66 | uint8_t missingMotor = 0; |
|
Line 69... | Line 67... | ||
69 | MotorData_t motor[MAX_MOTORS]; |
67 | |
70 | 68 | motorData_t motor[MAX_MOTORS]; |
|
Line 259... | Line 257... | ||
259 | case 8: |
257 | case 8: |
260 | I2C_WriteByte(0x10 + (DACChannel << 1)); // Select DAC Channel (0x10 = A, 0x12 = B, 0x14 = C) |
258 | I2C_WriteByte(0x10 + (DACChannel << 1)); // Select DAC Channel (0x10 = A, 0x12 = B, 0x14 = C) |
261 | break; |
259 | break; |
Line 262... | Line 260... | ||
262 | 260 | ||
263 | case 9: |
261 | case 9: |
264 | I2C_WriteByte(DACValues[DACChannel]); |
262 | I2C_WriteByte(DACValues.offsets[DACChannel]); |
Line 265... | Line 263... | ||
265 | break; |
263 | break; |
266 | 264 | ||
267 | case 10: |
265 | case 10: |