Rev 1868 | Rev 1965 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1868 | Rev 1960 | ||
---|---|---|---|
Line 196... | Line 196... | ||
196 | static uint8_t missing_motor = 0; |
196 | static uint8_t missing_motor = 0; |
197 | switch (twi_state++) { // First i2c_start from SendMotorData() |
197 | switch (twi_state++) { // First i2c_start from SendMotorData() |
198 | // Master Transmit |
198 | // Master Transmit |
199 | case 0: // TWI_STATE_MOTOR_TX |
199 | case 0: // TWI_STATE_MOTOR_TX |
200 | // skip motor if not used in mixer |
200 | // skip motor if not used in mixer |
201 | while ((Mixer.Motor[motor_write][MIX_THROTTLE] <= 0) && (motor_write |
201 | while ((mixerMatrix.motor[motor_write][MIX_THROTTLE] <= 0) && (motor_write < MAX_MOTORS)) |
202 | < MAX_MOTORS)) |
- | |
203 | motor_write++; |
202 | motor_write++; |
204 | if (motor_write >= MAX_MOTORS) { // writing finished, read now |
203 | if (motor_write >= MAX_MOTORS) { // writing finished, read now |
205 | motor_write = 0; |
204 | motor_write = 0; |
206 | twi_state = TWI_STATE_MOTOR_RX; |
205 | twi_state = TWI_STATE_MOTOR_RX; |
207 | I2C_WriteByte(0x53 + (motor_read * 2)); // select slave adress in rx mode |
206 | I2C_WriteByte(0x53 + (motor_read * 2)); // select slave adress in rx mode |
Line 310... | Line 309... | ||
310 | if (motor[i].Present) |
309 | if (motor[i].Present) |
311 | printf("%d ",i+1); |
310 | printf("%d ",i+1); |
312 | } |
311 | } |
Line 313... | Line 312... | ||
313 | 312 | ||
314 | for (i = 0; i < MAX_MOTORS; i++) { |
313 | for (i = 0; i < MAX_MOTORS; i++) { |
315 | if (!motor[i].Present && Mixer.Motor[i][MIX_THROTTLE] > 0) |
314 | if (!motor[i].Present && mixerMatrix.motor[i][MIX_THROTTLE] > 0) |
316 | printf("\n\r\n\r!! MISSING BL-CTRL: %d !!",i + 1); |
315 | printf("\n\r\n\r!! MISSING BL-CTRL: %d !!",i + 1); |
317 | motor[i].Error = 0; |
316 | motor[i].Error = 0; |
318 | } |
317 | } |