Rev 1682 | Rev 1690 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1682 | Rev 1683 | ||
---|---|---|---|
Line 165... | Line 165... | ||
165 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
165 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
166 | // Check connected BL-Ctrls |
166 | // Check connected BL-Ctrls |
167 | BLFlags |= BLFLAG_READ_VERSION; |
167 | BLFlags |= BLFLAG_READ_VERSION; |
168 | motor_read = 0; // read the first I2C-Data |
168 | motor_read = 0; // read the first I2C-Data |
169 | SendMotorData(); |
169 | SendMotorData(); |
- | 170 | timer = SetDelay(500); |
|
170 | while(!(BLFlags & BLFLAG_TX_COMPLETE)); //wait for complete transfer |
171 | while(!(BLFlags & BLFLAG_TX_COMPLETE) && !CheckDelay(timer)); //wait for complete transfer |
Line 171... | Line 172... | ||
171 | 172 | ||
172 | printf("\n\rFound BL-Ctrl: "); |
173 | printf("\n\rFound BL-Ctrl: "); |
173 | timer = SetDelay(4000); |
174 | timer = SetDelay(4000); |
174 | for(i=0; i < MAX_MOTORS; i++) |
175 | for(i=0; i < MAX_MOTORS; i++) |
175 | { |
176 | { |
176 | SendMotorData(); |
177 | SendMotorData(); |
177 | while(!(BLFlags & BLFLAG_TX_COMPLETE)); //wait for complete transfer |
178 | while(!(BLFlags & BLFLAG_TX_COMPLETE) && !CheckDelay(timer)); //wait for complete transfer |
178 | if(Mixer.Motor[i][0] > 0) // wait max 4 sec for the BL-Ctrls to wake up |
179 | if(Mixer.Motor[i][0] > 0) // wait max 4 sec for the BL-Ctrls to wake up |
179 | { |
180 | { |
180 | while(!CheckDelay(timer) && !(Motor[i].State & MOTOR_STATE_PRESENT_MASK) ) |
181 | while(!CheckDelay(timer) && !(Motor[i].State & MOTOR_STATE_PRESENT_MASK) ) |
181 | { |
182 | { |
182 | SendMotorData(); |
183 | SendMotorData(); |
183 | while(!(BLFlags & BLFLAG_TX_COMPLETE)); //wait for complete transfer |
184 | while(!(BLFlags & BLFLAG_TX_COMPLETE) && !CheckDelay(timer)); //wait for complete transfer |
184 | } |
185 | } |
185 | } |
186 | } |
186 | if(Motor[i].State & MOTOR_STATE_PRESENT_MASK) |
187 | if(Motor[i].State & MOTOR_STATE_PRESENT_MASK) |
187 | { |
188 | { |