Rev 1643 | Rev 1648 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1643 | Rev 1644 | ||
---|---|---|---|
Line 179... | Line 179... | ||
179 | 179 | ||
180 | //############################################################################ |
180 | //############################################################################ |
181 | SIGNAL (TWI_vect) |
181 | SIGNAL (TWI_vect) |
182 | //############################################################################ |
182 | //############################################################################ |
183 | { // 2 3 4 5 6 7 8 9 |
183 | { // 2 3 4 5 6 7 8 9 |
184 | unsigned char test[] = {0,0,'#',0x1F,255,30,99,49,0x00,7,8,9,10}; |
184 | unsigned char test[] = {0,0,'#',0x1F,255,30,99,64,0x00,7,8,9,10}; |
185 | static unsigned char missing_motor,send = 0,crc = 0,read_more = 0; |
185 | static unsigned char missing_motor,send = 0,crc = 0,read_more = 0; |
186 | 186 | J4High; |
|
187 | switch(twi_state++) |
187 | switch(twi_state++) |
188 | { |
188 | { |
189 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
189 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
190 | // Writing the Data |
190 | // Writing the Data |
Line 201... | Line 201... | ||
201 | send = 0; |
201 | send = 0; |
202 | break; |
202 | break; |
203 | case 1: |
203 | case 1: |
204 | i2c_write_byte(Motor[motor].SetPoint); |
204 | i2c_write_byte(Motor[motor].SetPoint); |
205 | // if(!(Motor[motor].Version & MOTOR_STATE_NEW_PROTOCOL_MASK) /*|| !Motor[motor].SetPointLowerBits*/) |
205 | // if(!(Motor[motor].Version & MOTOR_STATE_NEW_PROTOCOL_MASK) /*|| !Motor[motor].SetPointLowerBits*/) |
206 | if(!(Motor[motor].Version & MOTOR_STATE_NEW_PROTOCOL_MASK) || !Motor[motor].SetPointLowerBits && !TransmitBlConfig) |
206 | if((!(Motor[motor].Version & MOTOR_STATE_NEW_PROTOCOL_MASK) || !Motor[motor].SetPointLowerBits) && !TransmitBlConfig) |
207 | twi_state++; // skip |
207 | twi_state++; // skip |
208 | break; |
208 | break; |
209 | case 2: |
209 | case 2: |
210 | if(!send++) |
210 | if(!send++) |
211 | { |
211 | { |
Line 221... | Line 221... | ||
221 | } |
221 | } |
222 | if(TransmitBlConfig && !MotorenEin && motor == motorread && (Motor[motorread].Version & MOTOR_STATE_NEW_PROTOCOL_MASK)) |
222 | if(TransmitBlConfig && !MotorenEin && motor == motorread && (Motor[motorread].Version & MOTOR_STATE_NEW_PROTOCOL_MASK)) |
223 | { |
223 | { |
224 | if(send <= 10) twi_state--; |
224 | if(send <= 10) twi_state--; |
225 | } |
225 | } |
226 | - | ||
227 | break; |
226 | break; |
228 | case 3: |
227 | case 3: |
229 | motor++; |
228 | motor++; |
230 | if(TWSR == 0x30) |
229 | if(TWSR == 0x30) |
231 | { |
230 | { |
Line 351... | Line 350... | ||
351 | break; |
350 | break; |
352 | default: twi_state = 0; |
351 | default: twi_state = 0; |
353 | break; |
352 | break; |
354 | } |
353 | } |
355 | TWCR |= 0x80; |
354 | TWCR |= 0x80; |
- | 355 | J4Low; |
|
356 | } |
356 | } |