Rev 2097 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2097 | Rev 2158 | ||
---|---|---|---|
Line 142... | Line 142... | ||
142 | static uint8_t missing_motor = 0; |
142 | static uint8_t missing_motor = 0; |
143 | switch (twi_state++) { // First i2c_start from SendMotorData() |
143 | switch (twi_state++) { // First i2c_start from SendMotorData() |
144 | // Master Transmit |
144 | // Master Transmit |
145 | case 0: // TWI_STATE_MOTOR_TX |
145 | case 0: // TWI_STATE_MOTOR_TX |
146 | // skip motor if not used in mixer |
146 | // skip motor if not used in mixer |
147 | while ((mixerMatrix.motor[motor_write][MIX_THROTTLE] <= 0) && (motor_write < MAX_MOTORS)) |
147 | while ((motorMixer.matrix[motor_write][MIX_THROTTLE] <= 0) && (motor_write < MAX_MOTORS)) |
148 | motor_write++; |
148 | motor_write++; |
149 | if (motor_write >= MAX_MOTORS) { // writing finished, read now |
149 | if (motor_write >= MAX_MOTORS) { // writing finished, read now |
150 | motor_write = 0; |
150 | motor_write = 0; |
151 | twi_state = TWI_STATE_MOTOR_RX; |
151 | twi_state = TWI_STATE_MOTOR_RX; |
152 | I2C_WriteByte(0x53 + (motor_read * 2)); // select slave adress in rx mode |
152 | I2C_WriteByte(0x53 + (motor_read * 2)); // select slave adress in rx mode |
Line 255... | Line 255... | ||
255 | if (motor[i].present) |
255 | if (motor[i].present) |
256 | printf("%d ",i+1); |
256 | printf("%d ",i+1); |
257 | } |
257 | } |
Line 258... | Line 258... | ||
258 | 258 | ||
259 | for (i = 0; i < MAX_MOTORS; i++) { |
259 | for (i = 0; i < MAX_MOTORS; i++) { |
260 | if (!motor[i].present && mixerMatrix.motor[i][MIX_THROTTLE] > 0) |
260 | if (!motor[i].present && motorMixer.matrix[i][MIX_THROTTLE] > 0) |
261 | printf("\n\r\n\r!! MISSING BL-CTRL: %d !!",i + 1); |
261 | printf("\n\r\n\r!! MISSING BL-CTRL: %d !!",i + 1); |
262 | motor[i].error = 0; |
262 | motor[i].error = 0; |
263 | } |
263 | } |